From 0606c5cb1fd02f3afc96934c8021c75c5194c4a8 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 27 May 2026 02:29:31 +0000 Subject: [PATCH 1/2] feat: add allow_requester_specified_not_before_time and requested_not_before_time fields to PrivateCA v1 API docs: update comments for backdate_duration field in CaPool docs: update comments for parent field in ListCertificatesRequest PiperOrigin-RevId: 921762720 Source-Link: https://github.com/googleapis/googleapis/commit/ec2e5108648ebb5ba2f9da69bdb2494e38f734df Source-Link: https://github.com/googleapis/googleapis-gen/commit/b8da48e8a8aaabd7f6fc39ed2f5cfd1804c7e255 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5LXByaXZhdGVjYS8uT3dsQm90LnlhbWwiLCJoIjoiYjhkYTQ4ZThhOGFhYWJkN2Y2ZmMzOWVkMmY1Y2ZkMTgwNGM3ZTI1NSJ9 --- .../.eslintignore | 7 + .../.eslintrc.json | 4 + .../.gitignore | 14 + .../google-cloud-security-privateca/.jsdoc.js | 55 + .../.mocharc.js | 33 + .../google-cloud-security-privateca/.nycrc | 24 + .../google-cloud-security-privateca/README.md | 164 + .../security/privateca/v1/resources.proto | 1656 + .../cloud/security/privateca/v1/service.proto | 1484 + .../privateca/v1beta1/resources.proto | 902 + .../security/privateca/v1beta1/service.proto | 870 + .../protos/protos.d.ts | 26491 ++++++ .../protos/protos.js | 68543 ++++++++++++++++ .../protos/protos.json | 7802 ++ ..._service.activate_certificate_authority.js | 90 + ...ficate_authority_service.create_ca_pool.js | 90 + ...te_authority_service.create_certificate.js | 126 + ...ty_service.create_certificate_authority.js | 92 + ...ity_service.create_certificate_template.js | 91 + ...ficate_authority_service.delete_ca_pool.js | 85 + ...ty_service.delete_certificate_authority.js | 96 + ...ity_service.delete_certificate_template.js | 78 + ...y_service.disable_certificate_authority.js | 85 + ...ty_service.enable_certificate_authority.js | 78 + ...ficate_authority_service.fetch_ca_certs.js | 77 + ...service.fetch_certificate_authority_csr.js | 63 + ...rtificate_authority_service.get_ca_pool.js | 62 + ...icate_authority_service.get_certificate.js | 63 + ...ority_service.get_certificate_authority.js | 64 + ...service.get_certificate_revocation_list.js | 65 + ...hority_service.get_certificate_template.js | 64 + ...ificate_authority_service.list_ca_pools.js | 88 + ...ty_service.list_certificate_authorities.js | 90 + ...rvice.list_certificate_revocation_lists.js | 89 + ...rity_service.list_certificate_templates.js | 89 + ...ate_authority_service.list_certificates.js | 100 + ...te_authority_service.revoke_certificate.js | 84 + ..._service.undelete_certificate_authority.js | 78 + ...ficate_authority_service.update_ca_pool.js | 82 + ...te_authority_service.update_certificate.js | 81 + ...ty_service.update_certificate_authority.js | 83 + ...vice.update_certificate_revocation_list.js | 83 + ...ity_service.update_certificate_template.js | 83 + ...ta_google.cloud.security.privateca.v1.json | 1419 + ..._service.activate_certificate_authority.js | 89 + ...te_authority_service.create_certificate.js | 89 + ...ty_service.create_certificate_authority.js | 89 + ...y_service.disable_certificate_authority.js | 77 + ...ty_service.enable_certificate_authority.js | 77 + ...service.fetch_certificate_authority_csr.js | 62 + ...icate_authority_service.get_certificate.js | 61 + ...ority_service.get_certificate_authority.js | 62 + ...service.get_certificate_revocation_list.js | 62 + ...e_authority_service.get_reusable_config.js | 61 + ...ty_service.list_certificate_authorities.js | 87 + ...rvice.list_certificate_revocation_lists.js | 87 + ...ate_authority_service.list_certificates.js | 91 + ...authority_service.list_reusable_configs.js | 87 + ...y_service.restore_certificate_authority.js | 77 + ...te_authority_service.revoke_certificate.js | 81 + ...e.schedule_delete_certificate_authority.js | 77 + ...te_authority_service.update_certificate.js | 80 + ...ty_service.update_certificate_authority.js | 81 + ...vice.update_certificate_revocation_list.js | 81 + ...ogle.cloud.security.privateca.v1beta1.json | 963 + .../src/index.ts | 28 + .../certificate_authority_service_client.ts | 7233 ++ ...icate_authority_service_client_config.json | 176 + ...tificate_authority_service_proto_list.json | 4 + .../src/v1/gapic_metadata.json | 333 + .../src/v1/index.ts | 19 + .../certificate_authority_service_client.ts | 4703 ++ ...icate_authority_service_client_config.json | 131 + ...tificate_authority_service_proto_list.json | 4 + .../src/v1beta1/gapic_metadata.json | 239 + .../src/v1beta1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 37 + .../system-test/install.ts | 51 + .../gapic_certificate_authority_service_v1.ts | 8138 ++ ...c_certificate_authority_service_v1beta1.ts | 5151 ++ .../tsconfig.json | 22 + .../webpack.config.js | 64 + 83 files changed, 140767 insertions(+) create mode 100644 owl-bot-staging/google-cloud-security-privateca/.eslintignore create mode 100644 owl-bot-staging/google-cloud-security-privateca/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-security-privateca/.gitignore create mode 100644 owl-bot-staging/google-cloud-security-privateca/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/.nycrc create mode 100644 owl-bot-staging/google-cloud-security-privateca/README.md create mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto create mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto create mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/resources.proto create mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/service.proto create mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.activate_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_ca_pool.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_template.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_template.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.enable_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_ca_certs.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_ca_pool.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_template.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_ca_pools.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_authorities.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_templates.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.revoke_certificate.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_ca_pool.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_template.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificates.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata_google.cloud.security.privateca.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-security-privateca/src/index.ts create mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts create mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts create mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1beta1/index.ts create mode 100644 owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-security-privateca/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-security-privateca/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-security-privateca/webpack.config.js diff --git a/owl-bot-staging/google-cloud-security-privateca/.eslintignore b/owl-bot-staging/google-cloud-security-privateca/.eslintignore new file mode 100644 index 000000000000..cfc348ec4d11 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-security-privateca/.eslintrc.json b/owl-bot-staging/google-cloud-security-privateca/.eslintrc.json new file mode 100644 index 000000000000..3e8d97ccb390 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/.eslintrc.json @@ -0,0 +1,4 @@ +{ + "extends": "./node_modules/gts", + "root": true +} diff --git a/owl-bot-staging/google-cloud-security-privateca/.gitignore b/owl-bot-staging/google-cloud-security-privateca/.gitignore new file mode 100644 index 000000000000..d4f03a0df2e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-security-privateca/.jsdoc.js b/owl-bot-staging/google-cloud-security-privateca/.jsdoc.js new file mode 100644 index 000000000000..e4555d1293b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/security-private-ca', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-security-privateca/.mocharc.js b/owl-bot-staging/google-cloud-security-privateca/.mocharc.js new file mode 100644 index 000000000000..5eb34e86c874 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-security-privateca/.nycrc b/owl-bot-staging/google-cloud-security-privateca/.nycrc new file mode 100644 index 000000000000..81a95fc94b00 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-privateca/README.md b/owl-bot-staging/google-cloud-security-privateca/README.md new file mode 100644 index 000000000000..144374d14e4c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/README.md @@ -0,0 +1,164 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Certificate Authority API: Nodejs Client][homepage] + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority + +[![npm version](https://img.shields.io/npm/v/@google-cloud/security-private-ca.svg)](https://www.npmjs.org/package/@google-cloud/security-private-ca) + +Certificate Authority API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Certificate Authority API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/privateca/latest) + + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Certificate Authority API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/security-private-ca +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | +| --------------------------- | --------------------------------- | +| activate certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.activate_certificate_authority.js) | +| create ca pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_ca_pool.js) | +| create certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate.js) | +| create certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_authority.js) | +| create certificate template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_template.js) | +| delete ca pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js) | +| delete certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js) | +| delete certificate template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_template.js) | +| disable certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js) | +| enable certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.enable_certificate_authority.js) | +| fetch ca certs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_ca_certs.js) | +| fetch certificate authority csr | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js) | +| get ca pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_ca_pool.js) | +| get certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate.js) | +| get certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_authority.js) | +| get certificate revocation list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js) | +| get certificate template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_template.js) | +| list ca pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_ca_pools.js) | +| list certificate authorities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_authorities.js) | +| list certificate revocation lists | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js) | +| list certificate templates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_templates.js) | +| list certificates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js) | +| revoke certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.revoke_certificate.js) | +| undelete certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js) | +| update ca pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_ca_pool.js) | +| update certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate.js) | +| update certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_authority.js) | +| update certificate revocation list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js) | +| update certificate template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_template.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json) | +| activate certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js) | +| create certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate.js) | +| create certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js) | +| disable certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js) | +| enable certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js) | +| fetch certificate authority csr | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js) | +| get certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate.js) | +| get certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js) | +| get certificate revocation list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js) | +| get reusable config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js) | +| list certificate authorities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js) | +| list certificate revocation lists | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js) | +| list certificates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificates.js) | +| list reusable configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js) | +| restore certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js) | +| revoke certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js) | +| schedule delete certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js) | +| update certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate.js) | +| update certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js) | +| update certificate revocation list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata_google.cloud.security.privateca.v1beta1.json) | + + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/security-private-ca@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=privateca.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto new file mode 100644 index 000000000000..ba54ee133ad0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto @@ -0,0 +1,1656 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.security.privateca.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/expr.proto"; + +option csharp_namespace = "Google.Cloud.Security.PrivateCA.V1"; +option go_package = "cloud.google.com/go/security/privateca/apiv1/privatecapb;privatecapb"; +option java_multiple_files = true; +option java_outer_classname = "PrivateCaResourcesProto"; +option java_package = "com.google.cloud.security.privateca.v1"; +option php_namespace = "Google\\Cloud\\Security\\PrivateCA\\V1"; +option ruby_package = "Google::Cloud::Security::PrivateCA::V1"; + +// A +// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] +// represents an individual Certificate Authority. A +// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] +// can be used to create +// [Certificates][google.cloud.security.privateca.v1.Certificate]. +message CertificateAuthority { + option (google.api.resource) = { + type: "privateca.googleapis.com/CertificateAuthority" + pattern: "projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}" + }; + + // The type of a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority], + // indicating its issuing chain. + enum Type { + // Not specified. + TYPE_UNSPECIFIED = 0; + + // Self-signed CA. + SELF_SIGNED = 1; + + // Subordinate CA. Could be issued by a Private CA + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // or an unmanaged CA. + SUBORDINATE = 2; + } + + // The state of a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority], + // indicating if it can be used. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // Certificates can be issued from this CA. CRLs will be generated for this + // CA. The CA will be part of the + // [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and + // will be used to issue certificates from the + // [CaPool][google.cloud.security.privateca.v1.CaPool]. + ENABLED = 1; + + // Certificates cannot be issued from this CA. CRLs will still be generated. + // The CA will be part of the + // [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, but + // will not be used to issue certificates from the + // [CaPool][google.cloud.security.privateca.v1.CaPool]. + DISABLED = 2; + + // Certificates can be issued from this CA. CRLs will be generated for this + // CA. The CA will be part of the + // [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, but + // will not be used to issue certificates from the + // [CaPool][google.cloud.security.privateca.v1.CaPool]. + STAGED = 3; + + // Certificates cannot be issued from this CA. CRLs will not be generated. + // The CA will not be part of the + // [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and + // will not be used to issue certificates from the + // [CaPool][google.cloud.security.privateca.v1.CaPool]. + AWAITING_USER_ACTIVATION = 4; + + // Certificates cannot be issued from this CA. CRLs will not be generated. + // The CA may still be recovered by calling + // [CertificateAuthorityService.UndeleteCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority] + // before + // [expire_time][google.cloud.security.privateca.v1.CertificateAuthority.expire_time]. + // The CA will not be part of the + // [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and + // will not be used to issue certificates from the + // [CaPool][google.cloud.security.privateca.v1.CaPool]. + DELETED = 5; + } + + // URLs where a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // will publish content. + message AccessUrls { + // The URL where this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s + // CA certificate is published. This will only be set for CAs that have been + // activated. + string ca_certificate_access_url = 1; + + // The URLs where this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s + // CRLs are published. This will only be set for CAs that have been + // activated. + repeated string crl_access_urls = 2; + } + + // A Cloud KMS key configuration that a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // will use. + message KeyVersionSpec { + oneof KeyVersion { + // The resource name for an existing Cloud KMS CryptoKeyVersion in the + // format + // `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + // This option enables full flexibility in the key's capabilities and + // properties. + string cloud_kms_key_version = 1; + + // The algorithm to use for creating a managed Cloud KMS key for a for a + // simplified experience. All managed keys will be have their + // [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`. + SignHashAlgorithm algorithm = 2; + } + } + + // The algorithm of a Cloud KMS CryptoKeyVersion of a + // [CryptoKey][google.cloud.kms.v1.CryptoKey] with the + // [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] value + // `ASYMMETRIC_SIGN`. These values correspond to the + // [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + // values. For RSA signing algorithms, the PSS algorithms should be preferred, + // use PKCS1 algorithms if required for compatibility. For further + // recommendations, see + // https://cloud.google.com/kms/docs/algorithms#algorithm_recommendations. + enum SignHashAlgorithm { + // Not specified. + SIGN_HASH_ALGORITHM_UNSPECIFIED = 0; + + // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256 + RSA_PSS_2048_SHA256 = 1; + + // maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256 + RSA_PSS_3072_SHA256 = 2; + + // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256 + RSA_PSS_4096_SHA256 = 3; + + // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256 + RSA_PKCS1_2048_SHA256 = 6; + + // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256 + RSA_PKCS1_3072_SHA256 = 7; + + // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256 + RSA_PKCS1_4096_SHA256 = 8; + + // maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256 + EC_P256_SHA256 = 4; + + // maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384 + EC_P384_SHA384 = 5; + } + + // User-defined URLs for accessing content published by this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + message UserDefinedAccessUrls { + // Optional. A list of URLs where the issuer CA certificate may be + // downloaded, which appears in the "Authority Information Access" extension + // in the certificate. If specified, the default [Cloud Storage + // URLs][google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.ca_certificate_access_url] + // will be omitted. + repeated string aia_issuing_certificate_urls = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of URLs where to obtain CRL information, i.e. + // the DistributionPoint.fullName described by + // https://tools.ietf.org/html/rfc5280#section-4.2.1.13. + // If specified, the default + // [Cloud Storage + // URLs][google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.crl_access_urls] + // will be omitted. + repeated string crl_access_urls = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The resource name for this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. The + // [Type][google.cloud.security.privateca.v1.CertificateAuthority.Type] of + // this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + Type type = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The config used to create a self-signed X.509 + // certificate or CSR. + CertificateConfig config = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The desired lifetime of the CA certificate. Used to + // create the "not_before_time" and "not_after_time" fields inside an X.509 + // certificate. + google.protobuf.Duration lifetime = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. Used when issuing certificates for this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + // If this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // is a self-signed CertificateAuthority, this key is also used to sign the + // self-signed CA certificate. Otherwise, it is used to sign a CSR. + KeyVersionSpec key_spec = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. If this is a subordinate + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority], + // this field will be set with the subordinate configuration, which describes + // its issuers. This may be updated, but this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // must continue to validate. + SubordinateConfig subordinate_config = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The + // [CaPool.Tier][google.cloud.security.privateca.v1.CaPool.Tier] of the + // [CaPool][google.cloud.security.privateca.v1.CaPool] that includes this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + CaPool.Tier tier = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The + // [State][google.cloud.security.privateca.v1.CertificateAuthority.State] for + // this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s + // certificate chain, including the current + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s + // certificate. Ordered such that the root issuer is the final element + // (consistent with RFC 5246). For a self-signed CA, this will only list the + // current + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s + // certificate. + repeated string pem_ca_certificates = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A structured description of this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s + // CA certificate and its issuers. Ordered as self-to-root. + repeated CertificateDescription ca_certificate_descriptions = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The name of a Cloud Storage bucket where this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // will publish content, such as the CA certificate and CRLs. This must be a + // bucket name, without any prefixes (such as `gs://`) or suffixes (such as + // `.googleapis.com`). For example, to use a bucket named `my-bucket`, you + // would simply specify `my-bucket`. If not specified, a managed bucket will + // be created. + string gcs_bucket = 11 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. URLs for accessing content published by this CA, such as the + // CA certificate and CRLs. + AccessUrls access_urls = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // was created. + google.protobuf.Timestamp create_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // was last updated. + google.protobuf.Timestamp update_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // was soft deleted, if it is in the + // [DELETED][google.cloud.security.privateca.v1.CertificateAuthority.State.DELETED] + // state. + google.protobuf.Timestamp delete_time = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // will be permanently purged, if it is in the + // [DELETED][google.cloud.security.privateca.v1.CertificateAuthority.State.DELETED] + // state. + google.protobuf.Timestamp expire_time = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels with user-defined metadata. + map labels = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-defined URLs for CA certificate and CRLs. The service does + // not publish content to these URLs. It is up to the user to mirror content + // to these URLs. + UserDefinedAccessUrls user_defined_access_urls = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A [CaPool][google.cloud.security.privateca.v1.CaPool] represents a group of +// [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority] +// that form a trust anchor. A +// [CaPool][google.cloud.security.privateca.v1.CaPool] can be used to manage +// issuance policies for one or more +// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] +// resources and to rotate CA certificates in and out of the trust anchor. +message CaPool { + option (google.api.resource) = { + type: "privateca.googleapis.com/CaPool" + pattern: "projects/{project}/locations/{location}/caPools/{ca_pool}" + }; + + // The tier of a [CaPool][google.cloud.security.privateca.v1.CaPool], + // indicating its supported functionality and/or billing SKU. + enum Tier { + // Not specified. + TIER_UNSPECIFIED = 0; + + // Enterprise tier. + ENTERPRISE = 1; + + // DevOps tier. + DEVOPS = 2; + } + + // Options relating to the publication of each + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s + // CA certificate and CRLs and their inclusion as extensions in issued + // [Certificates][google.cloud.security.privateca.v1.Certificate]. The options + // set here apply to certificates issued by any + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in the [CaPool][google.cloud.security.privateca.v1.CaPool]. + message PublishingOptions { + // Supported encoding formats for publishing. + enum EncodingFormat { + // Not specified. By default, PEM format will be used. + ENCODING_FORMAT_UNSPECIFIED = 0; + + // The + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s + // CA certificate and CRLs will be published in PEM format. + PEM = 1; + + // The + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s + // CA certificate and CRLs will be published in DER format. + DER = 2; + } + + // Optional. When true, publishes each + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s + // CA certificate and includes its URL in the "Authority Information Access" + // X.509 extension in all issued + // [Certificates][google.cloud.security.privateca.v1.Certificate]. If this + // is false, the CA certificate will not be published and the corresponding + // X.509 extension will not be written in issued certificates. + bool publish_ca_cert = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When true, publishes each + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s + // CRL and includes its URL in the "CRL Distribution Points" X.509 extension + // in all issued + // [Certificates][google.cloud.security.privateca.v1.Certificate]. If this + // is false, CRLs will not be published and the corresponding X.509 + // extension will not be written in issued certificates. CRLs will expire 7 + // days from their creation. However, we will rebuild daily. CRLs are also + // rebuilt shortly after a certificate is revoked. + bool publish_crl = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the encoding format of each + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // resource's CA certificate and CRLs. If this is omitted, CA certificates + // and CRLs will be published in PEM. + EncodingFormat encoding_format = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Defines controls over all certificate issuance within a + // [CaPool][google.cloud.security.privateca.v1.CaPool]. + message IssuancePolicy { + // Describes a "type" of key that may be used in a + // [Certificate][google.cloud.security.privateca.v1.Certificate] issued from + // a [CaPool][google.cloud.security.privateca.v1.CaPool]. Note that a single + // [AllowedKeyType][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType] + // may refer to either a fully-qualified key algorithm, such as RSA 4096, or + // a family of key algorithms, such as any RSA key. + message AllowedKeyType { + // Describes an RSA key that may be used in a + // [Certificate][google.cloud.security.privateca.v1.Certificate] issued + // from a [CaPool][google.cloud.security.privateca.v1.CaPool]. + message RsaKeyType { + // Optional. The minimum allowed RSA modulus size (inclusive), in bits. + // If this is not set, or if set to zero, the service-level min RSA + // modulus size will continue to apply. + int64 min_modulus_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum allowed RSA modulus size (inclusive), in bits. + // If this is not set, or if set to zero, the service will not enforce + // an explicit upper bound on RSA modulus sizes. + int64 max_modulus_size = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Describes an Elliptic Curve key that may be used in a + // [Certificate][google.cloud.security.privateca.v1.Certificate] issued + // from a [CaPool][google.cloud.security.privateca.v1.CaPool]. + message EcKeyType { + // Describes an elliptic curve-based signature algorithm that may be + // used in a + // [Certificate][google.cloud.security.privateca.v1.Certificate] issued + // from a [CaPool][google.cloud.security.privateca.v1.CaPool]. + enum EcSignatureAlgorithm { + // Not specified. Signifies that any signature algorithm may be used. + EC_SIGNATURE_ALGORITHM_UNSPECIFIED = 0; + + // Refers to the Elliptic Curve Digital Signature Algorithm over the + // NIST P-256 curve. + ECDSA_P256 = 1; + + // Refers to the Elliptic Curve Digital Signature Algorithm over the + // NIST P-384 curve. + ECDSA_P384 = 2; + + // Refers to the Edwards-curve Digital Signature Algorithm over curve + // 25519, as described in RFC 8410. + EDDSA_25519 = 3; + } + + // Optional. A signature algorithm that must be used. If this is + // omitted, any EC-based signature algorithm will be allowed. + EcSignatureAlgorithm signature_algorithm = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + oneof key_type { + // Represents an allowed RSA key type. + RsaKeyType rsa = 1; + + // Represents an allowed Elliptic Curve key type. + EcKeyType elliptic_curve = 2; + } + } + + // [IssuanceModes][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes] + // specifies the allowed ways in which + // [Certificates][google.cloud.security.privateca.v1.Certificate] may be + // requested from this [CaPool][google.cloud.security.privateca.v1.CaPool]. + message IssuanceModes { + // Optional. When true, allows callers to create + // [Certificates][google.cloud.security.privateca.v1.Certificate] by + // specifying a CSR. + bool allow_csr_based_issuance = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When true, allows callers to create + // [Certificates][google.cloud.security.privateca.v1.Certificate] by + // specifying a + // [CertificateConfig][google.cloud.security.privateca.v1.CertificateConfig]. + bool allow_config_based_issuance = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. If any + // [AllowedKeyType][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType] + // is specified, then the certificate request's public key must match one of + // the key types listed here. Otherwise, any key may be used. + repeated AllowedKeyType allowed_key_types = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, all certificates issued from this + // [CaPool][google.cloud.security.privateca.v1.CaPool] will be backdated by + // this duration. The 'not_before_time' will be the issuance time minus this + // [backdate_duration][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdate_duration], + // and the 'not_after_time' will be adjusted to preserve the requested + // lifetime. The maximum duration that a certificate can be backdated with + // these options is 48 hours in the past. + // This option cannot be set if + // [allow_requester_specified_not_before_time][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allow_requester_specified_not_before_time] + // is set. + google.protobuf.Duration backdate_duration = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, allows requesters to specify the + // [requested_not_before_time][google.cloud.security.privateca.v1.Certificate.requested_not_before_time] + // field when creating a + // [Certificate][google.cloud.security.privateca.v1.Certificate]. + // Certificates requested with this option enabled will have a + // 'not_before_time' equal to the value specified in the request. The + // 'not_after_time' will be adjusted to preserve the requested lifetime. The + // maximum time that a certificate can be backdated with these options is 48 + // hours in the past. This option cannot be set if + // [backdate_duration][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdate_duration] + // is set. + bool allow_requester_specified_not_before_time = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum lifetime allowed for issued + // [Certificates][google.cloud.security.privateca.v1.Certificate]. Note that + // if the issuing + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // expires before a + // [Certificate][google.cloud.security.privateca.v1.Certificate] resource's + // requested maximum_lifetime, the effective lifetime will be explicitly + // truncated to match it. + google.protobuf.Duration maximum_lifetime = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If specified, then only methods allowed in the + // [IssuanceModes][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes] + // may be used to issue + // [Certificates][google.cloud.security.privateca.v1.Certificate]. + IssuanceModes allowed_issuance_modes = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of X.509 values that will be applied to all certificates + // issued through this [CaPool][google.cloud.security.privateca.v1.CaPool]. + // If a certificate request includes conflicting values for the same + // properties, they will be overwritten by the values defined here. If a + // certificate request uses a + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + // that defines conflicting + // [predefined_values][google.cloud.security.privateca.v1.CertificateTemplate.predefined_values] + // for the same properties, the certificate issuance request will fail. + X509Parameters baseline_values = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes constraints on identities that may appear in + // [Certificates][google.cloud.security.privateca.v1.Certificate] issued + // through this [CaPool][google.cloud.security.privateca.v1.CaPool]. If this + // is omitted, then this [CaPool][google.cloud.security.privateca.v1.CaPool] + // will not add restrictions on a certificate's identity. + CertificateIdentityConstraints identity_constraints = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the set of X.509 extensions that may appear in a + // [Certificate][google.cloud.security.privateca.v1.Certificate] issued + // through this [CaPool][google.cloud.security.privateca.v1.CaPool]. If a + // certificate request sets extensions that don't appear in the + // [passthrough_extensions][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.passthrough_extensions], + // those extensions will be dropped. If a certificate request uses a + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + // with + // [predefined_values][google.cloud.security.privateca.v1.CertificateTemplate.predefined_values] + // that don't appear here, the certificate issuance request will fail. If + // this is omitted, then this + // [CaPool][google.cloud.security.privateca.v1.CaPool] will not add + // restrictions on a certificate's X.509 extensions. These constraints do + // not apply to X.509 extensions set in this + // [CaPool][google.cloud.security.privateca.v1.CaPool]'s + // [baseline_values][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values]. + CertificateExtensionConstraints passthrough_extensions = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The resource name for this + // [CaPool][google.cloud.security.privateca.v1.CaPool] in the format + // `projects/*/locations/*/caPools/*`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. The + // [Tier][google.cloud.security.privateca.v1.CaPool.Tier] of this + // [CaPool][google.cloud.security.privateca.v1.CaPool]. + Tier tier = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The + // [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy] + // to control how + // [Certificates][google.cloud.security.privateca.v1.Certificate] will be + // issued from this [CaPool][google.cloud.security.privateca.v1.CaPool]. + IssuancePolicy issuance_policy = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The + // [PublishingOptions][google.cloud.security.privateca.v1.CaPool.PublishingOptions] + // to follow when issuing + // [Certificates][google.cloud.security.privateca.v1.Certificate] from any + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in this [CaPool][google.cloud.security.privateca.v1.CaPool]. + PublishingOptions publishing_options = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When + // [EncryptionSpec][google.cloud.security.privateca.v1.EncryptionSpec] is + // provided, the [Subject][google.cloud.security.privateca.v1.Subject], + // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames], and + // the PEM-encoded certificate fields will be encrypted at rest. + EncryptionSpec encryption_spec = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Labels with user-defined metadata. + map labels = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration used for encrypting data at rest. +message EncryptionSpec { + // The resource name for a Cloud KMS key in the format + // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string cloud_kms_key = 1; +} + +// A +// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] +// corresponds to a signed X.509 certificate Revocation List (CRL). A CRL +// contains the serial numbers of certificates that should no longer be trusted. +message CertificateRevocationList { + option (google.api.resource) = { + type: "privateca.googleapis.com/CertificateRevocationList" + pattern: "projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}" + }; + + // Describes a revoked + // [Certificate][google.cloud.security.privateca.v1.Certificate]. + message RevokedCertificate { + // The resource name for the + // [Certificate][google.cloud.security.privateca.v1.Certificate] in the + // format `projects/*/locations/*/caPools/*/certificates/*`. + string certificate = 1 [(google.api.resource_reference) = { + type: "privateca.googleapis.com/Certificate" + }]; + + // The serial number of the + // [Certificate][google.cloud.security.privateca.v1.Certificate]. + string hex_serial_number = 2; + + // The reason the + // [Certificate][google.cloud.security.privateca.v1.Certificate] was + // revoked. + RevocationReason revocation_reason = 3; + } + + // The state of a + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList], + // indicating if it is current. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] + // is up to date. + ACTIVE = 1; + + // The + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] + // is no longer current. + SUPERSEDED = 2; + } + + // Identifier. The resource name for this + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] + // in the format `projects/*/locations/*/caPools/*certificateAuthorities/*/ + // certificateRevocationLists/*`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The CRL sequence number that appears in pem_crl. + int64 sequence_number = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The revoked serial numbers that appear in pem_crl. + repeated RevokedCertificate revoked_certificates = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The PEM-encoded X.509 CRL. + string pem_crl = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The location where 'pem_crl' can be accessed. + string access_url = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The + // [State][google.cloud.security.privateca.v1.CertificateRevocationList.State] + // for this + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] + // was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] + // was updated. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The revision ID of this + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. + // A new revision is committed whenever a new CRL is published. The format is + // an 8-character hexadecimal string. + string revision_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels with user-defined metadata. + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// A [Certificate][google.cloud.security.privateca.v1.Certificate] corresponds +// to a signed X.509 certificate issued by a +// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. +message Certificate { + option (google.api.resource) = { + type: "privateca.googleapis.com/Certificate" + pattern: "projects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}" + }; + + // Describes fields that are relavent to the revocation of a + // [Certificate][google.cloud.security.privateca.v1.Certificate]. + message RevocationDetails { + // Indicates why a + // [Certificate][google.cloud.security.privateca.v1.Certificate] was + // revoked. + RevocationReason revocation_state = 1; + + // The time at which this + // [Certificate][google.cloud.security.privateca.v1.Certificate] was + // revoked. + google.protobuf.Timestamp revocation_time = 2; + } + + // Identifier. The resource name for this + // [Certificate][google.cloud.security.privateca.v1.Certificate] in the format + // `projects/*/locations/*/caPools/*/certificates/*`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The config used to create a signed X.509 certificate. + oneof certificate_config { + // Immutable. A pem-encoded X.509 certificate signing request (CSR). + string pem_csr = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. A description of the certificate and key that does not require + // X.509 or ASN.1. + CertificateConfig config = 3 [(google.api.field_behavior) = IMMUTABLE]; + } + + // Output only. The resource name of the issuing + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + string issuer_certificate_authority = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Required. Immutable. The desired lifetime of a certificate. Used to create + // the "not_before_time" and "not_after_time" fields inside an X.509 + // certificate. Note that the lifetime may be truncated if it would extend + // past the life of any certificate authority in the issuing chain. + google.protobuf.Duration lifetime = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. The resource name for a + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + // used to issue this certificate, in the format + // `projects/*/locations/*/certificateTemplates/*`. + // If this is specified, the caller must have the necessary permission to + // use this template. If this is omitted, no template will be used. + // This template must be in the same location as the + // [Certificate][google.cloud.security.privateca.v1.Certificate]. + string certificate_template = 6 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateTemplate" + } + ]; + + // Immutable. Specifies how the + // [Certificate][google.cloud.security.privateca.v1.Certificate]'s identity + // fields are to be decided. If this is omitted, the `DEFAULT` subject mode + // will be used. + SubjectRequestMode subject_mode = 7 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Details regarding the revocation of this + // [Certificate][google.cloud.security.privateca.v1.Certificate]. This + // [Certificate][google.cloud.security.privateca.v1.Certificate] is considered + // revoked if and only if this field is present. + RevocationDetails revocation_details = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The pem-encoded, signed X.509 certificate. + string pem_certificate = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A structured description of the issued X.509 certificate. + CertificateDescription certificate_description = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The chain that may be used to verify the X.509 certificate. + // Expected to be in issuer-to-root order according to RFC 5246. + repeated string pem_certificate_chain = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this + // [Certificate][google.cloud.security.privateca.v1.Certificate] was created. + google.protobuf.Timestamp create_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this + // [Certificate][google.cloud.security.privateca.v1.Certificate] was updated. + google.protobuf.Timestamp update_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels with user-defined metadata. + map labels = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The requested + // [not_before_time][google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.not_before_time] + // of this [Certificate][google.cloud.security.privateca.v1.Certificate]. This + // field may only be set if the + // [CaPool.IssuancePolicy.allow_requester_specified_not_before_time][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allow_requester_specified_not_before_time] + // field is set to true for the issuing + // [CaPool][google.cloud.security.privateca.v1.CaPool]. + // + // If this field is specified, the certificate will be issued with this + // 'not_before_time'. If this is not specified, the 'not_before_time' will be + // set to the issuance time or issuance time minus + // [backdate_duration][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdate_duration] + // depending on the [CaPool][google.cloud.security.privateca.v1.CaPool] + // configuration. + google.protobuf.Timestamp requested_not_before_time = 15 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A +// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] +// refers to a managed template for certificate issuance. +message CertificateTemplate { + option (google.api.resource) = { + type: "privateca.googleapis.com/CertificateTemplate" + pattern: "projects/{project}/locations/{location}/certificateTemplates/{certificate_template}" + }; + + // Identifier. The resource name for this + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + // in the format `projects/*/locations/*/certificateTemplates/*`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The maximum lifetime allowed for issued + // [Certificates][google.cloud.security.privateca.v1.Certificate] that use + // this template. If the issuing + // [CaPool][google.cloud.security.privateca.v1.CaPool] resource's + // [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy] + // specifies a + // [maximum_lifetime][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.maximum_lifetime] + // the minimum of the two durations will be the maximum lifetime for issued + // [Certificates][google.cloud.security.privateca.v1.Certificate]. Note that + // if the issuing + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // expires before a + // [Certificate][google.cloud.security.privateca.v1.Certificate]'s requested + // maximum_lifetime, the effective lifetime will be explicitly truncated + // to match it. + google.protobuf.Duration maximum_lifetime = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of X.509 values that will be applied to all issued + // certificates that use this template. If the certificate request includes + // conflicting values for the same properties, they will be overwritten by the + // values defined here. If the issuing + // [CaPool][google.cloud.security.privateca.v1.CaPool]'s + // [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy] + // defines conflicting + // [baseline_values][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values] + // for the same properties, the certificate issuance request will fail. + X509Parameters predefined_values = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes constraints on identities that may be appear in + // [Certificates][google.cloud.security.privateca.v1.Certificate] issued using + // this template. If this is omitted, then this template will not add + // restrictions on a certificate's identity. + CertificateIdentityConstraints identity_constraints = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the set of X.509 extensions that may appear in a + // [Certificate][google.cloud.security.privateca.v1.Certificate] issued using + // this + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. + // If a certificate request sets extensions that don't appear in the + // [passthrough_extensions][google.cloud.security.privateca.v1.CertificateTemplate.passthrough_extensions], + // those extensions will be dropped. If the issuing + // [CaPool][google.cloud.security.privateca.v1.CaPool]'s + // [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy] + // defines + // [baseline_values][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values] + // that don't appear here, the certificate issuance request will fail. If this + // is omitted, then this template will not add restrictions on a certificate's + // X.509 extensions. These constraints do not apply to X.509 extensions set in + // this + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]'s + // [predefined_values][google.cloud.security.privateca.v1.CertificateTemplate.predefined_values]. + CertificateExtensionConstraints passthrough_extensions = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A human-readable description of scenarios this template is + // intended for. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time at which this + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + // was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + // was updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels with user-defined metadata. + map labels = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// An [X509Parameters][google.cloud.security.privateca.v1.X509Parameters] is +// used to describe certain fields of an X.509 certificate, such as the key +// usage fields, fields specific to CA certificates, certificate policy +// extensions and custom extensions. +message X509Parameters { + // Describes the X.509 basic constraints extension, per [RFC 5280 + // section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9) + message CaOptions { + // Optional. Refers to the "CA" boolean field in the X.509 extension. + // When this value is missing, the basic constraints extension will be + // omitted from the certificate. + optional bool is_ca = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Refers to the path length constraint field in the X.509 + // extension. For a CA certificate, this value describes the depth of + // subordinate CA certificates that are allowed. If this value is less than + // 0, the request will fail. If this value is missing, the max path length + // will be omitted from the certificate. + optional int32 max_issuer_path_length = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Describes the X.509 name constraints extension, per + // https://tools.ietf.org/html/rfc5280#section-4.2.1.10 + message NameConstraints { + // Indicates whether or not the name constraints are marked critical. + bool critical = 1; + + // Contains permitted DNS names. Any DNS name that can be + // constructed by simply adding zero or more labels to + // the left-hand side of the name satisfies the name constraint. + // For example, `example.com`, `www.example.com`, `www.sub.example.com` + // would satisfy `example.com` while `example1.com` does not. + repeated string permitted_dns_names = 2; + + // Contains excluded DNS names. Any DNS name that can be + // constructed by simply adding zero or more labels to + // the left-hand side of the name satisfies the name constraint. + // For example, `example.com`, `www.example.com`, `www.sub.example.com` + // would satisfy `example.com` while `example1.com` does not. + repeated string excluded_dns_names = 3; + + // Contains the permitted IP ranges. For IPv4 addresses, the ranges + // are expressed using CIDR notation as specified in RFC 4632. + // For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 + // addresses. + repeated string permitted_ip_ranges = 4; + + // Contains the excluded IP ranges. For IPv4 addresses, the ranges + // are expressed using CIDR notation as specified in RFC 4632. + // For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 + // addresses. + repeated string excluded_ip_ranges = 5; + + // Contains the permitted email addresses. The value can be a particular + // email address, a hostname to indicate all email addresses on that host or + // a domain with a leading period (e.g. `.example.com`) to indicate + // all email addresses in that domain. + repeated string permitted_email_addresses = 6; + + // Contains the excluded email addresses. The value can be a particular + // email address, a hostname to indicate all email addresses on that host or + // a domain with a leading period (e.g. `.example.com`) to indicate + // all email addresses in that domain. + repeated string excluded_email_addresses = 7; + + // Contains the permitted URIs that apply to the host part of the name. + // The value can be a hostname or a domain with a + // leading period (like `.example.com`) + repeated string permitted_uris = 8; + + // Contains the excluded URIs that apply to the host part of the name. + // The value can be a hostname or a domain with a + // leading period (like `.example.com`) + repeated string excluded_uris = 9; + } + + // Optional. Indicates the intended use for keys that correspond to a + // certificate. + KeyUsage key_usage = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes options in this + // [X509Parameters][google.cloud.security.privateca.v1.X509Parameters] that + // are relevant in a CA certificate. If not specified, a default basic + // constraints extension with `is_ca=false` will be added for leaf + // certificates. + CaOptions ca_options = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the X.509 certificate policy object identifiers, per + // https://tools.ietf.org/html/rfc5280#section-4.2.1.4. + repeated ObjectId policy_ids = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes Online Certificate Status Protocol (OCSP) endpoint + // addresses that appear in the "Authority Information Access" extension in + // the certificate. + repeated string aia_ocsp_servers = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the X.509 name constraints extension. + NameConstraints name_constraints = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes custom X.509 extensions. + repeated X509Extension additional_extensions = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Describes a subordinate CA's issuers. This is either a resource name to a +// known issuing +// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority], +// or a PEM issuer certificate chain. +message SubordinateConfig { + // This message describes a subordinate CA's issuer certificate chain. This + // wrapper exists for compatibility reasons. + message SubordinateConfigChain { + // Required. Expected to be in leaf-to-root order according to RFC 5246. + repeated string pem_certificates = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + oneof subordinate_config { + // Required. This can refer to a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // that was used to create a subordinate + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + // This field is used for information and usability purposes only. The + // resource name is in the format + // `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + string certificate_authority = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Required. Contains the PEM certificate chain for the issuers of this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority], + // but not pem certificate for this CA itself. + SubordinateConfigChain pem_issuer_chain = 2 + [(google.api.field_behavior) = REQUIRED]; + } +} + +// A [PublicKey][google.cloud.security.privateca.v1.PublicKey] describes a +// public key. +message PublicKey { + // Types of public keys formats that are supported. Currently, only `PEM` + // format is supported. + enum KeyFormat { + // Default unspecified value. + KEY_FORMAT_UNSPECIFIED = 0; + + // The key is PEM-encoded as defined in [RFC + // 7468](https://tools.ietf.org/html/rfc7468). It can be any of the + // following: a PEM-encoded PKCS#1/RFC 3447 RSAPublicKey + // structure, an RFC 5280 + // [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) + // or a PEM-encoded X.509 certificate signing request (CSR). If a + // [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) + // is specified, it can contain a A PEM-encoded PKCS#1/RFC 3447 RSAPublicKey + // or a NIST P-256/secp256r1/prime256v1 or P-384 key. If a CSR is specified, + // it will used solely for the purpose of extracting the public key. When + // generated by the service, it will always be an RFC 5280 + // [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) + // structure containing an algorithm identifier and a key. + PEM = 1; + } + + // Required. A public key. The padding and encoding + // must match with the `KeyFormat` value specified for the `format` field. + bytes key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The format of the public key. + KeyFormat format = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A [CertificateConfig][google.cloud.security.privateca.v1.CertificateConfig] +// describes an X.509 certificate or CSR that is to be created, as an +// alternative to using ASN.1. +message CertificateConfig { + // These values are used to create the distinguished name and subject + // alternative name fields in an X.509 certificate. + message SubjectConfig { + // Optional. Contains distinguished name fields such as the common name, + // location and organization. + Subject subject = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The subject alternative name fields. + SubjectAltNames subject_alt_name = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // A KeyId identifies a specific public key, usually by hashing the public + // key. + message KeyId { + // Required. The value of this KeyId encoded in lowercase hexadecimal. This + // is most likely the 160 bit SHA-1 hash of the public key. + string key_id = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Specifies some of the values in a certificate that are related to + // the subject. + SubjectConfig subject_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Describes how some of the technical X.509 fields in a certificate + // should be populated. + X509Parameters x509_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The public key that corresponds to this config. This is, for + // example, used when issuing + // [Certificates][google.cloud.security.privateca.v1.Certificate], but not + // when creating a self-signed + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // or + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // CSR. + PublicKey public_key = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When specified this provides a custom SKI to be used in the + // certificate. This should only be used to maintain a SKI of an existing CA + // originally created outside CA service, which was not generated using method + // (1) described in RFC 5280 section 4.2.1.2. + KeyId subject_key_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A +// [CertificateDescription][google.cloud.security.privateca.v1.CertificateDescription] +// describes an X.509 certificate or CSR that has been issued, as an alternative +// to using ASN.1 / X.509. +message CertificateDescription { + // These values describe fields in an issued X.509 certificate such as the + // distinguished name, subject alternative names, serial number, and lifetime. + message SubjectDescription { + // Contains distinguished name fields such as the common name, location and + // / organization. + Subject subject = 1; + + // The subject alternative name fields. + SubjectAltNames subject_alt_name = 2; + + // The serial number encoded in lowercase hexadecimal. + string hex_serial_number = 3; + + // For convenience, the actual lifetime of an issued certificate. + google.protobuf.Duration lifetime = 4; + + // The time at which the certificate becomes valid. + google.protobuf.Timestamp not_before_time = 5; + + // The time after which the certificate is expired. + // Per RFC 5280, the validity period for a certificate is the period of time + // from not_before_time through not_after_time, inclusive. + // Corresponds to 'not_before_time' + 'lifetime' - 1 second. + google.protobuf.Timestamp not_after_time = 6; + } + + // A KeyId identifies a specific public key, usually by hashing the public + // key. + message KeyId { + // Optional. The value of this KeyId encoded in lowercase hexadecimal. This + // is most likely the 160 bit SHA-1 hash of the public key. + string key_id = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // A group of fingerprints for the x509 certificate. + message CertificateFingerprint { + // The SHA 256 hash, encoded in hexadecimal, of the DER x509 certificate. + string sha256_hash = 1; + } + + // Describes some of the values in a certificate that are related to the + // subject and lifetime. + SubjectDescription subject_description = 1; + + // Describes some of the technical X.509 fields in a certificate. + X509Parameters x509_description = 2; + + // The public key that corresponds to an issued certificate. + PublicKey public_key = 3; + + // Provides a means of identifiying certificates that contain a particular + // public key, per https://tools.ietf.org/html/rfc5280#section-4.2.1.2. + KeyId subject_key_id = 4; + + // Identifies the subject_key_id of the parent certificate, per + // https://tools.ietf.org/html/rfc5280#section-4.2.1.1 + KeyId authority_key_id = 5; + + // Describes a list of locations to obtain CRL information, i.e. + // the DistributionPoint.fullName described by + // https://tools.ietf.org/html/rfc5280#section-4.2.1.13 + repeated string crl_distribution_points = 6; + + // Describes lists of issuer CA certificate URLs that appear in the + // "Authority Information Access" extension in the certificate. + repeated string aia_issuing_certificate_urls = 7; + + // The hash of the x.509 certificate. + CertificateFingerprint cert_fingerprint = 8; + + // The hash of the pre-signed certificate, which will be signed by the CA. + // Corresponds to the TBS Certificate in + // https://tools.ietf.org/html/rfc5280#section-4.1.2. The field will always be + // populated. + string tbs_certificate_digest = 9; +} + +// An [ObjectId][google.cloud.security.privateca.v1.ObjectId] specifies an +// object identifier (OID). These provide context and describe types in ASN.1 +// messages. +message ObjectId { + // Required. The parts of an OID path. The most significant parts of the path + // come first. + repeated int32 object_id_path = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// An [X509Extension][google.cloud.security.privateca.v1.X509Extension] +// specifies an X.509 extension, which may be used in different parts of X.509 +// objects like certificates, CSRs, and CRLs. +message X509Extension { + // Required. The OID for this X.509 extension. + ObjectId object_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Indicates whether or not this extension is critical (i.e., if the + // client does not know how to handle this extension, the client should + // consider this to be an error). + bool critical = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The value of this X.509 extension. + bytes value = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A [KeyUsage][google.cloud.security.privateca.v1.KeyUsage] describes key usage +// values that may appear in an X.509 certificate. +message KeyUsage { + // [KeyUsage.KeyUsageOptions][google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions] + // corresponds to the key usage values described in + // https://tools.ietf.org/html/rfc5280#section-4.2.1.3. + message KeyUsageOptions { + // The key may be used for digital signatures. + bool digital_signature = 1; + + // The key may be used for cryptographic commitments. Note that this may + // also be referred to as "non-repudiation". + bool content_commitment = 2; + + // The key may be used to encipher other keys. + bool key_encipherment = 3; + + // The key may be used to encipher data. + bool data_encipherment = 4; + + // The key may be used in a key agreement protocol. + bool key_agreement = 5; + + // The key may be used to sign certificates. + bool cert_sign = 6; + + // The key may be used sign certificate revocation lists. + bool crl_sign = 7; + + // The key may be used to encipher only. + bool encipher_only = 8; + + // The key may be used to decipher only. + bool decipher_only = 9; + } + + // [KeyUsage.ExtendedKeyUsageOptions][google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions] + // has fields that correspond to certain common OIDs that could be specified + // as an extended key usage value. + message ExtendedKeyUsageOptions { + // Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW + // server authentication", though regularly used for non-WWW TLS. + bool server_auth = 1; + + // Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW + // client authentication", though regularly used for non-WWW TLS. + bool client_auth = 2; + + // Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of + // downloadable executable code client authentication". + bool code_signing = 3; + + // Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email + // protection". + bool email_protection = 4; + + // Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding + // the hash of an object to a time". + bool time_stamping = 5; + + // Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing + // OCSP responses". + bool ocsp_signing = 6; + } + + // Describes high-level ways in which a key may be used. + KeyUsageOptions base_key_usage = 1; + + // Detailed scenarios in which a key may be used. + ExtendedKeyUsageOptions extended_key_usage = 2; + + // Used to describe extended key usages that are not listed in the + // [KeyUsage.ExtendedKeyUsageOptions][google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions] + // message. + repeated ObjectId unknown_extended_key_usages = 3; +} + +// [AttributeTypeAndValue][google.cloud.security.privateca.v1.AttributeTypeAndValue] +// specifies an attribute type and value. It can use either a OID or enum value +// to specify the attribute type. +message AttributeTypeAndValue { + // The attribute type for the attribute and value pair. + oneof attribute_type { + // The attribute type of the attribute and value pair. + AttributeType type = 1; + + // Object ID for an attribute type of an attribute and value pair. + ObjectId object_id = 2; + } + + // The value for the attribute type. + string value = 3; +} + +// [RelativeDistinguishedName][google.cloud.security.privateca.v1.RelativeDistinguishedName] +// specifies a relative distinguished name which will be used to build a +// distinguished name. +message RelativeDistinguishedName { + // Attributes describes the attribute value assertions in the RDN. + repeated AttributeTypeAndValue attributes = 1; +} + +// [Subject][google.cloud.security.privateca.v1.Subject] describes parts of a +// distinguished name that, in turn, describes the subject of the certificate. +message Subject { + // The "common name" of the subject. + string common_name = 1; + + // The country code of the subject. + string country_code = 2; + + // The organization of the subject. + string organization = 3; + + // The organizational_unit of the subject. + string organizational_unit = 4; + + // The locality or city of the subject. + string locality = 5; + + // The province, territory, or regional state of the subject. + string province = 6; + + // The street address of the subject. + string street_address = 7; + + // The postal code of the subject. + string postal_code = 8; + + // This field can be used in place of the named subject fields. + repeated RelativeDistinguishedName rdn_sequence = 9; +} + +// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] +// corresponds to a more modern way of listing what the asserted identity is in +// a certificate (i.e., compared to the "common name" in the distinguished +// name). +message SubjectAltNames { + // Contains only valid, fully-qualified host names. + repeated string dns_names = 1; + + // Contains only valid RFC 3986 URIs. + repeated string uris = 2; + + // Contains only valid RFC 2822 E-mail addresses. + repeated string email_addresses = 3; + + // Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses. + repeated string ip_addresses = 4; + + // Contains additional subject alternative name values. + // For each custom_san, the `value` field must contain an ASN.1 encoded + // UTF8String. + repeated X509Extension custom_sans = 5; +} + +// Describes constraints on a +// [Certificate][google.cloud.security.privateca.v1.Certificate]'s +// [Subject][google.cloud.security.privateca.v1.Subject] and +// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]. +message CertificateIdentityConstraints { + // Optional. A CEL expression that may be used to validate the resolved X.509 + // Subject and/or Subject Alternative Name before a certificate is signed. To + // see the full allowed syntax and some examples, see + // https://cloud.google.com/certificate-authority-service/docs/using-cel + google.type.Expr cel_expression = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. If this is true, the + // [Subject][google.cloud.security.privateca.v1.Subject] field may be copied + // from a certificate request into the signed certificate. Otherwise, the + // requested [Subject][google.cloud.security.privateca.v1.Subject] will be + // discarded. + optional bool allow_subject_passthrough = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. If this is true, the + // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] + // extension may be copied from a certificate request into the signed + // certificate. Otherwise, the requested + // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] will + // be discarded. + optional bool allow_subject_alt_names_passthrough = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Describes a set of X.509 extensions that may be part of some certificate +// issuance controls. +message CertificateExtensionConstraints { + // Describes well-known X.509 extensions that can appear in a + // [Certificate][google.cloud.security.privateca.v1.Certificate], not + // including the + // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] + // extension. + enum KnownCertificateExtension { + // Not specified. + KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED = 0; + + // Refers to a certificate's Key Usage extension, as described in [RFC 5280 + // section 4.2.1.3](https://tools.ietf.org/html/rfc5280#section-4.2.1.3). + // This corresponds to the + // [KeyUsage.base_key_usage][google.cloud.security.privateca.v1.KeyUsage.base_key_usage] + // field. + BASE_KEY_USAGE = 1; + + // Refers to a certificate's Extended Key Usage extension, as described in + // [RFC 5280 + // section 4.2.1.12](https://tools.ietf.org/html/rfc5280#section-4.2.1.12). + // This corresponds to the + // [KeyUsage.extended_key_usage][google.cloud.security.privateca.v1.KeyUsage.extended_key_usage] + // message. + EXTENDED_KEY_USAGE = 2; + + // Refers to a certificate's Basic Constraints extension, as described in + // [RFC 5280 + // section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9). + // This corresponds to the + // [X509Parameters.ca_options][google.cloud.security.privateca.v1.X509Parameters.ca_options] + // field. + CA_OPTIONS = 3; + + // Refers to a certificate's Policy object identifiers, as described in + // [RFC 5280 + // section 4.2.1.4](https://tools.ietf.org/html/rfc5280#section-4.2.1.4). + // This corresponds to the + // [X509Parameters.policy_ids][google.cloud.security.privateca.v1.X509Parameters.policy_ids] + // field. + POLICY_IDS = 4; + + // Refers to OCSP servers in a certificate's Authority Information Access + // extension, as described in + // [RFC 5280 + // section 4.2.2.1](https://tools.ietf.org/html/rfc5280#section-4.2.2.1), + // This corresponds to the + // [X509Parameters.aia_ocsp_servers][google.cloud.security.privateca.v1.X509Parameters.aia_ocsp_servers] + // field. + AIA_OCSP_SERVERS = 5; + + // Refers to Name Constraints extension as described in + // [RFC 5280 + // section 4.2.1.10](https://tools.ietf.org/html/rfc5280#section-4.2.1.10) + NAME_CONSTRAINTS = 6; + } + + // Optional. A set of named X.509 extensions. Will be combined with + // [additional_extensions][google.cloud.security.privateca.v1.CertificateExtensionConstraints.additional_extensions] + // to determine the full set of X.509 extensions. + repeated KnownCertificateExtension known_extensions = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of [ObjectIds][google.cloud.security.privateca.v1.ObjectId] + // identifying custom X.509 extensions. Will be combined with + // [known_extensions][google.cloud.security.privateca.v1.CertificateExtensionConstraints.known_extensions] + // to determine the full set of X.509 extensions. + repeated ObjectId additional_extensions = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// [AttributeType][google.cloud.security.privateca.v1.AttributeType] specifies +// the type of Attribute in a relative distinguished name. +enum AttributeType { + // Attribute type is unspecified. + ATTRIBUTE_TYPE_UNSPECIFIED = 0; + + // The "common name" of the subject. + COMMON_NAME = 1; + + // The country code of the subject. + COUNTRY_CODE = 2; + + // The organization of the subject. + ORGANIZATION = 3; + + // The organizational unit of the subject. + ORGANIZATIONAL_UNIT = 4; + + // The locality or city of the subject. + LOCALITY = 5; + + // The province, territory, or regional state of the subject. + PROVINCE = 6; + + // The street address of the subject. + STREET_ADDRESS = 7; + + // The postal code of the subject. + POSTAL_CODE = 8; +} + +// A [RevocationReason][google.cloud.security.privateca.v1.RevocationReason] +// indicates whether a +// [Certificate][google.cloud.security.privateca.v1.Certificate] has been +// revoked, and the reason for revocation. These correspond to standard +// revocation reasons from RFC 5280. Note that the enum labels and values in +// this definition are not the same ASN.1 values defined in RFC 5280. These +// values will be translated to the correct ASN.1 values when a CRL is created. +enum RevocationReason { + // Default unspecified value. This value does indicate that a + // [Certificate][google.cloud.security.privateca.v1.Certificate] has been + // revoked, but that a reason has not been recorded. + REVOCATION_REASON_UNSPECIFIED = 0; + + // Key material for this + // [Certificate][google.cloud.security.privateca.v1.Certificate] may have + // leaked. + KEY_COMPROMISE = 1; + + // The key material for a certificate authority in the issuing path may have + // leaked. + CERTIFICATE_AUTHORITY_COMPROMISE = 2; + + // The subject or other attributes in this + // [Certificate][google.cloud.security.privateca.v1.Certificate] have changed. + AFFILIATION_CHANGED = 3; + + // This [Certificate][google.cloud.security.privateca.v1.Certificate] has been + // superseded. + SUPERSEDED = 4; + + // This [Certificate][google.cloud.security.privateca.v1.Certificate] or + // entities in the issuing path have ceased to operate. + CESSATION_OF_OPERATION = 5; + + // This [Certificate][google.cloud.security.privateca.v1.Certificate] should + // not be considered valid, it is expected that it may become valid in the + // future. + CERTIFICATE_HOLD = 6; + + // This [Certificate][google.cloud.security.privateca.v1.Certificate] no + // longer has permission to assert the listed attributes. + PRIVILEGE_WITHDRAWN = 7; + + // The authority which determines appropriate attributes for a + // [Certificate][google.cloud.security.privateca.v1.Certificate] may have been + // compromised. + ATTRIBUTE_AUTHORITY_COMPROMISE = 8; +} + +// Describes the way in which a +// [Certificate][google.cloud.security.privateca.v1.Certificate]'s +// [Subject][google.cloud.security.privateca.v1.Subject] and/or +// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] will be +// resolved. +enum SubjectRequestMode { + // Not specified. + SUBJECT_REQUEST_MODE_UNSPECIFIED = 0; + + // The default mode used in most cases. Indicates that the certificate's + // [Subject][google.cloud.security.privateca.v1.Subject] and/or + // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] are + // specified in the certificate request. This mode requires the caller to have + // the `privateca.certificates.create` permission. + DEFAULT = 1; + + // A mode used to get an accurate representation of the Subject + // field's distinguished name. Indicates that the certificate's + // [Subject][google.cloud.security.privateca.v1.Subject] and/or + // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] are + // specified in the certificate request. When parsing a PEM CSR this mode will + // maintain the sequence of RDNs found in the CSR's subject field in the + // issued [Certificate][google.cloud.security.privateca.v1.Certificate]. This + // mode requires the caller to have the `privateca.certificates.create` + // permission. + RDN_SEQUENCE = 3; + + // A mode reserved for special cases. Indicates that the certificate should + // have one SPIFFE + // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] set + // by the service based on the caller's identity. This mode will ignore any + // explicitly specified [Subject][google.cloud.security.privateca.v1.Subject] + // and/or + // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] in + // the certificate request. This mode requires the caller to have the + // `privateca.certificates.createForSelf` permission. + REFLECTED_SPIFFE = 2; +} diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto new file mode 100644 index 000000000000..28e67660da66 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto @@ -0,0 +1,1484 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.security.privateca.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/security/privateca/v1/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Security.PrivateCA.V1"; +option go_package = "cloud.google.com/go/security/privateca/apiv1/privatecapb;privatecapb"; +option java_multiple_files = true; +option java_outer_classname = "PrivateCaProto"; +option java_package = "com.google.cloud.security.privateca.v1"; +option php_namespace = "Google\\Cloud\\Security\\PrivateCA\\V1"; +option ruby_package = "Google::Cloud::Security::PrivateCA::V1"; + +// [Certificate Authority +// Service][google.cloud.security.privateca.v1.CertificateAuthorityService] +// manages private certificate authorities and issued certificates. +service CertificateAuthorityService { + option (google.api.default_host) = "privateca.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a new [Certificate][google.cloud.security.privateca.v1.Certificate] + // in a given Project, Location from a particular + // [CaPool][google.cloud.security.privateca.v1.CaPool]. + rpc CreateCertificate(CreateCertificateRequest) returns (Certificate) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/caPools/*}/certificates" + body: "certificate" + }; + option (google.api.method_signature) = "parent,certificate,certificate_id"; + } + + // Returns a [Certificate][google.cloud.security.privateca.v1.Certificate]. + rpc GetCertificate(GetCertificateRequest) returns (Certificate) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists [Certificates][google.cloud.security.privateca.v1.Certificate]. + rpc ListCertificates(ListCertificatesRequest) + returns (ListCertificatesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/caPools/*}/certificates" + }; + option (google.api.method_signature) = "parent"; + } + + // Revoke a [Certificate][google.cloud.security.privateca.v1.Certificate]. + rpc RevokeCertificate(RevokeCertificateRequest) returns (Certificate) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}:revoke" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Update a [Certificate][google.cloud.security.privateca.v1.Certificate]. + // Currently, the only field you can update is the + // [labels][google.cloud.security.privateca.v1.Certificate.labels] field. + rpc UpdateCertificate(UpdateCertificateRequest) returns (Certificate) { + option (google.api.http) = { + patch: "/v1/{certificate.name=projects/*/locations/*/caPools/*/certificates/*}" + body: "certificate" + }; + option (google.api.method_signature) = "certificate,update_mask"; + } + + // Activate a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // that is in state + // [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] + // and is of type + // [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. + // After the parent Certificate Authority signs a certificate signing request + // from + // [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr], + // this method can complete the activation process. + rpc ActivateCertificateAuthority(ActivateCertificateAuthorityRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:activate" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Create a new + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in a given Project and Location. + rpc CreateCertificateAuthority(CreateCertificateAuthorityRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities" + body: "certificate_authority" + }; + option (google.api.method_signature) = + "parent,certificate_authority,certificate_authority_id"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Disable a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc DisableCertificateAuthority(DisableCertificateAuthorityRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:disable" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Enable a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc EnableCertificateAuthority(EnableCertificateAuthorityRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:enable" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Fetch a certificate signing request (CSR) from a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // that is in state + // [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] + // and is of type + // [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. + // The CSR must then be signed by the desired parent Certificate Authority, + // which could be another + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // resource, or could be an on-prem certificate authority. See also + // [ActivateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority]. + rpc FetchCertificateAuthorityCsr(FetchCertificateAuthorityCsrRequest) + returns (FetchCertificateAuthorityCsrResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:fetch" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc GetCertificateAuthority(GetCertificateAuthorityRequest) + returns (CertificateAuthority) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists + // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc ListCertificateAuthorities(ListCertificateAuthoritiesRequest) + returns (ListCertificateAuthoritiesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities" + }; + option (google.api.method_signature) = "parent"; + } + + // Undelete a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // that has been deleted. + rpc UndeleteCertificateAuthority(UndeleteCertificateAuthorityRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Delete a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc DeleteCertificateAuthority(DeleteCertificateAuthorityRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Update a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc UpdateCertificateAuthority(UpdateCertificateAuthorityRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{certificate_authority.name=projects/*/locations/*/caPools/*/certificateAuthorities/*}" + body: "certificate_authority" + }; + option (google.api.method_signature) = "certificate_authority,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Create a [CaPool][google.cloud.security.privateca.v1.CaPool]. + rpc CreateCaPool(CreateCaPoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/caPools" + body: "ca_pool" + }; + option (google.api.method_signature) = "parent,ca_pool,ca_pool_id"; + option (google.longrunning.operation_info) = { + response_type: "CaPool" + metadata_type: "OperationMetadata" + }; + } + + // Update a [CaPool][google.cloud.security.privateca.v1.CaPool]. + rpc UpdateCaPool(UpdateCaPoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{ca_pool.name=projects/*/locations/*/caPools/*}" + body: "ca_pool" + }; + option (google.api.method_signature) = "ca_pool,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "CaPool" + metadata_type: "OperationMetadata" + }; + } + + // Returns a [CaPool][google.cloud.security.privateca.v1.CaPool]. + rpc GetCaPool(GetCaPoolRequest) returns (CaPool) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/caPools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists [CaPools][google.cloud.security.privateca.v1.CaPool]. + rpc ListCaPools(ListCaPoolsRequest) returns (ListCaPoolsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/caPools" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete a [CaPool][google.cloud.security.privateca.v1.CaPool]. + rpc DeleteCaPool(DeleteCaPoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/caPools/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // FetchCaCerts returns the current trust anchor for the + // [CaPool][google.cloud.security.privateca.v1.CaPool]. This will include CA + // certificate chains for all certificate authorities in the ENABLED, + // DISABLED, or STAGED states. + rpc FetchCaCerts(FetchCaCertsRequest) returns (FetchCaCertsResponse) { + option (google.api.http) = { + post: "/v1/{ca_pool=projects/*/locations/*/caPools/*}:fetchCaCerts" + body: "*" + }; + option (google.api.method_signature) = "ca_pool"; + } + + // Returns a + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. + rpc GetCertificateRevocationList(GetCertificateRevocationListRequest) + returns (CertificateRevocationList) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists + // [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList]. + rpc ListCertificateRevocationLists(ListCertificateRevocationListsRequest) + returns (ListCertificateRevocationListsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/caPools/*/certificateAuthorities/*}/certificateRevocationLists" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. + rpc UpdateCertificateRevocationList(UpdateCertificateRevocationListRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{certificate_revocation_list.name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}" + body: "certificate_revocation_list" + }; + option (google.api.method_signature) = + "certificate_revocation_list,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "CertificateRevocationList" + metadata_type: "OperationMetadata" + }; + } + + // Create a new + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + // in a given Project and Location. + rpc CreateCertificateTemplate(CreateCertificateTemplateRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/certificateTemplates" + body: "certificate_template" + }; + option (google.api.method_signature) = + "parent,certificate_template,certificate_template_id"; + option (google.longrunning.operation_info) = { + response_type: "CertificateTemplate" + metadata_type: "OperationMetadata" + }; + } + + // DeleteCertificateTemplate deletes a + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. + rpc DeleteCertificateTemplate(DeleteCertificateTemplateRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/certificateTemplates/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.security.privateca.v1.OperationMetadata" + }; + } + + // Returns a + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. + rpc GetCertificateTemplate(GetCertificateTemplateRequest) + returns (CertificateTemplate) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/certificateTemplates/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists + // [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate]. + rpc ListCertificateTemplates(ListCertificateTemplatesRequest) + returns (ListCertificateTemplatesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/certificateTemplates" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. + rpc UpdateCertificateTemplate(UpdateCertificateTemplateRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{certificate_template.name=projects/*/locations/*/certificateTemplates/*}" + body: "certificate_template" + }; + option (google.api.method_signature) = "certificate_template,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "CertificateTemplate" + metadata_type: "OperationMetadata" + }; + } +} + +// Request message for +// [CertificateAuthorityService.CreateCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate]. +message CreateCertificateRequest { + // Required. The resource name of the + // [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the + // [Certificate][google.cloud.security.privateca.v1.Certificate], in the + // format `projects/*/locations/*/caPools/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CaPool" + } + ]; + + // Optional. It must be unique within a location and match the regular + // expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in the Enterprise + // [CertificateAuthority.tier][google.cloud.security.privateca.v1.CertificateAuthority.tier], + // but is optional and its value is ignored otherwise. + string certificate_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A [Certificate][google.cloud.security.privateca.v1.Certificate] + // with initial field values. + Certificate certificate = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If this is true, no + // [Certificate][google.cloud.security.privateca.v1.Certificate] resource will + // be persisted regardless of the + // [CaPool][google.cloud.security.privateca.v1.CaPool]'s + // [tier][google.cloud.security.privateca.v1.CaPool.tier], and the returned + // [Certificate][google.cloud.security.privateca.v1.Certificate] will not + // contain the + // [pem_certificate][google.cloud.security.privateca.v1.Certificate.pem_certificate] + // field. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The resource ID of the + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // that should issue the certificate. This optional field will ignore the + // load-balancing scheme of the Pool and directly issue the certificate from + // the CA with the specified ID, contained in the same + // [CaPool][google.cloud.security.privateca.v1.CaPool] referenced by `parent`. + // Per-CA quota rules apply. If left empty, a + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // will be chosen from the [CaPool][google.cloud.security.privateca.v1.CaPool] + // by the service. For example, to issue a + // [Certificate][google.cloud.security.privateca.v1.Certificate] from a + // Certificate Authority with resource name + // "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", + // you can set the + // [parent][google.cloud.security.privateca.v1.CreateCertificateRequest.parent] + // to "projects/my-project/locations/us-central1/caPools/my-pool" and the + // [issuing_certificate_authority_id][google.cloud.security.privateca.v1.CreateCertificateRequest.issuing_certificate_authority_id] + // to "my-ca". + string issuing_certificate_authority_id = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.GetCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificate]. +message GetCertificateRequest { + // Required. The [name][google.cloud.security.privateca.v1.Certificate.name] + // of the [Certificate][google.cloud.security.privateca.v1.Certificate] to + // get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/Certificate" + } + ]; +} + +// Request message for +// [CertificateAuthorityService.ListCertificates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates]. +message ListCertificatesRequest { + // Required. The resource name of the parent associated with the + // [Certificates][google.cloud.security.privateca.v1.Certificate], in the + // format `projects/*/locations/*/caPools/*`. The parent resource name can be + // in one of two forms: + // + // 1. **Specific CA Pool:** To list certificates within a single CA Pool: + // `projects/*/locations/*/caPools/*` + // + // 2. **All CA Pools in a Location:** To list certificates across *all* CA + // Pools in a given project and location, use the wildcard character (`-`) + // in place of the CA Pool ID. + // Example: `projects/*/locations/*/caPools/-` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CaPool" + } + ]; + + // Optional. Limit on the number of + // [Certificates][google.cloud.security.privateca.v1.Certificate] to include + // in the response. Further + // [Certificates][google.cloud.security.privateca.v1.Certificate] can + // subsequently be obtained by including the + // [ListCertificatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token] + // in a subsequent request. If unspecified, the server will pick an + // appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pagination token, returned earlier via + // [ListCertificatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token]. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only include resources that match the filter in the response. For + // details on supported filters and syntax, see [Certificates Filtering + // documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specify how the results should be sorted. For details on + // supported fields and syntax, see [Certificates Sorting + // documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [CertificateAuthorityService.ListCertificates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates]. +message ListCertificatesResponse { + // The list of [Certificates][google.cloud.security.privateca.v1.Certificate]. + repeated Certificate certificates = 1; + + // A token to retrieve next page of results. Pass this value in + // [ListCertificatesRequest.page_token][google.cloud.security.privateca.v1.ListCertificatesRequest.page_token] + // to retrieve the next page of results. + string next_page_token = 2; + + // A list of locations (e.g. "us-west1") that could not be reached. + repeated string unreachable = 3; +} + +// Request message for +// [CertificateAuthorityService.RevokeCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificate]. +message RevokeCertificateRequest { + // Required. The resource name for this + // [Certificate][google.cloud.security.privateca.v1.Certificate] in the format + // `projects/*/locations/*/caPools/*/certificates/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/Certificate" + } + ]; + + // Required. The + // [RevocationReason][google.cloud.security.privateca.v1.RevocationReason] for + // revoking this certificate. + RevocationReason reason = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.UpdateCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificate]. +message UpdateCertificateRequest { + // Required. [Certificate][google.cloud.security.privateca.v1.Certificate] + // with updated values. + Certificate certificate = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.ActivateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority]. +message ActivateCertificateAuthorityRequest { + // Required. The resource name for this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Required. The signed CA certificate issued from + // [FetchCertificateAuthorityCsrResponse.pem_csr][google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.pem_csr]. + string pem_ca_certificate = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Must include information about the issuer of + // 'pem_ca_certificate', and any further issuers until the self-signed CA. + SubordinateConfig subordinate_config = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for +// [CertificateAuthorityService.CreateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthority]. +message CreateCertificateAuthorityRequest { + // Required. The resource name of the + // [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the + // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority], + // in the format `projects/*/locations/*/caPools/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CaPool" + } + ]; + + // Required. It must be unique within a location and match the regular + // expression `[a-zA-Z0-9_-]{1,63}` + string certificate_authority_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // with initial field values. + CertificateAuthority certificate_authority = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.DisableCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthority]. +message DisableCertificateAuthorityRequest { + // Required. The resource name for this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. This field allows this CA to be disabled even if it's being + // depended on by another resource. However, doing so may result in unintended + // and unrecoverable effects on any dependent resources since the CA will + // no longer be able to issue certificates. + bool ignore_dependent_resources = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.EnableCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthority]. +message EnableCertificateAuthorityRequest { + // Required. The resource name for this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for +// [CertificateAuthorityService.FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr]. +message FetchCertificateAuthorityCsrRequest { + // Required. The resource name for this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; +} + +// Response message for +// [CertificateAuthorityService.FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr]. +message FetchCertificateAuthorityCsrResponse { + // Output only. The PEM-encoded signed certificate signing request (CSR). + string pem_csr = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for +// [CertificateAuthorityService.GetCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthority]. +message GetCertificateAuthorityRequest { + // Required. The + // [name][google.cloud.security.privateca.v1.CertificateAuthority.name] of the + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; +} + +// Request message for +// [CertificateAuthorityService.ListCertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities]. +message ListCertificateAuthoritiesRequest { + // Required. The resource name of the + // [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the + // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority], + // in the format `projects/*/locations/*/caPools/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CaPool" + } + ]; + + // Optional. Limit on the number of + // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority] + // to include in the response. Further + // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority] + // can subsequently be obtained by including the + // [ListCertificateAuthoritiesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token] + // in a subsequent request. If unspecified, the server will pick an + // appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pagination token, returned earlier via + // [ListCertificateAuthoritiesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token]. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only include resources that match the filter in the response. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specify how the results should be sorted. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [CertificateAuthorityService.ListCertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities]. +message ListCertificateAuthoritiesResponse { + // The list of + // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority]. + repeated CertificateAuthority certificate_authorities = 1; + + // A token to retrieve next page of results. Pass this value in + // [ListCertificateAuthoritiesRequest.page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.page_token] + // to retrieve the next page of results. + string next_page_token = 2; + + // A list of locations (e.g. "us-west1") that could not be reached. + repeated string unreachable = 3; +} + +// Request message for +// [CertificateAuthorityService.UndeleteCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority]. +message UndeleteCertificateAuthorityRequest { + // Required. The resource name for this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for +// [CertificateAuthorityService.DeleteCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthority]. +message DeleteCertificateAuthorityRequest { + // Required. The resource name for this + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. This field allows the CA to be deleted even if the CA has + // active certs. Active certs include both unrevoked and unexpired certs. + bool ignore_active_certificates = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If this flag is set, the Certificate Authority will be deleted as + // soon as possible without a 30-day grace period where undeletion would have + // been allowed. If you proceed, there will be no way to recover this CA. + bool skip_grace_period = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field allows this CA to be deleted even if it's being + // depended on by another resource. However, doing so may result in unintended + // and unrecoverable effects on any dependent resources since the CA will + // no longer be able to issue certificates. + bool ignore_dependent_resources = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.UpdateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthority]. +message UpdateCertificateAuthorityRequest { + // Required. + // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + // with updated values. + CertificateAuthority certificate_authority = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for +// [CertificateAuthorityService.CreateCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPool]. +message CreateCaPoolRequest { + // Required. The resource name of the location associated with the + // [CaPool][google.cloud.security.privateca.v1.CaPool], in the format + // `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. It must be unique within a location and match the regular + // expression `[a-zA-Z0-9_-]{1,63}` + string ca_pool_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A [CaPool][google.cloud.security.privateca.v1.CaPool] with + // initial field values. + CaPool ca_pool = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for +// [CertificateAuthorityService.UpdateCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPool]. +message UpdateCaPoolRequest { + // Required. [CaPool][google.cloud.security.privateca.v1.CaPool] with updated + // values. + CaPool ca_pool = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for +// [CertificateAuthorityService.DeleteCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPool]. +message DeleteCaPoolRequest { + // Required. The resource name for this + // [CaPool][google.cloud.security.privateca.v1.CaPool] in the format + // `projects/*/locations/*/caPools/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CaPool" + } + ]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. This field allows this pool to be deleted even if it's being + // depended on by another resource. However, doing so may result in unintended + // and unrecoverable effects on any dependent resources since the pool will + // no longer be able to issue certificates. + bool ignore_dependent_resources = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.FetchCaCerts][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts]. +message FetchCaCertsRequest { + // Required. The resource name for the + // [CaPool][google.cloud.security.privateca.v1.CaPool] in the format + // `projects/*/locations/*/caPools/*`. + string ca_pool = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CaPool" + } + ]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [CertificateAuthorityService.FetchCaCerts][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts]. +message FetchCaCertsResponse { + message CertChain { + // The certificates that form the CA chain, from leaf to root order. + repeated string certificates = 1; + } + + // The PEM encoded CA certificate chains of all certificate authorities in + // this [CaPool][google.cloud.security.privateca.v1.CaPool] in the ENABLED, + // DISABLED, or STAGED states. + repeated CertChain ca_certs = 1; +} + +// Request message for +// [CertificateAuthorityService.GetCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPool]. +message GetCaPoolRequest { + // Required. The [name][google.cloud.security.privateca.v1.CaPool.name] of the + // [CaPool][google.cloud.security.privateca.v1.CaPool] to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CaPool" + } + ]; +} + +// Request message for +// [CertificateAuthorityService.ListCaPools][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools]. +message ListCaPoolsRequest { + // Required. The resource name of the location associated with the + // [CaPools][google.cloud.security.privateca.v1.CaPool], in the format + // `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Limit on the number of + // [CaPools][google.cloud.security.privateca.v1.CaPool] to include in the + // response. Further [CaPools][google.cloud.security.privateca.v1.CaPool] can + // subsequently be obtained by including the + // [ListCaPoolsResponse.next_page_token][google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token] + // in a subsequent request. If unspecified, the server will pick an + // appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pagination token, returned earlier via + // [ListCaPoolsResponse.next_page_token][google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token]. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only include resources that match the filter in the response. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specify how the results should be sorted. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [CertificateAuthorityService.ListCaPools][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools]. +message ListCaPoolsResponse { + // The list of [CaPools][google.cloud.security.privateca.v1.CaPool]. + repeated CaPool ca_pools = 1; + + // A token to retrieve next page of results. Pass this value in + // [ListCertificateAuthoritiesRequest.page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.page_token] + // to retrieve the next page of results. + string next_page_token = 2; + + // A list of locations (e.g. "us-west1") that could not be reached. + repeated string unreachable = 3; +} + +// Request message for +// [CertificateAuthorityService.GetCertificateRevocationList][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationList]. +message GetCertificateRevocationListRequest { + // Required. The + // [name][google.cloud.security.privateca.v1.CertificateRevocationList.name] + // of the + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] + // to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateRevocationList" + } + ]; +} + +// Request message for +// [CertificateAuthorityService.ListCertificateRevocationLists][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists]. +message ListCertificateRevocationListsRequest { + // Required. The resource name of the location associated with the + // [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList], + // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. Limit on the number of + // [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList] + // to include in the response. Further + // [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList] + // can subsequently be obtained by including the + // [ListCertificateRevocationListsResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token] + // in a subsequent request. If unspecified, the server will pick an + // appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pagination token, returned earlier via + // [ListCertificateRevocationListsResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token]. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only include resources that match the filter in the response. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specify how the results should be sorted. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [CertificateAuthorityService.ListCertificateRevocationLists][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists]. +message ListCertificateRevocationListsResponse { + // The list of + // [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList]. + repeated CertificateRevocationList certificate_revocation_lists = 1; + + // A token to retrieve next page of results. Pass this value in + // [ListCertificateRevocationListsRequest.page_token][google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.page_token] + // to retrieve the next page of results. + string next_page_token = 2; + + // A list of locations (e.g. "us-west1") that could not be reached. + repeated string unreachable = 3; +} + +// Request message for +// [CertificateAuthorityService.UpdateCertificateRevocationList][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationList]. +message UpdateCertificateRevocationListRequest { + // Required. + // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] + // with updated values. + CertificateRevocationList certificate_revocation_list = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.CreateCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplate]. +message CreateCertificateTemplateRequest { + // Required. The resource name of the location associated with the + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate], + // in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. It must be unique within a location and match the regular + // expression `[a-zA-Z0-9_-]{1,63}` + string certificate_template_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + // with initial field values. + CertificateTemplate certificate_template = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for +// [CertificateAuthorityService.DeleteCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplate]. +message DeleteCertificateTemplateRequest { + // Required. The resource name for this + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + // in the format `projects/*/locations/*/certificateTemplates/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateTemplate" + } + ]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for +// [CertificateAuthorityService.GetCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplate]. +message GetCertificateTemplateRequest { + // Required. The + // [name][google.cloud.security.privateca.v1.CertificateTemplate.name] of the + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + // to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateTemplate" + } + ]; +} + +// Request message for +// [CertificateAuthorityService.ListCertificateTemplates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates]. +message ListCertificateTemplatesRequest { + // Required. The resource name of the location associated with the + // [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate], + // in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Limit on the number of + // [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate] + // to include in the response. Further + // [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate] + // can subsequently be obtained by including the + // [ListCertificateTemplatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token] + // in a subsequent request. If unspecified, the server will pick an + // appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pagination token, returned earlier via + // [ListCertificateTemplatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token]. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only include resources that match the filter in the response. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specify how the results should be sorted. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [CertificateAuthorityService.ListCertificateTemplates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates]. +message ListCertificateTemplatesResponse { + // The list of + // [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate]. + repeated CertificateTemplate certificate_templates = 1; + + // A token to retrieve next page of results. Pass this value in + // [ListCertificateTemplatesRequest.page_token][google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.page_token] + // to retrieve the next page of results. + string next_page_token = 2; + + // A list of locations (e.g. "us-west1") that could not be reached. + repeated string unreachable = 3; +} + +// Request message for +// [CertificateAuthorityService.UpdateCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplate]. +message UpdateCertificateTemplateRequest { + // Required. + // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + // with updated values. + CertificateTemplate certificate_template = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that + // if you must retry your request, the server will know to ignore the request + // if it has already been completed. The server will guarantee that for at + // least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/resources.proto b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/resources.proto new file mode 100644 index 000000000000..211ed3eaf892 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/resources.proto @@ -0,0 +1,902 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.security.privateca.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Security.PrivateCA.V1Beta1"; +option go_package = "cloud.google.com/go/security/privateca/apiv1beta1/privatecapb;privatecapb"; +option java_multiple_files = true; +option java_outer_classname = "PrivateCaResourcesProto"; +option java_package = "com.google.cloud.security.privateca.v1beta1"; +option php_namespace = "Google\\Cloud\\Security\\PrivateCA\\V1beta1"; +option ruby_package = "Google::Cloud::Security::PrivateCA::V1beta1"; + +// A [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] represents an individual Certificate Authority. +// A [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] can be used to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. +message CertificateAuthority { + option (google.api.resource) = { + type: "privateca.googleapis.com/CertificateAuthority" + pattern: "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}" + }; + + // Options that affect all certificates issued by a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + message IssuingOptions { + // Required. When true, includes a URL to the issuing CA certificate in the + // "authority information access" X.509 extension. + bool include_ca_cert_url = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. When true, includes a URL to the CRL corresponding to certificates + // issued from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + // CRLs will expire 7 days from their creation. However, we will rebuild + // daily. CRLs are also rebuilt shortly after a certificate is revoked. + bool include_crl_access_url = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // The issuing policy for a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] will not be successfully issued from this + // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] if they violate the policy. + message CertificateAuthorityPolicy { + message AllowedConfigList { + // Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] + // must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a + // [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be + // allowed for that field. + repeated ReusableConfigWrapper allowed_config_values = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] specifies the allowed values for + // [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames] by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] when issuing + // [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. + message AllowedSubjectAltNames { + // Optional. Contains valid, fully-qualified host names. Glob patterns are also + // supported. To allow an explicit wildcard certificate, escape with + // backlash (i.e. `\*`). + // E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not + // `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set. + // E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not + // `foo.bar.com`. + repeated string allowed_dns_names = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To + // match across path seperators (i.e. '/') use the double star glob + // pattern (i.e. '**'). + repeated string allowed_uris = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also + // supported. + repeated string allowed_email_addresses = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6 + // addresses and subnet ranges. Subnet ranges are specified using the + // '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns + // are supported only for ip address entries (i.e. not for subnet ranges). + repeated string allowed_ips = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies if glob patterns used for [allowed_dns_names][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowed_dns_names] allows + // wildcard certificates. + bool allow_globbing_dns_wildcards = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies if to allow custom X509Extension values. + bool allow_custom_sans = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] specifies the allowed ways in which + // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] may be requested from this + // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + message IssuanceModes { + // Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by + // specifying a CSR. + bool allow_csr_based_issuance = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by + // specifying a [CertificateConfig][google.cloud.security.privateca.v1beta1.CertificateConfig]. + bool allow_config_based_issuance = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Allowed configurations or a single configuration for all issued + // certificates. + oneof config_policy { + // Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] + // must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list. + AllowedConfigList allowed_config_list = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] + // will use the provided configuration values, overwriting any requested + // configuration values. + ReusableConfigWrapper overwrite_config_values = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all + // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must + // match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty + // field, any value will be allowed for that field. + repeated Subject allowed_locations_and_organizations = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If any value is specified here, then all + // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must + // match at least one listed value. If no value is specified, all values + // will be allowed for this fied. Glob patterns are also supported. + repeated string allowed_common_names = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all + // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must + // match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value + // is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames] + // field. + AllowedSubjectAltNames allowed_sans = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that + // if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s + // requested maximum_lifetime, the effective lifetime will be explicitly + // truncated. + google.protobuf.Duration maximum_lifetime = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be + // used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. + IssuanceModes allowed_issuance_modes = 8 [(google.api.field_behavior) = OPTIONAL]; + } + + // URLs where a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will publish content. + message AccessUrls { + // The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate is + // published. This will only be set for CAs that have been activated. + string ca_certificate_access_url = 1; + + // The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CRLs are published. This + // will only be set for CAs that have been activated. + string crl_access_url = 2; + } + + // A Cloud KMS key configuration that a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will use. + message KeyVersionSpec { + oneof KeyVersion { + // Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the + // format + // `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + // This option enables full flexibility in the key's capabilities and + // properties. + string cloud_kms_key_version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The algorithm to use for creating a managed Cloud KMS key for a for a + // simplified experience. All managed keys will be have their + // [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`. + SignHashAlgorithm algorithm = 2 [(google.api.field_behavior) = REQUIRED]; + } + } + + // The type of a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], indicating its issuing chain. + enum Type { + // Not specified. + TYPE_UNSPECIFIED = 0; + + // Self-signed CA. + SELF_SIGNED = 1; + + // Subordinate CA. Could be issued by a Private CA [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] + // or an unmanaged CA. + SUBORDINATE = 2; + } + + // The tier of a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], indicating its supported + // functionality and/or billing SKU. + enum Tier { + // Not specified. + TIER_UNSPECIFIED = 0; + + // Enterprise tier. + ENTERPRISE = 1; + + // DevOps tier. + DEVOPS = 2; + } + + // The state of a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], indicating if it can be used. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // Certificates can be issued from this CA. CRLs will be generated for this + // CA. + ENABLED = 1; + + // Certificates cannot be issued from this CA. CRLs will still be generated. + DISABLED = 2; + + // Certificates cannot be issued from this CA. CRLs will not be generated. + PENDING_ACTIVATION = 3; + + // Certificates cannot be issued from this CA. CRLs will not be generated. + PENDING_DELETION = 4; + } + + // The algorithm of a Cloud KMS CryptoKeyVersion of a + // [CryptoKey][google.cloud.kms.v1.CryptoKey] with the + // [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] value + // `ASYMMETRIC_SIGN`. These values correspond to the + // [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + // values. For RSA signing algorithms, the PSS algorithms should be preferred, + // use PKCS1 algorithms if required for compatibility. For further + // recommandations, see + // https://cloud.google.com/kms/docs/algorithms#algorithm_recommendations. + enum SignHashAlgorithm { + // Not specified. + SIGN_HASH_ALGORITHM_UNSPECIFIED = 0; + + // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256 + RSA_PSS_2048_SHA256 = 1; + + // maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256 + RSA_PSS_3072_SHA256 = 2; + + // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256 + RSA_PSS_4096_SHA256 = 3; + + // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256 + RSA_PKCS1_2048_SHA256 = 6; + + // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256 + RSA_PKCS1_3072_SHA256 = 7; + + // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256 + RSA_PKCS1_4096_SHA256 = 8; + + // maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256 + EC_P256_SHA256 = 4; + + // maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384 + EC_P384_SHA384 = 5; + } + + // Output only. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the + // format `projects/*/locations/*/certificateAuthorities/*`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. The [Type][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + Type type = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The [Tier][google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + Tier tier = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The config used to create a self-signed X.509 certificate or CSR. + CertificateConfig config = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. The desired lifetime of the CA certificate. Used to create the + // "not_before_time" and "not_after_time" fields inside an X.509 + // certificate. + google.protobuf.Duration lifetime = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this + // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key + // is also used to sign the self-signed CA certificate. Otherwise, it + // is used to sign a CSR. + KeyVersionSpec key_spec = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing + // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + CertificateAuthorityPolicy certificate_policy = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate] + // from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + IssuingOptions issuing_options = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set + // with the subordinate configuration, which describes its issuers. This may + // be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate. + SubordinateConfig subordinate_config = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The [State][google.cloud.security.privateca.v1beta1.CertificateAuthority.State] for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current + // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer + // is the final element (consistent with RFC 5246). For a self-signed CA, this + // will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. + repeated string pem_ca_certificates = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate + // and its issuers. Ordered as self-to-root. + repeated CertificateDescription ca_certificate_descriptions = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The name of a Cloud Storage bucket where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will + // publish content, such as the CA certificate and CRLs. This must be a bucket + // name, without any prefixes (such as `gs://`) or suffixes (such as + // `.googleapis.com`). For example, to use a bucket named `my-bucket`, you + // would simply specify `my-bucket`. If not specified, a managed bucket will + // be created. + string gcs_bucket = 13 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. URLs for accessing content published by this CA, such as the CA certificate + // and CRLs. + AccessUrls access_urls = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created. + google.protobuf.Timestamp create_time = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated. + google.protobuf.Timestamp update_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if + // scheduled for deletion. + google.protobuf.Timestamp delete_time = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels with user-defined metadata. + map labels = 18 [(google.api.field_behavior) = OPTIONAL]; +} + +// A [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] corresponds to a signed X.509 certificate +// Revocation List (CRL). A CRL contains the serial numbers of certificates that +// should no longer be trusted. +message CertificateRevocationList { + option (google.api.resource) = { + type: "privateca.googleapis.com/CertificateRevocationList" + pattern: "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}" + }; + + // Describes a revoked [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. + message RevokedCertificate { + // The resource path for the [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in the format + // `projects/*/locations/*/certificateAuthorities/*/certificates/*`. + string certificate = 1; + + // The serial number of the [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. + string hex_serial_number = 2; + + // The reason the [Certificate][google.cloud.security.privateca.v1beta1.Certificate] was revoked. + RevocationReason revocation_reason = 3; + } + + // The state of a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList], indicating if it is current. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // The [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] is up to date. + ACTIVE = 1; + + // The [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] is no longer current. + SUPERSEDED = 2; + } + + // Output only. The resource path for this [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] in + // the format + // `projects/*/locations/*/certificateAuthorities/*/ + // certificateRevocationLists/*`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The CRL sequence number that appears in pem_crl. + int64 sequence_number = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The revoked serial numbers that appear in pem_crl. + repeated RevokedCertificate revoked_certificates = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The PEM-encoded X.509 CRL. + string pem_crl = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The location where 'pem_crl' can be accessed. + string access_url = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The [State][google.cloud.security.privateca.v1beta1.CertificateRevocationList.State] for this [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] was created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] was updated. + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels with user-defined metadata. + map labels = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// A [Certificate][google.cloud.security.privateca.v1beta1.Certificate] corresponds to a signed X.509 certificate issued by a +// [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. +message Certificate { + option (google.api.resource) = { + type: "privateca.googleapis.com/Certificate" + pattern: "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificates/{certificate}" + }; + + // Describes fields that are relavent to the revocation of a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. + message RevocationDetails { + // Indicates why a [Certificate][google.cloud.security.privateca.v1beta1.Certificate] was revoked. + RevocationReason revocation_state = 1; + + // The time at which this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] was revoked. + google.protobuf.Timestamp revocation_time = 2; + } + + // Output only. The resource path for this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in the format + // `projects/*/locations/*/certificateAuthorities/*/certificates/*`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The config used to create a signed X.509 certificate. + oneof certificate_config { + // Immutable. A pem-encoded X.509 certificate signing request (CSR). + string pem_csr = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. A description of the certificate and key that does not require X.509 or + // ASN.1. + CertificateConfig config = 3 [(google.api.field_behavior) = IMMUTABLE]; + } + + // Required. Immutable. The desired lifetime of a certificate. Used to create the + // "not_before_time" and "not_after_time" fields inside an X.509 + // certificate. Note that the lifetime may be truncated if it would extend + // past the life of any certificate authority in the issuing chain. + google.protobuf.Duration lifetime = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Details regarding the revocation of this [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. This + // [Certificate][google.cloud.security.privateca.v1beta1.Certificate] is considered revoked if and only if this field is present. + RevocationDetails revocation_details = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The pem-encoded, signed X.509 certificate. + string pem_certificate = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A structured description of the issued X.509 certificate. + CertificateDescription certificate_description = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The chain that may be used to verify the X.509 certificate. Expected to be + // in issuer-to-root order according to RFC 5246. + repeated string pem_certificate_chain = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] was created. + google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] was updated. + google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels with user-defined metadata. + map labels = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// A [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig] refers to a managed [ReusableConfigValues][google.cloud.security.privateca.v1beta1.ReusableConfigValues]. Those, in +// turn, are used to describe certain fields of an X.509 certificate, such as +// the key usage fields, fields specific to CA certificates, certificate policy +// extensions and custom extensions. +message ReusableConfig { + option (google.api.resource) = { + type: "privateca.googleapis.com/ReusableConfig" + pattern: "projects/{project}/locations/{location}/reusableConfigs/{reusable_config}" + }; + + // Output only. The resource path for this [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig] in the format + // `projects/*/locations/*/reusableConfigs/*`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The config values. + ReusableConfigValues values = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A human-readable description of scenarios these ReusableConfigValues may be + // compatible with. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time at which this [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig] was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig] was updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels with user-defined metadata. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A [ReusableConfigValues][google.cloud.security.privateca.v1beta1.ReusableConfigValues] is used to describe certain fields of an +// X.509 certificate, such as the key usage fields, fields specific to CA +// certificates, certificate policy extensions and custom extensions. +message ReusableConfigValues { + // Describes values that are relevant in a CA certificate. + message CaOptions { + // Optional. Refers to the "CA" X.509 extension, which is a boolean value. When this + // value is missing, the extension will be omitted from the CA certificate. + google.protobuf.BoolValue is_ca = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Refers to the path length restriction X.509 extension. For a CA + // certificate, this value describes the depth of subordinate CA + // certificates that are allowed. + // If this value is less than 0, the request will fail. + // If this value is missing, the max path length will be omitted from the + // CA certificate. + google.protobuf.Int32Value max_issuer_path_length = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Indicates the intended use for keys that correspond to a certificate. + KeyUsage key_usage = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes options in this [ReusableConfigValues][google.cloud.security.privateca.v1beta1.ReusableConfigValues] that are + // relevant in a CA certificate. + CaOptions ca_options = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the X.509 certificate policy object identifiers, per + // https://tools.ietf.org/html/rfc5280#section-4.2.1.4. + repeated ObjectId policy_ids = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes Online Certificate Status Protocol (OCSP) endpoint addresses + // that appear in the "Authority Information Access" extension in the + // certificate. + repeated string aia_ocsp_servers = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes custom X.509 extensions. + repeated X509Extension additional_extensions = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] describes values that may assist in creating an +// X.509 certificate, or a reference to a pre-defined set of values. +message ReusableConfigWrapper { + // Reusable or inline config values. + oneof config_values { + // Required. A resource path to a [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig] in the format + // `projects/*/locations/*/reusableConfigs/*`. + string reusable_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A user-specified inline [ReusableConfigValues][google.cloud.security.privateca.v1beta1.ReusableConfigValues]. + ReusableConfigValues reusable_config_values = 2 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Describes a subordinate CA's issuers. This is either a resource path to a +// known issuing [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], or a PEM issuer certificate chain. +message SubordinateConfig { + // This message describes a subordinate CA's issuer certificate chain. This + // wrapper exists for compatibility reasons. + message SubordinateConfigChain { + // Required. Expected to be in leaf-to-root order according to RFC 5246. + repeated string pem_certificates = 1 [(google.api.field_behavior) = REQUIRED]; + } + + oneof subordinate_config { + // Required. This can refer to a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the same project that + // was used to create a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. This field + // is used for information and usability purposes only. The resource name + // is in the format `projects/*/locations/*/certificateAuthorities/*`. + string certificate_authority = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Contains the PEM certificate chain for the issuers of this + // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], but not pem certificate for this CA itself. + SubordinateConfigChain pem_issuer_chain = 2 [(google.api.field_behavior) = REQUIRED]; + } +} + +// A [PublicKey][google.cloud.security.privateca.v1beta1.PublicKey] describes a public key. +message PublicKey { + // Types of public keys that are supported. + // At a minimum, we support RSA and ECDSA, for the key sizes or curves listed: + // https://cloud.google.com/kms/docs/algorithms#asymmetric_signing_algorithms + enum KeyType { + // Default unspecified value. + KEY_TYPE_UNSPECIFIED = 0; + + // A PEM-encoded PKCS#1/RFC 3447 RSAPrivateKey structure. + PEM_RSA_KEY = 1; + + // A PEM-encoded compressed NIST P-256/secp256r1/prime256v1 or P-384 key. + PEM_EC_KEY = 2; + } + + // Required. The type of public key. + KeyType type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A public key. Padding and encoding varies by 'KeyType' and is described + // along with the KeyType values. + bytes key = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A [CertificateConfig][google.cloud.security.privateca.v1beta1.CertificateConfig] describes an X.509 certificate or CSR that is to be +// created, as an alternative to using ASN.1. +message CertificateConfig { + // These values are used to create the distinguished name and subject + // alternative name fields in an X.509 certificate. + message SubjectConfig { + // Required. Contains distinguished name fields such as the location and organization. + Subject subject = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The "common name" of the distinguished name. + string common_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The subject alternative name fields. + SubjectAltNames subject_alt_name = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Specifies some of the values in a certificate that are related to the + // subject. + SubjectConfig subject_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Describes how some of the technical fields in a certificate should be + // populated. + ReusableConfigWrapper reusable_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The public key that corresponds to this config. This is, for example, used + // when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate], but not when creating a + // self-signed [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] or [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] CSR. + PublicKey public_key = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A [CertificateDescription][google.cloud.security.privateca.v1beta1.CertificateDescription] describes an X.509 certificate or CSR that has +// been issued, as an alternative to using ASN.1 / X.509. +message CertificateDescription { + // These values describe fields in an issued X.509 certificate such as the + // distinguished name, subject alternative names, serial number, and lifetime. + message SubjectDescription { + // Contains distinguished name fields such as the location and organization. + Subject subject = 1; + + // The "common name" of the distinguished name. + string common_name = 2; + + // The subject alternative name fields. + SubjectAltNames subject_alt_name = 3; + + // The serial number encoded in lowercase hexadecimal. + string hex_serial_number = 4; + + // For convenience, the actual lifetime of an issued certificate. + // Corresponds to 'not_after_time' - 'not_before_time'. + google.protobuf.Duration lifetime = 5; + + // The time at which the certificate becomes valid. + google.protobuf.Timestamp not_before_time = 6; + + // The time at which the certificate expires. + google.protobuf.Timestamp not_after_time = 7; + } + + // A KeyId identifies a specific public key, usually by hashing the public + // key. + message KeyId { + // Optional. The value of this KeyId encoded in lowercase hexadecimal. This is most + // likely the 160 bit SHA-1 hash of the public key. + string key_id = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // A group of fingerprints for the x509 certificate. + message CertificateFingerprint { + // The SHA 256 hash, encoded in hexadecimal, of the DER x509 certificate. + string sha256_hash = 1; + } + + // Describes some of the values in a certificate that are related to the + // subject and lifetime. + SubjectDescription subject_description = 1; + + // Describes some of the technical fields in a certificate. + ReusableConfigValues config_values = 2; + + // The public key that corresponds to an issued certificate. + PublicKey public_key = 3; + + // Provides a means of identifiying certificates that contain a particular + // public key, per https://tools.ietf.org/html/rfc5280#section-4.2.1.2. + KeyId subject_key_id = 4; + + // Identifies the subject_key_id of the parent certificate, per + // https://tools.ietf.org/html/rfc5280#section-4.2.1.1 + KeyId authority_key_id = 5; + + // Describes a list of locations to obtain CRL information, i.e. + // the DistributionPoint.fullName described by + // https://tools.ietf.org/html/rfc5280#section-4.2.1.13 + repeated string crl_distribution_points = 6; + + // Describes lists of issuer CA certificate URLs that appear in the + // "Authority Information Access" extension in the certificate. + repeated string aia_issuing_certificate_urls = 7; + + // The hash of the x.509 certificate. + CertificateFingerprint cert_fingerprint = 8; +} + +// An [ObjectId][google.cloud.security.privateca.v1beta1.ObjectId] specifies an object identifier (OID). These provide context +// and describe types in ASN.1 messages. +message ObjectId { + // Required. The parts of an OID path. The most significant parts of the path come + // first. + repeated int32 object_id_path = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// An [X509Extension][google.cloud.security.privateca.v1beta1.X509Extension] specifies an X.509 extension, which may be used in +// different parts of X.509 objects like certificates, CSRs, and CRLs. +message X509Extension { + // Required. The OID for this X.509 extension. + ObjectId object_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates whether or not this extension is critical (i.e., if the client + // does not know how to handle this extension, the client should consider this + // to be an error). + bool critical = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The value of this X.509 extension. + bytes value = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A [KeyUsage][google.cloud.security.privateca.v1beta1.KeyUsage] describes key usage values that may appear in an X.509 +// certificate. +message KeyUsage { + // [KeyUsage.KeyUsageOptions][google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions] corresponds to the key usage values + // described in https://tools.ietf.org/html/rfc5280#section-4.2.1.3. + message KeyUsageOptions { + // The key may be used for digital signatures. + bool digital_signature = 1; + + // The key may be used for cryptographic commitments. Note that this may + // also be referred to as "non-repudiation". + bool content_commitment = 2; + + // The key may be used to encipher other keys. + bool key_encipherment = 3; + + // The key may be used to encipher data. + bool data_encipherment = 4; + + // The key may be used in a key agreement protocol. + bool key_agreement = 5; + + // The key may be used to sign certificates. + bool cert_sign = 6; + + // The key may be used sign certificate revocation lists. + bool crl_sign = 7; + + // The key may be used to encipher only. + bool encipher_only = 8; + + // The key may be used to decipher only. + bool decipher_only = 9; + } + + // [KeyUsage.ExtendedKeyUsageOptions][google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions] has fields that correspond to + // certain common OIDs that could be specified as an extended key usage value. + message ExtendedKeyUsageOptions { + // Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW + // server authentication", though regularly used for non-WWW TLS. + bool server_auth = 1; + + // Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW + // client authentication", though regularly used for non-WWW TLS. + bool client_auth = 2; + + // Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of + // downloadable executable code client authentication". + bool code_signing = 3; + + // Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email + // protection". + bool email_protection = 4; + + // Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding + // the hash of an object to a time". + bool time_stamping = 5; + + // Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing + // OCSP responses". + bool ocsp_signing = 6; + } + + // Describes high-level ways in which a key may be used. + KeyUsageOptions base_key_usage = 1; + + // Detailed scenarios in which a key may be used. + ExtendedKeyUsageOptions extended_key_usage = 2; + + // Used to describe extended key usages that are not listed in the + // [KeyUsage.ExtendedKeyUsageOptions][google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions] message. + repeated ObjectId unknown_extended_key_usages = 3; +} + +// [Subject][google.cloud.security.privateca.v1beta1.Subject] describes parts of a distinguished name that, in turn, +// describes the subject of the certificate. +message Subject { + // The country code of the subject. + string country_code = 1; + + // The organization of the subject. + string organization = 2; + + // The organizational_unit of the subject. + string organizational_unit = 3; + + // The locality or city of the subject. + string locality = 4; + + // The province, territory, or regional state of the subject. + string province = 5; + + // The street address of the subject. + string street_address = 6; + + // The postal code of the subject. + string postal_code = 7; +} + +// [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames] corresponds to a more modern way of listing what +// the asserted identity is in a certificate (i.e., compared to the "common +// name" in the distinguished name). +message SubjectAltNames { + // Contains only valid, fully-qualified host names. + repeated string dns_names = 1; + + // Contains only valid RFC 3986 URIs. + repeated string uris = 2; + + // Contains only valid RFC 2822 E-mail addresses. + repeated string email_addresses = 3; + + // Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses. + repeated string ip_addresses = 4; + + // Contains additional subject alternative name values. + repeated X509Extension custom_sans = 5; +} + +// A [RevocationReason][google.cloud.security.privateca.v1beta1.RevocationReason] indicates whether a [Certificate][google.cloud.security.privateca.v1beta1.Certificate] has been revoked, +// and the reason for revocation. These correspond to standard revocation +// reasons from RFC 5280. Note that the enum labels and values in this +// definition are not the same ASN.1 values defined in RFC 5280. These values +// will be translated to the correct ASN.1 values when a CRL is created. +enum RevocationReason { + // Default unspecified value. This value does indicate that a [Certificate][google.cloud.security.privateca.v1beta1.Certificate] + // has been revoked, but that a reason has not been recorded. + REVOCATION_REASON_UNSPECIFIED = 0; + + // Key material for this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] may have leaked. + KEY_COMPROMISE = 1; + + // The key material for a certificate authority in the issuing path may have + // leaked. + CERTIFICATE_AUTHORITY_COMPROMISE = 2; + + // The subject or other attributes in this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] have changed. + AFFILIATION_CHANGED = 3; + + // This [Certificate][google.cloud.security.privateca.v1beta1.Certificate] has been superseded. + SUPERSEDED = 4; + + // This [Certificate][google.cloud.security.privateca.v1beta1.Certificate] or entities in the issuing path have ceased to + // operate. + CESSATION_OF_OPERATION = 5; + + // This [Certificate][google.cloud.security.privateca.v1beta1.Certificate] should not be considered valid, it is expected that it + // may become valid in the future. + CERTIFICATE_HOLD = 6; + + // This [Certificate][google.cloud.security.privateca.v1beta1.Certificate] no longer has permission to assert the listed + // attributes. + PRIVILEGE_WITHDRAWN = 7; + + // The authority which determines appropriate attributes for a [Certificate][google.cloud.security.privateca.v1beta1.Certificate] + // may have been compromised. + ATTRIBUTE_AUTHORITY_COMPROMISE = 8; +} diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/service.proto b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/service.proto new file mode 100644 index 000000000000..b37883da1ff1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/service.proto @@ -0,0 +1,870 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.security.privateca.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/security/privateca/v1beta1/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Security.PrivateCA.V1Beta1"; +option go_package = "cloud.google.com/go/security/privateca/apiv1beta1/privatecapb;privatecapb"; +option java_multiple_files = true; +option java_outer_classname = "PrivateCaProto"; +option java_package = "com.google.cloud.security.privateca.v1beta1"; +option php_namespace = "Google\\Cloud\\Security\\PrivateCA\\V1beta1"; +option ruby_package = "Google::Cloud::Security::PrivateCA::V1beta1"; + +// [Certificate Authority Service][google.cloud.security.privateca.v1beta1.CertificateAuthorityService] manages private +// certificate authorities and issued certificates. +service CertificateAuthorityService { + option (google.api.default_host) = "privateca.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create a new [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in a given Project, Location from a particular + // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc CreateCertificate(CreateCertificateRequest) returns (Certificate) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates" + body: "certificate" + }; + option (google.api.method_signature) = "parent,certificate,certificate_id"; + } + + // Returns a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. + rpc GetCertificate(GetCertificateRequest) returns (Certificate) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. + rpc ListCertificates(ListCertificatesRequest) returns (ListCertificatesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates" + }; + option (google.api.method_signature) = "parent"; + } + + // Revoke a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. + rpc RevokeCertificate(RevokeCertificateRequest) returns (Certificate) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}:revoke" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Update a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. Currently, the only field you can update is the + // [labels][google.cloud.security.privateca.v1beta1.Certificate.labels] field. + rpc UpdateCertificate(UpdateCertificateRequest) returns (Certificate) { + option (google.api.http) = { + patch: "/v1beta1/{certificate.name=projects/*/locations/*/certificateAuthorities/*/certificates/*}" + body: "certificate" + }; + option (google.api.method_signature) = "certificate,update_mask"; + } + + // Activate a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is in state + // [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is + // of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. After the + // parent Certificate Authority signs a certificate signing request from + // [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr], this method can complete the activation + // process. + rpc ActivateCertificateAuthority(ActivateCertificateAuthorityRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:activate" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Create a new [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in a given Project and Location. + rpc CreateCertificateAuthority(CreateCertificateAuthorityRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities" + body: "certificate_authority" + }; + option (google.api.method_signature) = "parent,certificate_authority,certificate_authority_id"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Disable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc DisableCertificateAuthority(DisableCertificateAuthorityRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:disable" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Enable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc EnableCertificateAuthority(EnableCertificateAuthorityRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:enable" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Fetch a certificate signing request (CSR) from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] + // that is in state + // [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is + // of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. The CSR must + // then be signed by the desired parent Certificate Authority, which could be + // another [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] resource, or could be an on-prem + // certificate authority. See also [ActivateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority]. + rpc FetchCertificateAuthorityCsr(FetchCertificateAuthorityCsrRequest) returns (FetchCertificateAuthorityCsrResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:fetch" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc GetCertificateAuthority(GetCertificateAuthorityRequest) returns (CertificateAuthority) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc ListCertificateAuthorities(ListCertificateAuthoritiesRequest) returns (ListCertificateAuthoritiesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities" + }; + option (google.api.method_signature) = "parent"; + } + + // Restore a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is scheduled for deletion. + rpc RestoreCertificateAuthority(RestoreCertificateAuthorityRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:restore" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Schedule a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] for deletion. + rpc ScheduleDeleteCertificateAuthority(ScheduleDeleteCertificateAuthorityRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:scheduleDelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Update a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc UpdateCertificateAuthority(UpdateCertificateAuthorityRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{certificate_authority.name=projects/*/locations/*/certificateAuthorities/*}" + body: "certificate_authority" + }; + option (google.api.method_signature) = "certificate_authority,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "CertificateAuthority" + metadata_type: "OperationMetadata" + }; + } + + // Returns a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. + rpc GetCertificateRevocationList(GetCertificateRevocationListRequest) returns (CertificateRevocationList) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. + rpc ListCertificateRevocationLists(ListCertificateRevocationListsRequest) returns (ListCertificateRevocationListsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificateRevocationLists" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. + rpc UpdateCertificateRevocationList(UpdateCertificateRevocationListRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{certificate_revocation_list.name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}" + body: "certificate_revocation_list" + }; + option (google.api.method_signature) = "certificate_revocation_list,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "CertificateRevocationList" + metadata_type: "OperationMetadata" + }; + } + + // Returns a [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig]. + rpc GetReusableConfig(GetReusableConfigRequest) returns (ReusableConfig) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/reusableConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig]. + rpc ListReusableConfigs(ListReusableConfigsRequest) returns (ListReusableConfigsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/reusableConfigs" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for [CertificateAuthorityService.CreateCertificate][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificate]. +message CreateCertificateRequest { + // Required. The resource name of the location and [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] + // associated with the [Certificate][google.cloud.security.privateca.v1beta1.Certificate], in the format + // `projects/*/locations/*/certificateAuthorities/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. It must be unique within a location and match the regular + // expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the Enterprise [CertificateAuthority.Tier][google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier], + // but is optional and its value is ignored otherwise. + string certificate_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A [Certificate][google.cloud.security.privateca.v1beta1.Certificate] with initial field values. + Certificate certificate = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that if you must + // retry your request, the server will know to ignore the request if it has + // already been completed. The server will guarantee that for at least 60 + // minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.GetCertificate][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificate]. +message GetCertificateRequest { + // Required. The [name][google.cloud.security.privateca.v1beta1.Certificate.name] of the [Certificate][google.cloud.security.privateca.v1beta1.Certificate] to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/Certificate" + } + ]; +} + +// Request message for [CertificateAuthorityService.ListCertificates][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificates]. +message ListCertificatesRequest { + // Required. The resource name of the location associated with the + // [Certificates][google.cloud.security.privateca.v1beta1.Certificate], in the format + // `projects/*/locations/*/certificateauthorities/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. Limit on the number of + // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] to include in the + // response. Further [Certificates][google.cloud.security.privateca.v1beta1.Certificate] can subsequently be obtained + // by including the + // [ListCertificatesResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token] in a subsequent + // request. If unspecified, the server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pagination token, returned earlier via + // [ListCertificatesResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token]. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only include resources that match the filter in the response. For details + // on supported filters and syntax, see [Certificates Filtering + // documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specify how the results should be sorted. For details on supported fields + // and syntax, see [Certificates Sorting + // documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CertificateAuthorityService.ListCertificates][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificates]. +message ListCertificatesResponse { + // The list of [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. + repeated Certificate certificates = 1; + + // A token to retrieve next page of results. Pass this value in + // [ListCertificatesRequest.next_page_token][] to retrieve the + // next page of results. + string next_page_token = 2; + + // A list of locations (e.g. "us-west1") that could not be reached. + repeated string unreachable = 3; +} + +// Request message for +// [CertificateAuthorityService.RevokeCertificate][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificate]. +message RevokeCertificateRequest { + // Required. The resource name for this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in the + // format `projects/*/locations/*/certificateAuthorities/*/certificates/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/Certificate" + } + ]; + + // Required. The [RevocationReason][google.cloud.security.privateca.v1beta1.RevocationReason] for revoking this certificate. + RevocationReason reason = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that if you must + // retry your request, the server will know to ignore the request if it has + // already been completed. The server will guarantee that for at least 60 + // minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CertificateAuthorityService.UpdateCertificate][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificate]. +message UpdateCertificateRequest { + // Required. [Certificate][google.cloud.security.privateca.v1beta1.Certificate] with updated values. + Certificate certificate = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that if you must + // retry your request, the server will know to ignore the request if it has + // already been completed. The server will guarantee that for at least 60 + // minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.ActivateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority]. +message ActivateCertificateAuthorityRequest { + // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the + // format `projects/*/locations/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Required. The signed CA certificate issued from + // [FetchCertificateAuthorityCsrResponse.pem_csr][google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.pem_csr]. + string pem_ca_certificate = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Must include information about the issuer of 'pem_ca_certificate', and any + // further issuers until the self-signed CA. + SubordinateConfig subordinate_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that if you must + // retry your request, the server will know to ignore the request if it has + // already been completed. The server will guarantee that for at least 60 + // minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.CreateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthority]. +message CreateCertificateAuthorityRequest { + // Required. The resource name of the location associated with the + // [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority], in the format + // `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. It must be unique within a location and match the regular + // expression `[a-zA-Z0-9_-]{1,63}` + string certificate_authority_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] with initial field values. + CertificateAuthority certificate_authority = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that if you must + // retry your request, the server will know to ignore the request if it has + // already been completed. The server will guarantee that for at least 60 + // minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.DisableCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthority]. +message DisableCertificateAuthorityRequest { + // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the + // format `projects/*/locations/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. An ID to identify requests. Specify a unique request ID so that if you must + // retry your request, the server will know to ignore the request if it has + // already been completed. The server will guarantee that for at least 60 + // minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.EnableCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthority]. +message EnableCertificateAuthorityRequest { + // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the + // format `projects/*/locations/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. An ID to identify requests. Specify a unique request ID so that if you must + // retry your request, the server will know to ignore the request if it has + // already been completed. The server will guarantee that for at least 60 + // minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr]. +message FetchCertificateAuthorityCsrRequest { + // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the + // format `projects/*/locations/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; +} + +// Response message for +// [CertificateAuthorityService.FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr]. +message FetchCertificateAuthorityCsrResponse { + // Output only. The PEM-encoded signed certificate signing request (CSR). + string pem_csr = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for [CertificateAuthorityService.GetCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthority]. +message GetCertificateAuthorityRequest { + // Required. The [name][google.cloud.security.privateca.v1beta1.CertificateAuthority.name] of the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] to + // get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; +} + +// Request message for +// [CertificateAuthorityService.ListCertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthorities]. +message ListCertificateAuthoritiesRequest { + // Required. The resource name of the location associated with the + // [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority], in the format + // `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Limit on the number of [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority] to + // include in the response. + // Further [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority] can subsequently be + // obtained by including the + // [ListCertificateAuthoritiesResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token] in a subsequent + // request. If unspecified, the server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pagination token, returned earlier via + // [ListCertificateAuthoritiesResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token]. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only include resources that match the filter in the response. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specify how the results should be sorted. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [CertificateAuthorityService.ListCertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthorities]. +message ListCertificateAuthoritiesResponse { + // The list of [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + repeated CertificateAuthority certificate_authorities = 1; + + // A token to retrieve next page of results. Pass this value in + // [ListCertificateAuthoritiesRequest.next_page_token][] to retrieve the next + // page of results. + string next_page_token = 2; + + // A list of locations (e.g. "us-west1") that could not be reached. + repeated string unreachable = 3; +} + +// Request message for +// [CertificateAuthorityService.RestoreCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthority]. +message RestoreCertificateAuthorityRequest { + // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the + // format `projects/*/locations/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. An ID to identify requests. Specify a unique request ID so that if you must + // retry your request, the server will know to ignore the request if it has + // already been completed. The server will guarantee that for at least 60 + // minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.ScheduleDeleteCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthority]. +message ScheduleDeleteCertificateAuthorityRequest { + // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the + // format `projects/*/locations/*/certificateAuthorities/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. An ID to identify requests. Specify a unique request ID so that if you must + // retry your request, the server will know to ignore the request if it has + // already been completed. The server will guarantee that for at least 60 + // minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.UpdateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthority]. +message UpdateCertificateAuthorityRequest { + // Required. [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] with updated values. + CertificateAuthority certificate_authority = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that if you must + // retry your request, the server will know to ignore the request if it has + // already been completed. The server will guarantee that for at least 60 + // minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.GetCertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationList]. +message GetCertificateRevocationListRequest { + // Required. The [name][google.cloud.security.privateca.v1beta1.CertificateRevocationList.name] of the + // [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateRevocationList" + } + ]; +} + +// Request message for +// [CertificateAuthorityService.ListCertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationLists]. +message ListCertificateRevocationListsRequest { + // Required. The resource name of the location associated with the + // [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList], in the format + // `projects/*/locations/*/certificateauthorities/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CertificateAuthority" + } + ]; + + // Optional. Limit on the number of + // [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList] to include in the + // response. Further [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList] + // can subsequently be obtained by including the + // [ListCertificateRevocationListsResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token] in a subsequent + // request. If unspecified, the server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pagination token, returned earlier via + // [ListCertificateRevocationListsResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token]. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only include resources that match the filter in the response. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specify how the results should be sorted. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [CertificateAuthorityService.ListCertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationLists]. +message ListCertificateRevocationListsResponse { + // The list of [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. + repeated CertificateRevocationList certificate_revocation_lists = 1; + + // A token to retrieve next page of results. Pass this value in + // [ListCertificateRevocationListsRequest.next_page_token][] to retrieve the + // next page of results. + string next_page_token = 2; + + // A list of locations (e.g. "us-west1") that could not be reached. + repeated string unreachable = 3; +} + +// Request message for +// [CertificateAuthorityService.UpdateCertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationList]. +message UpdateCertificateRevocationListRequest { + // Required. [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] with updated values. + CertificateRevocationList certificate_revocation_list = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An ID to identify requests. Specify a unique request ID so that if you must + // retry your request, the server will know to ignore the request if it has + // already been completed. The server will guarantee that for at least 60 + // minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CertificateAuthorityService.GetReusableConfig][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfig]. +message GetReusableConfigRequest { + // Required. The [name][ReusableConfigs.name] of the [ReusableConfigs][] to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/ReusableConfig" + } + ]; +} + +// Request message for +// [CertificateAuthorityService.ListReusableConfigs][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigs]. +message ListReusableConfigsRequest { + // Required. The resource name of the location associated with the + // [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig], in the format + // `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Limit on the number of + // [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig] to include in the response. + // Further [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig] can subsequently be + // obtained by including the + // [ListReusableConfigsResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token] in a subsequent request. If + // unspecified, the server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Pagination token, returned earlier via + // [ListReusableConfigsResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token]. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only include resources that match the filter in the response. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specify how the results should be sorted. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [CertificateAuthorityService.ListReusableConfigs][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigs]. +message ListReusableConfigsResponse { + // The list of [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig]. + repeated ReusableConfig reusable_configs = 1; + + // A token to retrieve next page of results. Pass this value in + // [ListReusableConfigsRequest.next_page_token][] to retrieve + // the next page of results. + string next_page_token = 2; + + // A list of locations (e.g. "us-west1") that could not be reached. + repeated string unreachable = 3; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/protos.d.ts b/owl-bot-staging/google-cloud-security-privateca/protos/protos.d.ts new file mode 100644 index 000000000000..4798747d8829 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/protos/protos.d.ts @@ -0,0 +1,26491 @@ +// Copyright 2026 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace security. */ + namespace security { + + /** Namespace privateca. */ + namespace privateca { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a CertificateAuthority. */ + interface ICertificateAuthority { + + /** CertificateAuthority name */ + name?: (string|null); + + /** CertificateAuthority type */ + type?: (google.cloud.security.privateca.v1.CertificateAuthority.Type|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.Type|null); + + /** CertificateAuthority config */ + config?: (google.cloud.security.privateca.v1.ICertificateConfig|null); + + /** CertificateAuthority lifetime */ + lifetime?: (google.protobuf.IDuration|null); + + /** CertificateAuthority keySpec */ + keySpec?: (google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec|null); + + /** CertificateAuthority subordinateConfig */ + subordinateConfig?: (google.cloud.security.privateca.v1.ISubordinateConfig|null); + + /** CertificateAuthority tier */ + tier?: (google.cloud.security.privateca.v1.CaPool.Tier|keyof typeof google.cloud.security.privateca.v1.CaPool.Tier|null); + + /** CertificateAuthority state */ + state?: (google.cloud.security.privateca.v1.CertificateAuthority.State|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.State|null); + + /** CertificateAuthority pemCaCertificates */ + pemCaCertificates?: (string[]|null); + + /** CertificateAuthority caCertificateDescriptions */ + caCertificateDescriptions?: (google.cloud.security.privateca.v1.ICertificateDescription[]|null); + + /** CertificateAuthority gcsBucket */ + gcsBucket?: (string|null); + + /** CertificateAuthority accessUrls */ + accessUrls?: (google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls|null); + + /** CertificateAuthority createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority labels */ + labels?: ({ [k: string]: string }|null); + + /** CertificateAuthority userDefinedAccessUrls */ + userDefinedAccessUrls?: (google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls|null); + + /** CertificateAuthority satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** CertificateAuthority satisfiesPzi */ + satisfiesPzi?: (boolean|null); + } + + /** Represents a CertificateAuthority. */ + class CertificateAuthority implements ICertificateAuthority { + + /** + * Constructs a new CertificateAuthority. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICertificateAuthority); + + /** CertificateAuthority name. */ + public name: string; + + /** CertificateAuthority type. */ + public type: (google.cloud.security.privateca.v1.CertificateAuthority.Type|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.Type); + + /** CertificateAuthority config. */ + public config?: (google.cloud.security.privateca.v1.ICertificateConfig|null); + + /** CertificateAuthority lifetime. */ + public lifetime?: (google.protobuf.IDuration|null); + + /** CertificateAuthority keySpec. */ + public keySpec?: (google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec|null); + + /** CertificateAuthority subordinateConfig. */ + public subordinateConfig?: (google.cloud.security.privateca.v1.ISubordinateConfig|null); + + /** CertificateAuthority tier. */ + public tier: (google.cloud.security.privateca.v1.CaPool.Tier|keyof typeof google.cloud.security.privateca.v1.CaPool.Tier); + + /** CertificateAuthority state. */ + public state: (google.cloud.security.privateca.v1.CertificateAuthority.State|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.State); + + /** CertificateAuthority pemCaCertificates. */ + public pemCaCertificates: string[]; + + /** CertificateAuthority caCertificateDescriptions. */ + public caCertificateDescriptions: google.cloud.security.privateca.v1.ICertificateDescription[]; + + /** CertificateAuthority gcsBucket. */ + public gcsBucket: string; + + /** CertificateAuthority accessUrls. */ + public accessUrls?: (google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls|null); + + /** CertificateAuthority createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority labels. */ + public labels: { [k: string]: string }; + + /** CertificateAuthority userDefinedAccessUrls. */ + public userDefinedAccessUrls?: (google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls|null); + + /** CertificateAuthority satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** CertificateAuthority satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** + * Creates a new CertificateAuthority instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateAuthority instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICertificateAuthority): google.cloud.security.privateca.v1.CertificateAuthority; + + /** + * Encodes the specified CertificateAuthority message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.verify|verify} messages. + * @param message CertificateAuthority message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICertificateAuthority, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateAuthority message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.verify|verify} messages. + * @param message CertificateAuthority message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateAuthority, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateAuthority message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateAuthority + * @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.security.privateca.v1.CertificateAuthority; + + /** + * Decodes a CertificateAuthority message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateAuthority + * @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.security.privateca.v1.CertificateAuthority; + + /** + * Verifies a CertificateAuthority 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 CertificateAuthority message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateAuthority + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateAuthority; + + /** + * Creates a plain object from a CertificateAuthority message. Also converts values to other types if specified. + * @param message CertificateAuthority + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateAuthority, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateAuthority to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateAuthority + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateAuthority { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + SELF_SIGNED = 1, + SUBORDINATE = 2 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2, + STAGED = 3, + AWAITING_USER_ACTIVATION = 4, + DELETED = 5 + } + + /** Properties of an AccessUrls. */ + interface IAccessUrls { + + /** AccessUrls caCertificateAccessUrl */ + caCertificateAccessUrl?: (string|null); + + /** AccessUrls crlAccessUrls */ + crlAccessUrls?: (string[]|null); + } + + /** Represents an AccessUrls. */ + class AccessUrls implements IAccessUrls { + + /** + * Constructs a new AccessUrls. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls); + + /** AccessUrls caCertificateAccessUrl. */ + public caCertificateAccessUrl: string; + + /** AccessUrls crlAccessUrls. */ + public crlAccessUrls: string[]; + + /** + * Creates a new AccessUrls instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessUrls instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls): google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls; + + /** + * Encodes the specified AccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.verify|verify} messages. + * @param message AccessUrls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.verify|verify} messages. + * @param message AccessUrls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessUrls message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessUrls + * @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.security.privateca.v1.CertificateAuthority.AccessUrls; + + /** + * Decodes an AccessUrls message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessUrls + * @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.security.privateca.v1.CertificateAuthority.AccessUrls; + + /** + * Verifies an AccessUrls 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 AccessUrls message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessUrls + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls; + + /** + * Creates a plain object from an AccessUrls message. Also converts values to other types if specified. + * @param message AccessUrls + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessUrls to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessUrls + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyVersionSpec. */ + interface IKeyVersionSpec { + + /** KeyVersionSpec cloudKmsKeyVersion */ + cloudKmsKeyVersion?: (string|null); + + /** KeyVersionSpec algorithm */ + algorithm?: (google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|null); + } + + /** Represents a KeyVersionSpec. */ + class KeyVersionSpec implements IKeyVersionSpec { + + /** + * Constructs a new KeyVersionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec); + + /** KeyVersionSpec cloudKmsKeyVersion. */ + public cloudKmsKeyVersion?: (string|null); + + /** KeyVersionSpec algorithm. */ + public algorithm?: (google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|null); + + /** KeyVersionSpec KeyVersion. */ + public KeyVersion?: ("cloudKmsKeyVersion"|"algorithm"); + + /** + * Creates a new KeyVersionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyVersionSpec instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec): google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec; + + /** + * Encodes the specified KeyVersionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. + * @param message KeyVersionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyVersionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. + * @param message KeyVersionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyVersionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyVersionSpec + * @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.security.privateca.v1.CertificateAuthority.KeyVersionSpec; + + /** + * Decodes a KeyVersionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyVersionSpec + * @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.security.privateca.v1.CertificateAuthority.KeyVersionSpec; + + /** + * Verifies a KeyVersionSpec 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 KeyVersionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyVersionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec; + + /** + * Creates a plain object from a KeyVersionSpec message. Also converts values to other types if specified. + * @param message KeyVersionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyVersionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyVersionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** SignHashAlgorithm enum. */ + enum SignHashAlgorithm { + SIGN_HASH_ALGORITHM_UNSPECIFIED = 0, + RSA_PSS_2048_SHA256 = 1, + RSA_PSS_3072_SHA256 = 2, + RSA_PSS_4096_SHA256 = 3, + RSA_PKCS1_2048_SHA256 = 6, + RSA_PKCS1_3072_SHA256 = 7, + RSA_PKCS1_4096_SHA256 = 8, + EC_P256_SHA256 = 4, + EC_P384_SHA384 = 5 + } + + /** Properties of a UserDefinedAccessUrls. */ + interface IUserDefinedAccessUrls { + + /** UserDefinedAccessUrls aiaIssuingCertificateUrls */ + aiaIssuingCertificateUrls?: (string[]|null); + + /** UserDefinedAccessUrls crlAccessUrls */ + crlAccessUrls?: (string[]|null); + } + + /** Represents a UserDefinedAccessUrls. */ + class UserDefinedAccessUrls implements IUserDefinedAccessUrls { + + /** + * Constructs a new UserDefinedAccessUrls. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls); + + /** UserDefinedAccessUrls aiaIssuingCertificateUrls. */ + public aiaIssuingCertificateUrls: string[]; + + /** UserDefinedAccessUrls crlAccessUrls. */ + public crlAccessUrls: string[]; + + /** + * Creates a new UserDefinedAccessUrls instance using the specified properties. + * @param [properties] Properties to set + * @returns UserDefinedAccessUrls instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls): google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls; + + /** + * Encodes the specified UserDefinedAccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.verify|verify} messages. + * @param message UserDefinedAccessUrls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserDefinedAccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.verify|verify} messages. + * @param message UserDefinedAccessUrls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserDefinedAccessUrls message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserDefinedAccessUrls + * @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.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls; + + /** + * Decodes a UserDefinedAccessUrls message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserDefinedAccessUrls + * @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.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls; + + /** + * Verifies a UserDefinedAccessUrls 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 UserDefinedAccessUrls message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserDefinedAccessUrls + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls; + + /** + * Creates a plain object from a UserDefinedAccessUrls message. Also converts values to other types if specified. + * @param message UserDefinedAccessUrls + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserDefinedAccessUrls to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserDefinedAccessUrls + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CaPool. */ + interface ICaPool { + + /** CaPool name */ + name?: (string|null); + + /** CaPool tier */ + tier?: (google.cloud.security.privateca.v1.CaPool.Tier|keyof typeof google.cloud.security.privateca.v1.CaPool.Tier|null); + + /** CaPool issuancePolicy */ + issuancePolicy?: (google.cloud.security.privateca.v1.CaPool.IIssuancePolicy|null); + + /** CaPool publishingOptions */ + publishingOptions?: (google.cloud.security.privateca.v1.CaPool.IPublishingOptions|null); + + /** CaPool encryptionSpec */ + encryptionSpec?: (google.cloud.security.privateca.v1.IEncryptionSpec|null); + + /** CaPool labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a CaPool. */ + class CaPool implements ICaPool { + + /** + * Constructs a new CaPool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICaPool); + + /** CaPool name. */ + public name: string; + + /** CaPool tier. */ + public tier: (google.cloud.security.privateca.v1.CaPool.Tier|keyof typeof google.cloud.security.privateca.v1.CaPool.Tier); + + /** CaPool issuancePolicy. */ + public issuancePolicy?: (google.cloud.security.privateca.v1.CaPool.IIssuancePolicy|null); + + /** CaPool publishingOptions. */ + public publishingOptions?: (google.cloud.security.privateca.v1.CaPool.IPublishingOptions|null); + + /** CaPool encryptionSpec. */ + public encryptionSpec?: (google.cloud.security.privateca.v1.IEncryptionSpec|null); + + /** CaPool labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new CaPool instance using the specified properties. + * @param [properties] Properties to set + * @returns CaPool instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICaPool): google.cloud.security.privateca.v1.CaPool; + + /** + * Encodes the specified CaPool message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.verify|verify} messages. + * @param message CaPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICaPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaPool message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.verify|verify} messages. + * @param message CaPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICaPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaPool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaPool + * @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.security.privateca.v1.CaPool; + + /** + * Decodes a CaPool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaPool + * @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.security.privateca.v1.CaPool; + + /** + * Verifies a CaPool 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 CaPool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaPool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool; + + /** + * Creates a plain object from a CaPool message. Also converts values to other types if specified. + * @param message CaPool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CaPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaPool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaPool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CaPool { + + /** Tier enum. */ + enum Tier { + TIER_UNSPECIFIED = 0, + ENTERPRISE = 1, + DEVOPS = 2 + } + + /** Properties of a PublishingOptions. */ + interface IPublishingOptions { + + /** PublishingOptions publishCaCert */ + publishCaCert?: (boolean|null); + + /** PublishingOptions publishCrl */ + publishCrl?: (boolean|null); + + /** PublishingOptions encodingFormat */ + encodingFormat?: (google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat|keyof typeof google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat|null); + } + + /** Represents a PublishingOptions. */ + class PublishingOptions implements IPublishingOptions { + + /** + * Constructs a new PublishingOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CaPool.IPublishingOptions); + + /** PublishingOptions publishCaCert. */ + public publishCaCert: boolean; + + /** PublishingOptions publishCrl. */ + public publishCrl: boolean; + + /** PublishingOptions encodingFormat. */ + public encodingFormat: (google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat|keyof typeof google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat); + + /** + * Creates a new PublishingOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishingOptions instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CaPool.IPublishingOptions): google.cloud.security.privateca.v1.CaPool.PublishingOptions; + + /** + * Encodes the specified PublishingOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.PublishingOptions.verify|verify} messages. + * @param message PublishingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CaPool.IPublishingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishingOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.PublishingOptions.verify|verify} messages. + * @param message PublishingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IPublishingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishingOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishingOptions + * @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.security.privateca.v1.CaPool.PublishingOptions; + + /** + * Decodes a PublishingOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishingOptions + * @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.security.privateca.v1.CaPool.PublishingOptions; + + /** + * Verifies a PublishingOptions 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 PublishingOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishingOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.PublishingOptions; + + /** + * Creates a plain object from a PublishingOptions message. Also converts values to other types if specified. + * @param message PublishingOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CaPool.PublishingOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishingOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublishingOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PublishingOptions { + + /** EncodingFormat enum. */ + enum EncodingFormat { + ENCODING_FORMAT_UNSPECIFIED = 0, + PEM = 1, + DER = 2 + } + } + + /** Properties of an IssuancePolicy. */ + interface IIssuancePolicy { + + /** IssuancePolicy allowedKeyTypes */ + allowedKeyTypes?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType[]|null); + + /** IssuancePolicy backdateDuration */ + backdateDuration?: (google.protobuf.IDuration|null); + + /** IssuancePolicy allowRequesterSpecifiedNotBeforeTime */ + allowRequesterSpecifiedNotBeforeTime?: (boolean|null); + + /** IssuancePolicy maximumLifetime */ + maximumLifetime?: (google.protobuf.IDuration|null); + + /** IssuancePolicy allowedIssuanceModes */ + allowedIssuanceModes?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes|null); + + /** IssuancePolicy baselineValues */ + baselineValues?: (google.cloud.security.privateca.v1.IX509Parameters|null); + + /** IssuancePolicy identityConstraints */ + identityConstraints?: (google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null); + + /** IssuancePolicy passthroughExtensions */ + passthroughExtensions?: (google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null); + } + + /** Represents an IssuancePolicy. */ + class IssuancePolicy implements IIssuancePolicy { + + /** + * Constructs a new IssuancePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CaPool.IIssuancePolicy); + + /** IssuancePolicy allowedKeyTypes. */ + public allowedKeyTypes: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType[]; + + /** IssuancePolicy backdateDuration. */ + public backdateDuration?: (google.protobuf.IDuration|null); + + /** IssuancePolicy allowRequesterSpecifiedNotBeforeTime. */ + public allowRequesterSpecifiedNotBeforeTime: boolean; + + /** IssuancePolicy maximumLifetime. */ + public maximumLifetime?: (google.protobuf.IDuration|null); + + /** IssuancePolicy allowedIssuanceModes. */ + public allowedIssuanceModes?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes|null); + + /** IssuancePolicy baselineValues. */ + public baselineValues?: (google.cloud.security.privateca.v1.IX509Parameters|null); + + /** IssuancePolicy identityConstraints. */ + public identityConstraints?: (google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null); + + /** IssuancePolicy passthroughExtensions. */ + public passthroughExtensions?: (google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null); + + /** + * Creates a new IssuancePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IssuancePolicy instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CaPool.IIssuancePolicy): google.cloud.security.privateca.v1.CaPool.IssuancePolicy; + + /** + * Encodes the specified IssuancePolicy message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.verify|verify} messages. + * @param message IssuancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CaPool.IIssuancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IssuancePolicy message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.verify|verify} messages. + * @param message IssuancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IIssuancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IssuancePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IssuancePolicy + * @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.security.privateca.v1.CaPool.IssuancePolicy; + + /** + * Decodes an IssuancePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IssuancePolicy + * @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.security.privateca.v1.CaPool.IssuancePolicy; + + /** + * Verifies an IssuancePolicy 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 IssuancePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IssuancePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.IssuancePolicy; + + /** + * Creates a plain object from an IssuancePolicy message. Also converts values to other types if specified. + * @param message IssuancePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IssuancePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IssuancePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IssuancePolicy { + + /** Properties of an AllowedKeyType. */ + interface IAllowedKeyType { + + /** AllowedKeyType rsa */ + rsa?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType|null); + + /** AllowedKeyType ellipticCurve */ + ellipticCurve?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType|null); + } + + /** Represents an AllowedKeyType. */ + class AllowedKeyType implements IAllowedKeyType { + + /** + * Constructs a new AllowedKeyType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType); + + /** AllowedKeyType rsa. */ + public rsa?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType|null); + + /** AllowedKeyType ellipticCurve. */ + public ellipticCurve?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType|null); + + /** AllowedKeyType keyType. */ + public keyType?: ("rsa"|"ellipticCurve"); + + /** + * Creates a new AllowedKeyType instance using the specified properties. + * @param [properties] Properties to set + * @returns AllowedKeyType instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType; + + /** + * Encodes the specified AllowedKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.verify|verify} messages. + * @param message AllowedKeyType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllowedKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.verify|verify} messages. + * @param message AllowedKeyType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllowedKeyType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllowedKeyType + * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType; + + /** + * Decodes an AllowedKeyType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllowedKeyType + * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType; + + /** + * Verifies an AllowedKeyType 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 AllowedKeyType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllowedKeyType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType; + + /** + * Creates a plain object from an AllowedKeyType message. Also converts values to other types if specified. + * @param message AllowedKeyType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllowedKeyType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllowedKeyType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AllowedKeyType { + + /** Properties of a RsaKeyType. */ + interface IRsaKeyType { + + /** RsaKeyType minModulusSize */ + minModulusSize?: (number|Long|string|null); + + /** RsaKeyType maxModulusSize */ + maxModulusSize?: (number|Long|string|null); + } + + /** Represents a RsaKeyType. */ + class RsaKeyType implements IRsaKeyType { + + /** + * Constructs a new RsaKeyType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType); + + /** RsaKeyType minModulusSize. */ + public minModulusSize: (number|Long|string); + + /** RsaKeyType maxModulusSize. */ + public maxModulusSize: (number|Long|string); + + /** + * Creates a new RsaKeyType instance using the specified properties. + * @param [properties] Properties to set + * @returns RsaKeyType instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType; + + /** + * Encodes the specified RsaKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.verify|verify} messages. + * @param message RsaKeyType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RsaKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.verify|verify} messages. + * @param message RsaKeyType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RsaKeyType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RsaKeyType + * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType; + + /** + * Decodes a RsaKeyType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RsaKeyType + * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType; + + /** + * Verifies a RsaKeyType 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 RsaKeyType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RsaKeyType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType; + + /** + * Creates a plain object from a RsaKeyType message. Also converts values to other types if specified. + * @param message RsaKeyType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RsaKeyType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RsaKeyType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EcKeyType. */ + interface IEcKeyType { + + /** EcKeyType signatureAlgorithm */ + signatureAlgorithm?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm|keyof typeof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm|null); + } + + /** Represents an EcKeyType. */ + class EcKeyType implements IEcKeyType { + + /** + * Constructs a new EcKeyType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType); + + /** EcKeyType signatureAlgorithm. */ + public signatureAlgorithm: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm|keyof typeof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm); + + /** + * Creates a new EcKeyType instance using the specified properties. + * @param [properties] Properties to set + * @returns EcKeyType instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType; + + /** + * Encodes the specified EcKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.verify|verify} messages. + * @param message EcKeyType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EcKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.verify|verify} messages. + * @param message EcKeyType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EcKeyType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EcKeyType + * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType; + + /** + * Decodes an EcKeyType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EcKeyType + * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType; + + /** + * Verifies an EcKeyType 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 EcKeyType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EcKeyType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType; + + /** + * Creates a plain object from an EcKeyType message. Also converts values to other types if specified. + * @param message EcKeyType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EcKeyType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EcKeyType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EcKeyType { + + /** EcSignatureAlgorithm enum. */ + enum EcSignatureAlgorithm { + EC_SIGNATURE_ALGORITHM_UNSPECIFIED = 0, + ECDSA_P256 = 1, + ECDSA_P384 = 2, + EDDSA_25519 = 3 + } + } + } + + /** Properties of an IssuanceModes. */ + interface IIssuanceModes { + + /** IssuanceModes allowCsrBasedIssuance */ + allowCsrBasedIssuance?: (boolean|null); + + /** IssuanceModes allowConfigBasedIssuance */ + allowConfigBasedIssuance?: (boolean|null); + } + + /** Represents an IssuanceModes. */ + class IssuanceModes implements IIssuanceModes { + + /** + * Constructs a new IssuanceModes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes); + + /** IssuanceModes allowCsrBasedIssuance. */ + public allowCsrBasedIssuance: boolean; + + /** IssuanceModes allowConfigBasedIssuance. */ + public allowConfigBasedIssuance: boolean; + + /** + * Creates a new IssuanceModes instance using the specified properties. + * @param [properties] Properties to set + * @returns IssuanceModes instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes; + + /** + * Encodes the specified IssuanceModes message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.verify|verify} messages. + * @param message IssuanceModes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IssuanceModes message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.verify|verify} messages. + * @param message IssuanceModes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IssuanceModes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IssuanceModes + * @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.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes; + + /** + * Decodes an IssuanceModes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IssuanceModes + * @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.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes; + + /** + * Verifies an IssuanceModes 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 IssuanceModes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IssuanceModes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes; + + /** + * Creates a plain object from an IssuanceModes message. Also converts values to other types if specified. + * @param message IssuanceModes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IssuanceModes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IssuanceModes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an EncryptionSpec. */ + interface IEncryptionSpec { + + /** EncryptionSpec cloudKmsKey */ + cloudKmsKey?: (string|null); + } + + /** Represents an EncryptionSpec. */ + class EncryptionSpec implements IEncryptionSpec { + + /** + * Constructs a new EncryptionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IEncryptionSpec); + + /** EncryptionSpec cloudKmsKey. */ + public cloudKmsKey: string; + + /** + * Creates a new EncryptionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionSpec instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IEncryptionSpec): google.cloud.security.privateca.v1.EncryptionSpec; + + /** + * Encodes the specified EncryptionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. + * @param message EncryptionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IEncryptionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. + * @param message EncryptionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IEncryptionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionSpec + * @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.security.privateca.v1.EncryptionSpec; + + /** + * Decodes an EncryptionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionSpec + * @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.security.privateca.v1.EncryptionSpec; + + /** + * Verifies an EncryptionSpec 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 EncryptionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.EncryptionSpec; + + /** + * Creates a plain object from an EncryptionSpec message. Also converts values to other types if specified. + * @param message EncryptionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.EncryptionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CertificateRevocationList. */ + interface ICertificateRevocationList { + + /** CertificateRevocationList name */ + name?: (string|null); + + /** CertificateRevocationList sequenceNumber */ + sequenceNumber?: (number|Long|string|null); + + /** CertificateRevocationList revokedCertificates */ + revokedCertificates?: (google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate[]|null); + + /** CertificateRevocationList pemCrl */ + pemCrl?: (string|null); + + /** CertificateRevocationList accessUrl */ + accessUrl?: (string|null); + + /** CertificateRevocationList state */ + state?: (google.cloud.security.privateca.v1.CertificateRevocationList.State|keyof typeof google.cloud.security.privateca.v1.CertificateRevocationList.State|null); + + /** CertificateRevocationList createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateRevocationList updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateRevocationList revisionId */ + revisionId?: (string|null); + + /** CertificateRevocationList labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a CertificateRevocationList. */ + class CertificateRevocationList implements ICertificateRevocationList { + + /** + * Constructs a new CertificateRevocationList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICertificateRevocationList); + + /** CertificateRevocationList name. */ + public name: string; + + /** CertificateRevocationList sequenceNumber. */ + public sequenceNumber: (number|Long|string); + + /** CertificateRevocationList revokedCertificates. */ + public revokedCertificates: google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate[]; + + /** CertificateRevocationList pemCrl. */ + public pemCrl: string; + + /** CertificateRevocationList accessUrl. */ + public accessUrl: string; + + /** CertificateRevocationList state. */ + public state: (google.cloud.security.privateca.v1.CertificateRevocationList.State|keyof typeof google.cloud.security.privateca.v1.CertificateRevocationList.State); + + /** CertificateRevocationList createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateRevocationList updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateRevocationList revisionId. */ + public revisionId: string; + + /** CertificateRevocationList labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new CertificateRevocationList instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateRevocationList instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICertificateRevocationList): google.cloud.security.privateca.v1.CertificateRevocationList; + + /** + * Encodes the specified CertificateRevocationList message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.verify|verify} messages. + * @param message CertificateRevocationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICertificateRevocationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateRevocationList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.verify|verify} messages. + * @param message CertificateRevocationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateRevocationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateRevocationList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateRevocationList + * @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.security.privateca.v1.CertificateRevocationList; + + /** + * Decodes a CertificateRevocationList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateRevocationList + * @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.security.privateca.v1.CertificateRevocationList; + + /** + * Verifies a CertificateRevocationList 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 CertificateRevocationList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateRevocationList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateRevocationList; + + /** + * Creates a plain object from a CertificateRevocationList message. Also converts values to other types if specified. + * @param message CertificateRevocationList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateRevocationList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateRevocationList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateRevocationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateRevocationList { + + /** Properties of a RevokedCertificate. */ + interface IRevokedCertificate { + + /** RevokedCertificate certificate */ + certificate?: (string|null); + + /** RevokedCertificate hexSerialNumber */ + hexSerialNumber?: (string|null); + + /** RevokedCertificate revocationReason */ + revocationReason?: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason|null); + } + + /** Represents a RevokedCertificate. */ + class RevokedCertificate implements IRevokedCertificate { + + /** + * Constructs a new RevokedCertificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate); + + /** RevokedCertificate certificate. */ + public certificate: string; + + /** RevokedCertificate hexSerialNumber. */ + public hexSerialNumber: string; + + /** RevokedCertificate revocationReason. */ + public revocationReason: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason); + + /** + * Creates a new RevokedCertificate instance using the specified properties. + * @param [properties] Properties to set + * @returns RevokedCertificate instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate): google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate; + + /** + * Encodes the specified RevokedCertificate message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. + * @param message RevokedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RevokedCertificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. + * @param message RevokedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RevokedCertificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RevokedCertificate + * @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.security.privateca.v1.CertificateRevocationList.RevokedCertificate; + + /** + * Decodes a RevokedCertificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RevokedCertificate + * @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.security.privateca.v1.CertificateRevocationList.RevokedCertificate; + + /** + * Verifies a RevokedCertificate 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 RevokedCertificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RevokedCertificate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate; + + /** + * Creates a plain object from a RevokedCertificate message. Also converts values to other types if specified. + * @param message RevokedCertificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RevokedCertificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RevokedCertificate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + SUPERSEDED = 2 + } + } + + /** Properties of a Certificate. */ + interface ICertificate { + + /** Certificate name */ + name?: (string|null); + + /** Certificate pemCsr */ + pemCsr?: (string|null); + + /** Certificate config */ + config?: (google.cloud.security.privateca.v1.ICertificateConfig|null); + + /** Certificate issuerCertificateAuthority */ + issuerCertificateAuthority?: (string|null); + + /** Certificate lifetime */ + lifetime?: (google.protobuf.IDuration|null); + + /** Certificate certificateTemplate */ + certificateTemplate?: (string|null); + + /** Certificate subjectMode */ + subjectMode?: (google.cloud.security.privateca.v1.SubjectRequestMode|keyof typeof google.cloud.security.privateca.v1.SubjectRequestMode|null); + + /** Certificate revocationDetails */ + revocationDetails?: (google.cloud.security.privateca.v1.Certificate.IRevocationDetails|null); + + /** Certificate pemCertificate */ + pemCertificate?: (string|null); + + /** Certificate certificateDescription */ + certificateDescription?: (google.cloud.security.privateca.v1.ICertificateDescription|null); + + /** Certificate pemCertificateChain */ + pemCertificateChain?: (string[]|null); + + /** Certificate createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Certificate updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Certificate labels */ + labels?: ({ [k: string]: string }|null); + + /** Certificate requestedNotBeforeTime */ + requestedNotBeforeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Certificate. */ + class Certificate implements ICertificate { + + /** + * Constructs a new Certificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICertificate); + + /** Certificate name. */ + public name: string; + + /** Certificate pemCsr. */ + public pemCsr?: (string|null); + + /** Certificate config. */ + public config?: (google.cloud.security.privateca.v1.ICertificateConfig|null); + + /** Certificate issuerCertificateAuthority. */ + public issuerCertificateAuthority: string; + + /** Certificate lifetime. */ + public lifetime?: (google.protobuf.IDuration|null); + + /** Certificate certificateTemplate. */ + public certificateTemplate: string; + + /** Certificate subjectMode. */ + public subjectMode: (google.cloud.security.privateca.v1.SubjectRequestMode|keyof typeof google.cloud.security.privateca.v1.SubjectRequestMode); + + /** Certificate revocationDetails. */ + public revocationDetails?: (google.cloud.security.privateca.v1.Certificate.IRevocationDetails|null); + + /** Certificate pemCertificate. */ + public pemCertificate: string; + + /** Certificate certificateDescription. */ + public certificateDescription?: (google.cloud.security.privateca.v1.ICertificateDescription|null); + + /** Certificate pemCertificateChain. */ + public pemCertificateChain: string[]; + + /** Certificate createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Certificate updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Certificate labels. */ + public labels: { [k: string]: string }; + + /** Certificate requestedNotBeforeTime. */ + public requestedNotBeforeTime?: (google.protobuf.ITimestamp|null); + + /** Certificate certificateConfig. */ + public certificateConfig?: ("pemCsr"|"config"); + + /** + * Creates a new Certificate instance using the specified properties. + * @param [properties] Properties to set + * @returns Certificate instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICertificate): google.cloud.security.privateca.v1.Certificate; + + /** + * Encodes the specified Certificate message. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.verify|verify} messages. + * @param message Certificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Certificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.verify|verify} messages. + * @param message Certificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Certificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Certificate + * @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.security.privateca.v1.Certificate; + + /** + * Decodes a Certificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Certificate + * @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.security.privateca.v1.Certificate; + + /** + * Verifies a Certificate 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 Certificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Certificate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.Certificate; + + /** + * Creates a plain object from a Certificate message. Also converts values to other types if specified. + * @param message Certificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.Certificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Certificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Certificate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Certificate { + + /** Properties of a RevocationDetails. */ + interface IRevocationDetails { + + /** RevocationDetails revocationState */ + revocationState?: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason|null); + + /** RevocationDetails revocationTime */ + revocationTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RevocationDetails. */ + class RevocationDetails implements IRevocationDetails { + + /** + * Constructs a new RevocationDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.Certificate.IRevocationDetails); + + /** RevocationDetails revocationState. */ + public revocationState: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason); + + /** RevocationDetails revocationTime. */ + public revocationTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new RevocationDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns RevocationDetails instance + */ + public static create(properties?: google.cloud.security.privateca.v1.Certificate.IRevocationDetails): google.cloud.security.privateca.v1.Certificate.RevocationDetails; + + /** + * Encodes the specified RevocationDetails message. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.RevocationDetails.verify|verify} messages. + * @param message RevocationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.Certificate.IRevocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RevocationDetails message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.RevocationDetails.verify|verify} messages. + * @param message RevocationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.Certificate.IRevocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RevocationDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RevocationDetails + * @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.security.privateca.v1.Certificate.RevocationDetails; + + /** + * Decodes a RevocationDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RevocationDetails + * @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.security.privateca.v1.Certificate.RevocationDetails; + + /** + * Verifies a RevocationDetails 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 RevocationDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RevocationDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.Certificate.RevocationDetails; + + /** + * Creates a plain object from a RevocationDetails message. Also converts values to other types if specified. + * @param message RevocationDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.Certificate.RevocationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RevocationDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RevocationDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CertificateTemplate. */ + interface ICertificateTemplate { + + /** CertificateTemplate name */ + name?: (string|null); + + /** CertificateTemplate maximumLifetime */ + maximumLifetime?: (google.protobuf.IDuration|null); + + /** CertificateTemplate predefinedValues */ + predefinedValues?: (google.cloud.security.privateca.v1.IX509Parameters|null); + + /** CertificateTemplate identityConstraints */ + identityConstraints?: (google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null); + + /** CertificateTemplate passthroughExtensions */ + passthroughExtensions?: (google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null); + + /** CertificateTemplate description */ + description?: (string|null); + + /** CertificateTemplate createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateTemplate updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateTemplate labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a CertificateTemplate. */ + class CertificateTemplate implements ICertificateTemplate { + + /** + * Constructs a new CertificateTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICertificateTemplate); + + /** CertificateTemplate name. */ + public name: string; + + /** CertificateTemplate maximumLifetime. */ + public maximumLifetime?: (google.protobuf.IDuration|null); + + /** CertificateTemplate predefinedValues. */ + public predefinedValues?: (google.cloud.security.privateca.v1.IX509Parameters|null); + + /** CertificateTemplate identityConstraints. */ + public identityConstraints?: (google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null); + + /** CertificateTemplate passthroughExtensions. */ + public passthroughExtensions?: (google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null); + + /** CertificateTemplate description. */ + public description: string; + + /** CertificateTemplate createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateTemplate updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateTemplate labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new CertificateTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateTemplate instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICertificateTemplate): google.cloud.security.privateca.v1.CertificateTemplate; + + /** + * Encodes the specified CertificateTemplate message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateTemplate.verify|verify} messages. + * @param message CertificateTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICertificateTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateTemplate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateTemplate.verify|verify} messages. + * @param message CertificateTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateTemplate + * @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.security.privateca.v1.CertificateTemplate; + + /** + * Decodes a CertificateTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateTemplate + * @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.security.privateca.v1.CertificateTemplate; + + /** + * Verifies a CertificateTemplate 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 CertificateTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateTemplate; + + /** + * Creates a plain object from a CertificateTemplate message. Also converts values to other types if specified. + * @param message CertificateTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a X509Parameters. */ + interface IX509Parameters { + + /** X509Parameters keyUsage */ + keyUsage?: (google.cloud.security.privateca.v1.IKeyUsage|null); + + /** X509Parameters caOptions */ + caOptions?: (google.cloud.security.privateca.v1.X509Parameters.ICaOptions|null); + + /** X509Parameters policyIds */ + policyIds?: (google.cloud.security.privateca.v1.IObjectId[]|null); + + /** X509Parameters aiaOcspServers */ + aiaOcspServers?: (string[]|null); + + /** X509Parameters nameConstraints */ + nameConstraints?: (google.cloud.security.privateca.v1.X509Parameters.INameConstraints|null); + + /** X509Parameters additionalExtensions */ + additionalExtensions?: (google.cloud.security.privateca.v1.IX509Extension[]|null); + } + + /** Represents a X509Parameters. */ + class X509Parameters implements IX509Parameters { + + /** + * Constructs a new X509Parameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IX509Parameters); + + /** X509Parameters keyUsage. */ + public keyUsage?: (google.cloud.security.privateca.v1.IKeyUsage|null); + + /** X509Parameters caOptions. */ + public caOptions?: (google.cloud.security.privateca.v1.X509Parameters.ICaOptions|null); + + /** X509Parameters policyIds. */ + public policyIds: google.cloud.security.privateca.v1.IObjectId[]; + + /** X509Parameters aiaOcspServers. */ + public aiaOcspServers: string[]; + + /** X509Parameters nameConstraints. */ + public nameConstraints?: (google.cloud.security.privateca.v1.X509Parameters.INameConstraints|null); + + /** X509Parameters additionalExtensions. */ + public additionalExtensions: google.cloud.security.privateca.v1.IX509Extension[]; + + /** + * Creates a new X509Parameters instance using the specified properties. + * @param [properties] Properties to set + * @returns X509Parameters instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IX509Parameters): google.cloud.security.privateca.v1.X509Parameters; + + /** + * Encodes the specified X509Parameters message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.verify|verify} messages. + * @param message X509Parameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IX509Parameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified X509Parameters message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.verify|verify} messages. + * @param message X509Parameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IX509Parameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a X509Parameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns X509Parameters + * @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.security.privateca.v1.X509Parameters; + + /** + * Decodes a X509Parameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns X509Parameters + * @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.security.privateca.v1.X509Parameters; + + /** + * Verifies a X509Parameters 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 X509Parameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns X509Parameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.X509Parameters; + + /** + * Creates a plain object from a X509Parameters message. Also converts values to other types if specified. + * @param message X509Parameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.X509Parameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this X509Parameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for X509Parameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace X509Parameters { + + /** Properties of a CaOptions. */ + interface ICaOptions { + + /** CaOptions isCa */ + isCa?: (boolean|null); + + /** CaOptions maxIssuerPathLength */ + maxIssuerPathLength?: (number|null); + } + + /** Represents a CaOptions. */ + class CaOptions implements ICaOptions { + + /** + * Constructs a new CaOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.X509Parameters.ICaOptions); + + /** CaOptions isCa. */ + public isCa?: (boolean|null); + + /** CaOptions maxIssuerPathLength. */ + public maxIssuerPathLength?: (number|null); + + /** + * Creates a new CaOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CaOptions instance + */ + public static create(properties?: google.cloud.security.privateca.v1.X509Parameters.ICaOptions): google.cloud.security.privateca.v1.X509Parameters.CaOptions; + + /** + * Encodes the specified CaOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.CaOptions.verify|verify} messages. + * @param message CaOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.X509Parameters.ICaOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.CaOptions.verify|verify} messages. + * @param message CaOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.X509Parameters.ICaOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaOptions + * @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.security.privateca.v1.X509Parameters.CaOptions; + + /** + * Decodes a CaOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaOptions + * @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.security.privateca.v1.X509Parameters.CaOptions; + + /** + * Verifies a CaOptions 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 CaOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.X509Parameters.CaOptions; + + /** + * Creates a plain object from a CaOptions message. Also converts values to other types if specified. + * @param message CaOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.X509Parameters.CaOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NameConstraints. */ + interface INameConstraints { + + /** NameConstraints critical */ + critical?: (boolean|null); + + /** NameConstraints permittedDnsNames */ + permittedDnsNames?: (string[]|null); + + /** NameConstraints excludedDnsNames */ + excludedDnsNames?: (string[]|null); + + /** NameConstraints permittedIpRanges */ + permittedIpRanges?: (string[]|null); + + /** NameConstraints excludedIpRanges */ + excludedIpRanges?: (string[]|null); + + /** NameConstraints permittedEmailAddresses */ + permittedEmailAddresses?: (string[]|null); + + /** NameConstraints excludedEmailAddresses */ + excludedEmailAddresses?: (string[]|null); + + /** NameConstraints permittedUris */ + permittedUris?: (string[]|null); + + /** NameConstraints excludedUris */ + excludedUris?: (string[]|null); + } + + /** Represents a NameConstraints. */ + class NameConstraints implements INameConstraints { + + /** + * Constructs a new NameConstraints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.X509Parameters.INameConstraints); + + /** NameConstraints critical. */ + public critical: boolean; + + /** NameConstraints permittedDnsNames. */ + public permittedDnsNames: string[]; + + /** NameConstraints excludedDnsNames. */ + public excludedDnsNames: string[]; + + /** NameConstraints permittedIpRanges. */ + public permittedIpRanges: string[]; + + /** NameConstraints excludedIpRanges. */ + public excludedIpRanges: string[]; + + /** NameConstraints permittedEmailAddresses. */ + public permittedEmailAddresses: string[]; + + /** NameConstraints excludedEmailAddresses. */ + public excludedEmailAddresses: string[]; + + /** NameConstraints permittedUris. */ + public permittedUris: string[]; + + /** NameConstraints excludedUris. */ + public excludedUris: string[]; + + /** + * Creates a new NameConstraints instance using the specified properties. + * @param [properties] Properties to set + * @returns NameConstraints instance + */ + public static create(properties?: google.cloud.security.privateca.v1.X509Parameters.INameConstraints): google.cloud.security.privateca.v1.X509Parameters.NameConstraints; + + /** + * Encodes the specified NameConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.NameConstraints.verify|verify} messages. + * @param message NameConstraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.X509Parameters.INameConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NameConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.NameConstraints.verify|verify} messages. + * @param message NameConstraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.X509Parameters.INameConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NameConstraints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NameConstraints + * @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.security.privateca.v1.X509Parameters.NameConstraints; + + /** + * Decodes a NameConstraints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NameConstraints + * @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.security.privateca.v1.X509Parameters.NameConstraints; + + /** + * Verifies a NameConstraints 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 NameConstraints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NameConstraints + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.X509Parameters.NameConstraints; + + /** + * Creates a plain object from a NameConstraints message. Also converts values to other types if specified. + * @param message NameConstraints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.X509Parameters.NameConstraints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NameConstraints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NameConstraints + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SubordinateConfig. */ + interface ISubordinateConfig { + + /** SubordinateConfig certificateAuthority */ + certificateAuthority?: (string|null); + + /** SubordinateConfig pemIssuerChain */ + pemIssuerChain?: (google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain|null); + } + + /** Represents a SubordinateConfig. */ + class SubordinateConfig implements ISubordinateConfig { + + /** + * Constructs a new SubordinateConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ISubordinateConfig); + + /** SubordinateConfig certificateAuthority. */ + public certificateAuthority?: (string|null); + + /** SubordinateConfig pemIssuerChain. */ + public pemIssuerChain?: (google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain|null); + + /** SubordinateConfig subordinateConfig. */ + public subordinateConfig?: ("certificateAuthority"|"pemIssuerChain"); + + /** + * Creates a new SubordinateConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SubordinateConfig instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ISubordinateConfig): google.cloud.security.privateca.v1.SubordinateConfig; + + /** + * Encodes the specified SubordinateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.verify|verify} messages. + * @param message SubordinateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ISubordinateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubordinateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.verify|verify} messages. + * @param message SubordinateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ISubordinateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubordinateConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubordinateConfig + * @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.security.privateca.v1.SubordinateConfig; + + /** + * Decodes a SubordinateConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubordinateConfig + * @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.security.privateca.v1.SubordinateConfig; + + /** + * Verifies a SubordinateConfig 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 SubordinateConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubordinateConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.SubordinateConfig; + + /** + * Creates a plain object from a SubordinateConfig message. Also converts values to other types if specified. + * @param message SubordinateConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.SubordinateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubordinateConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubordinateConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SubordinateConfig { + + /** Properties of a SubordinateConfigChain. */ + interface ISubordinateConfigChain { + + /** SubordinateConfigChain pemCertificates */ + pemCertificates?: (string[]|null); + } + + /** Represents a SubordinateConfigChain. */ + class SubordinateConfigChain implements ISubordinateConfigChain { + + /** + * Constructs a new SubordinateConfigChain. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain); + + /** SubordinateConfigChain pemCertificates. */ + public pemCertificates: string[]; + + /** + * Creates a new SubordinateConfigChain instance using the specified properties. + * @param [properties] Properties to set + * @returns SubordinateConfigChain instance + */ + public static create(properties?: google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain): google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain; + + /** + * Encodes the specified SubordinateConfigChain message. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. + * @param message SubordinateConfigChain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubordinateConfigChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. + * @param message SubordinateConfigChain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubordinateConfigChain message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubordinateConfigChain + * @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.security.privateca.v1.SubordinateConfig.SubordinateConfigChain; + + /** + * Decodes a SubordinateConfigChain message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubordinateConfigChain + * @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.security.privateca.v1.SubordinateConfig.SubordinateConfigChain; + + /** + * Verifies a SubordinateConfigChain 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 SubordinateConfigChain message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubordinateConfigChain + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain; + + /** + * Creates a plain object from a SubordinateConfigChain message. Also converts values to other types if specified. + * @param message SubordinateConfigChain + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubordinateConfigChain to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubordinateConfigChain + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PublicKey. */ + interface IPublicKey { + + /** PublicKey key */ + key?: (Uint8Array|Buffer|string|null); + + /** PublicKey format */ + format?: (google.cloud.security.privateca.v1.PublicKey.KeyFormat|keyof typeof google.cloud.security.privateca.v1.PublicKey.KeyFormat|null); + } + + /** Represents a PublicKey. */ + class PublicKey implements IPublicKey { + + /** + * Constructs a new PublicKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IPublicKey); + + /** PublicKey key. */ + public key: (Uint8Array|Buffer|string); + + /** PublicKey format. */ + public format: (google.cloud.security.privateca.v1.PublicKey.KeyFormat|keyof typeof google.cloud.security.privateca.v1.PublicKey.KeyFormat); + + /** + * Creates a new PublicKey instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicKey instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IPublicKey): google.cloud.security.privateca.v1.PublicKey; + + /** + * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.security.privateca.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.security.privateca.v1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.security.privateca.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.security.privateca.v1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.security.privateca.v1.PublicKey; + + /** + * 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.security.privateca.v1.PublicKey; + + /** + * 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 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.security.privateca.v1.PublicKey; + + /** + * 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.security.privateca.v1.PublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublicKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublicKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PublicKey { + + /** KeyFormat enum. */ + enum KeyFormat { + KEY_FORMAT_UNSPECIFIED = 0, + PEM = 1 + } + } + + /** Properties of a CertificateConfig. */ + interface ICertificateConfig { + + /** CertificateConfig subjectConfig */ + subjectConfig?: (google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig|null); + + /** CertificateConfig x509Config */ + x509Config?: (google.cloud.security.privateca.v1.IX509Parameters|null); + + /** CertificateConfig publicKey */ + publicKey?: (google.cloud.security.privateca.v1.IPublicKey|null); + + /** CertificateConfig subjectKeyId */ + subjectKeyId?: (google.cloud.security.privateca.v1.CertificateConfig.IKeyId|null); + } + + /** Represents a CertificateConfig. */ + class CertificateConfig implements ICertificateConfig { + + /** + * Constructs a new CertificateConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICertificateConfig); + + /** CertificateConfig subjectConfig. */ + public subjectConfig?: (google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig|null); + + /** CertificateConfig x509Config. */ + public x509Config?: (google.cloud.security.privateca.v1.IX509Parameters|null); + + /** CertificateConfig publicKey. */ + public publicKey?: (google.cloud.security.privateca.v1.IPublicKey|null); + + /** CertificateConfig subjectKeyId. */ + public subjectKeyId?: (google.cloud.security.privateca.v1.CertificateConfig.IKeyId|null); + + /** + * Creates a new CertificateConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateConfig instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICertificateConfig): google.cloud.security.privateca.v1.CertificateConfig; + + /** + * Encodes the specified CertificateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.verify|verify} messages. + * @param message CertificateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICertificateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.verify|verify} messages. + * @param message CertificateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateConfig + * @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.security.privateca.v1.CertificateConfig; + + /** + * Decodes a CertificateConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateConfig + * @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.security.privateca.v1.CertificateConfig; + + /** + * Verifies a CertificateConfig 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 CertificateConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateConfig; + + /** + * Creates a plain object from a CertificateConfig message. Also converts values to other types if specified. + * @param message CertificateConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateConfig { + + /** Properties of a SubjectConfig. */ + interface ISubjectConfig { + + /** SubjectConfig subject */ + subject?: (google.cloud.security.privateca.v1.ISubject|null); + + /** SubjectConfig subjectAltName */ + subjectAltName?: (google.cloud.security.privateca.v1.ISubjectAltNames|null); + } + + /** Represents a SubjectConfig. */ + class SubjectConfig implements ISubjectConfig { + + /** + * Constructs a new SubjectConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig); + + /** SubjectConfig subject. */ + public subject?: (google.cloud.security.privateca.v1.ISubject|null); + + /** SubjectConfig subjectAltName. */ + public subjectAltName?: (google.cloud.security.privateca.v1.ISubjectAltNames|null); + + /** + * Creates a new SubjectConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SubjectConfig instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig): google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig; + + /** + * Encodes the specified SubjectConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.verify|verify} messages. + * @param message SubjectConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubjectConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.verify|verify} messages. + * @param message SubjectConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubjectConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubjectConfig + * @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.security.privateca.v1.CertificateConfig.SubjectConfig; + + /** + * Decodes a SubjectConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubjectConfig + * @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.security.privateca.v1.CertificateConfig.SubjectConfig; + + /** + * Verifies a SubjectConfig 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 SubjectConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubjectConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig; + + /** + * Creates a plain object from a SubjectConfig message. Also converts values to other types if specified. + * @param message SubjectConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubjectConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubjectConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyId. */ + interface IKeyId { + + /** KeyId keyId */ + keyId?: (string|null); + } + + /** Represents a KeyId. */ + class KeyId implements IKeyId { + + /** + * Constructs a new KeyId. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CertificateConfig.IKeyId); + + /** KeyId keyId. */ + public keyId: string; + + /** + * Creates a new KeyId instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyId instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CertificateConfig.IKeyId): google.cloud.security.privateca.v1.CertificateConfig.KeyId; + + /** + * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.KeyId.verify|verify} messages. + * @param message KeyId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CertificateConfig.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.KeyId.verify|verify} messages. + * @param message KeyId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateConfig.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyId + * @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.security.privateca.v1.CertificateConfig.KeyId; + + /** + * Decodes a KeyId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyId + * @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.security.privateca.v1.CertificateConfig.KeyId; + + /** + * Verifies a KeyId 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 KeyId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyId + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateConfig.KeyId; + + /** + * Creates a plain object from a KeyId message. Also converts values to other types if specified. + * @param message KeyId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateConfig.KeyId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CertificateDescription. */ + interface ICertificateDescription { + + /** CertificateDescription subjectDescription */ + subjectDescription?: (google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription|null); + + /** CertificateDescription x509Description */ + x509Description?: (google.cloud.security.privateca.v1.IX509Parameters|null); + + /** CertificateDescription publicKey */ + publicKey?: (google.cloud.security.privateca.v1.IPublicKey|null); + + /** CertificateDescription subjectKeyId */ + subjectKeyId?: (google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null); + + /** CertificateDescription authorityKeyId */ + authorityKeyId?: (google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null); + + /** CertificateDescription crlDistributionPoints */ + crlDistributionPoints?: (string[]|null); + + /** CertificateDescription aiaIssuingCertificateUrls */ + aiaIssuingCertificateUrls?: (string[]|null); + + /** CertificateDescription certFingerprint */ + certFingerprint?: (google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint|null); + + /** CertificateDescription tbsCertificateDigest */ + tbsCertificateDigest?: (string|null); + } + + /** Represents a CertificateDescription. */ + class CertificateDescription implements ICertificateDescription { + + /** + * Constructs a new CertificateDescription. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICertificateDescription); + + /** CertificateDescription subjectDescription. */ + public subjectDescription?: (google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription|null); + + /** CertificateDescription x509Description. */ + public x509Description?: (google.cloud.security.privateca.v1.IX509Parameters|null); + + /** CertificateDescription publicKey. */ + public publicKey?: (google.cloud.security.privateca.v1.IPublicKey|null); + + /** CertificateDescription subjectKeyId. */ + public subjectKeyId?: (google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null); + + /** CertificateDescription authorityKeyId. */ + public authorityKeyId?: (google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null); + + /** CertificateDescription crlDistributionPoints. */ + public crlDistributionPoints: string[]; + + /** CertificateDescription aiaIssuingCertificateUrls. */ + public aiaIssuingCertificateUrls: string[]; + + /** CertificateDescription certFingerprint. */ + public certFingerprint?: (google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint|null); + + /** CertificateDescription tbsCertificateDigest. */ + public tbsCertificateDigest: string; + + /** + * Creates a new CertificateDescription instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateDescription instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICertificateDescription): google.cloud.security.privateca.v1.CertificateDescription; + + /** + * Encodes the specified CertificateDescription message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.verify|verify} messages. + * @param message CertificateDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICertificateDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.verify|verify} messages. + * @param message CertificateDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateDescription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateDescription + * @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.security.privateca.v1.CertificateDescription; + + /** + * Decodes a CertificateDescription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateDescription + * @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.security.privateca.v1.CertificateDescription; + + /** + * Verifies a CertificateDescription 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 CertificateDescription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateDescription + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateDescription; + + /** + * Creates a plain object from a CertificateDescription message. Also converts values to other types if specified. + * @param message CertificateDescription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateDescription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateDescription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateDescription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateDescription { + + /** Properties of a SubjectDescription. */ + interface ISubjectDescription { + + /** SubjectDescription subject */ + subject?: (google.cloud.security.privateca.v1.ISubject|null); + + /** SubjectDescription subjectAltName */ + subjectAltName?: (google.cloud.security.privateca.v1.ISubjectAltNames|null); + + /** SubjectDescription hexSerialNumber */ + hexSerialNumber?: (string|null); + + /** SubjectDescription lifetime */ + lifetime?: (google.protobuf.IDuration|null); + + /** SubjectDescription notBeforeTime */ + notBeforeTime?: (google.protobuf.ITimestamp|null); + + /** SubjectDescription notAfterTime */ + notAfterTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SubjectDescription. */ + class SubjectDescription implements ISubjectDescription { + + /** + * Constructs a new SubjectDescription. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription); + + /** SubjectDescription subject. */ + public subject?: (google.cloud.security.privateca.v1.ISubject|null); + + /** SubjectDescription subjectAltName. */ + public subjectAltName?: (google.cloud.security.privateca.v1.ISubjectAltNames|null); + + /** SubjectDescription hexSerialNumber. */ + public hexSerialNumber: string; + + /** SubjectDescription lifetime. */ + public lifetime?: (google.protobuf.IDuration|null); + + /** SubjectDescription notBeforeTime. */ + public notBeforeTime?: (google.protobuf.ITimestamp|null); + + /** SubjectDescription notAfterTime. */ + public notAfterTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SubjectDescription instance using the specified properties. + * @param [properties] Properties to set + * @returns SubjectDescription instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription): google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription; + + /** + * Encodes the specified SubjectDescription message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.verify|verify} messages. + * @param message SubjectDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubjectDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.verify|verify} messages. + * @param message SubjectDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubjectDescription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubjectDescription + * @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.security.privateca.v1.CertificateDescription.SubjectDescription; + + /** + * Decodes a SubjectDescription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubjectDescription + * @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.security.privateca.v1.CertificateDescription.SubjectDescription; + + /** + * Verifies a SubjectDescription 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 SubjectDescription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubjectDescription + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription; + + /** + * Creates a plain object from a SubjectDescription message. Also converts values to other types if specified. + * @param message SubjectDescription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubjectDescription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubjectDescription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyId. */ + interface IKeyId { + + /** KeyId keyId */ + keyId?: (string|null); + } + + /** Represents a KeyId. */ + class KeyId implements IKeyId { + + /** + * Constructs a new KeyId. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CertificateDescription.IKeyId); + + /** KeyId keyId. */ + public keyId: string; + + /** + * Creates a new KeyId instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyId instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CertificateDescription.IKeyId): google.cloud.security.privateca.v1.CertificateDescription.KeyId; + + /** + * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify|verify} messages. + * @param message KeyId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CertificateDescription.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify|verify} messages. + * @param message KeyId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateDescription.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyId + * @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.security.privateca.v1.CertificateDescription.KeyId; + + /** + * Decodes a KeyId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyId + * @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.security.privateca.v1.CertificateDescription.KeyId; + + /** + * Verifies a KeyId 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 KeyId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyId + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateDescription.KeyId; + + /** + * Creates a plain object from a KeyId message. Also converts values to other types if specified. + * @param message KeyId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateDescription.KeyId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CertificateFingerprint. */ + interface ICertificateFingerprint { + + /** CertificateFingerprint sha256Hash */ + sha256Hash?: (string|null); + } + + /** Represents a CertificateFingerprint. */ + class CertificateFingerprint implements ICertificateFingerprint { + + /** + * Constructs a new CertificateFingerprint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint); + + /** CertificateFingerprint sha256Hash. */ + public sha256Hash: string; + + /** + * Creates a new CertificateFingerprint instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateFingerprint instance + */ + public static create(properties?: google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint): google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint; + + /** + * Encodes the specified CertificateFingerprint message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.verify|verify} messages. + * @param message CertificateFingerprint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateFingerprint message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.verify|verify} messages. + * @param message CertificateFingerprint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateFingerprint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateFingerprint + * @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.security.privateca.v1.CertificateDescription.CertificateFingerprint; + + /** + * Decodes a CertificateFingerprint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateFingerprint + * @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.security.privateca.v1.CertificateDescription.CertificateFingerprint; + + /** + * Verifies a CertificateFingerprint 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 CertificateFingerprint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateFingerprint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint; + + /** + * Creates a plain object from a CertificateFingerprint message. Also converts values to other types if specified. + * @param message CertificateFingerprint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateFingerprint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateFingerprint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ObjectId. */ + interface IObjectId { + + /** ObjectId objectIdPath */ + objectIdPath?: (number[]|null); + } + + /** Represents an ObjectId. */ + class ObjectId implements IObjectId { + + /** + * Constructs a new ObjectId. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IObjectId); + + /** ObjectId objectIdPath. */ + public objectIdPath: number[]; + + /** + * Creates a new ObjectId instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectId instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IObjectId): google.cloud.security.privateca.v1.ObjectId; + + /** + * Encodes the specified ObjectId message. Does not implicitly {@link google.cloud.security.privateca.v1.ObjectId.verify|verify} messages. + * @param message ObjectId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IObjectId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ObjectId.verify|verify} messages. + * @param message ObjectId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IObjectId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectId + * @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.security.privateca.v1.ObjectId; + + /** + * Decodes an ObjectId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectId + * @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.security.privateca.v1.ObjectId; + + /** + * Verifies an ObjectId 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 ObjectId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectId + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ObjectId; + + /** + * Creates a plain object from an ObjectId message. Also converts values to other types if specified. + * @param message ObjectId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ObjectId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a X509Extension. */ + interface IX509Extension { + + /** X509Extension objectId */ + objectId?: (google.cloud.security.privateca.v1.IObjectId|null); + + /** X509Extension critical */ + critical?: (boolean|null); + + /** X509Extension value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a X509Extension. */ + class X509Extension implements IX509Extension { + + /** + * Constructs a new X509Extension. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IX509Extension); + + /** X509Extension objectId. */ + public objectId?: (google.cloud.security.privateca.v1.IObjectId|null); + + /** X509Extension critical. */ + public critical: boolean; + + /** X509Extension value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new X509Extension instance using the specified properties. + * @param [properties] Properties to set + * @returns X509Extension instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IX509Extension): google.cloud.security.privateca.v1.X509Extension; + + /** + * Encodes the specified X509Extension message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Extension.verify|verify} messages. + * @param message X509Extension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IX509Extension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified X509Extension message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Extension.verify|verify} messages. + * @param message X509Extension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IX509Extension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a X509Extension message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns X509Extension + * @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.security.privateca.v1.X509Extension; + + /** + * Decodes a X509Extension message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns X509Extension + * @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.security.privateca.v1.X509Extension; + + /** + * Verifies a X509Extension 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 X509Extension message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns X509Extension + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.X509Extension; + + /** + * Creates a plain object from a X509Extension message. Also converts values to other types if specified. + * @param message X509Extension + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.X509Extension, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this X509Extension to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for X509Extension + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyUsage. */ + interface IKeyUsage { + + /** KeyUsage baseKeyUsage */ + baseKeyUsage?: (google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions|null); + + /** KeyUsage extendedKeyUsage */ + extendedKeyUsage?: (google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions|null); + + /** KeyUsage unknownExtendedKeyUsages */ + unknownExtendedKeyUsages?: (google.cloud.security.privateca.v1.IObjectId[]|null); + } + + /** Represents a KeyUsage. */ + class KeyUsage implements IKeyUsage { + + /** + * Constructs a new KeyUsage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IKeyUsage); + + /** KeyUsage baseKeyUsage. */ + public baseKeyUsage?: (google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions|null); + + /** KeyUsage extendedKeyUsage. */ + public extendedKeyUsage?: (google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions|null); + + /** KeyUsage unknownExtendedKeyUsages. */ + public unknownExtendedKeyUsages: google.cloud.security.privateca.v1.IObjectId[]; + + /** + * Creates a new KeyUsage instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyUsage instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IKeyUsage): google.cloud.security.privateca.v1.KeyUsage; + + /** + * Encodes the specified KeyUsage message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.verify|verify} messages. + * @param message KeyUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IKeyUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyUsage message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.verify|verify} messages. + * @param message KeyUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IKeyUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyUsage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyUsage + * @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.security.privateca.v1.KeyUsage; + + /** + * Decodes a KeyUsage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyUsage + * @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.security.privateca.v1.KeyUsage; + + /** + * Verifies a KeyUsage 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 KeyUsage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyUsage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.KeyUsage; + + /** + * Creates a plain object from a KeyUsage message. Also converts values to other types if specified. + * @param message KeyUsage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.KeyUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyUsage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyUsage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace KeyUsage { + + /** Properties of a KeyUsageOptions. */ + interface IKeyUsageOptions { + + /** KeyUsageOptions digitalSignature */ + digitalSignature?: (boolean|null); + + /** KeyUsageOptions contentCommitment */ + contentCommitment?: (boolean|null); + + /** KeyUsageOptions keyEncipherment */ + keyEncipherment?: (boolean|null); + + /** KeyUsageOptions dataEncipherment */ + dataEncipherment?: (boolean|null); + + /** KeyUsageOptions keyAgreement */ + keyAgreement?: (boolean|null); + + /** KeyUsageOptions certSign */ + certSign?: (boolean|null); + + /** KeyUsageOptions crlSign */ + crlSign?: (boolean|null); + + /** KeyUsageOptions encipherOnly */ + encipherOnly?: (boolean|null); + + /** KeyUsageOptions decipherOnly */ + decipherOnly?: (boolean|null); + } + + /** Represents a KeyUsageOptions. */ + class KeyUsageOptions implements IKeyUsageOptions { + + /** + * Constructs a new KeyUsageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions); + + /** KeyUsageOptions digitalSignature. */ + public digitalSignature: boolean; + + /** KeyUsageOptions contentCommitment. */ + public contentCommitment: boolean; + + /** KeyUsageOptions keyEncipherment. */ + public keyEncipherment: boolean; + + /** KeyUsageOptions dataEncipherment. */ + public dataEncipherment: boolean; + + /** KeyUsageOptions keyAgreement. */ + public keyAgreement: boolean; + + /** KeyUsageOptions certSign. */ + public certSign: boolean; + + /** KeyUsageOptions crlSign. */ + public crlSign: boolean; + + /** KeyUsageOptions encipherOnly. */ + public encipherOnly: boolean; + + /** KeyUsageOptions decipherOnly. */ + public decipherOnly: boolean; + + /** + * Creates a new KeyUsageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyUsageOptions instance + */ + public static create(properties?: google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions): google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions; + + /** + * Encodes the specified KeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.verify|verify} messages. + * @param message KeyUsageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.verify|verify} messages. + * @param message KeyUsageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyUsageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyUsageOptions + * @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.security.privateca.v1.KeyUsage.KeyUsageOptions; + + /** + * Decodes a KeyUsageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyUsageOptions + * @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.security.privateca.v1.KeyUsage.KeyUsageOptions; + + /** + * Verifies a KeyUsageOptions 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 KeyUsageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyUsageOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions; + + /** + * Creates a plain object from a KeyUsageOptions message. Also converts values to other types if specified. + * @param message KeyUsageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyUsageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyUsageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExtendedKeyUsageOptions. */ + interface IExtendedKeyUsageOptions { + + /** ExtendedKeyUsageOptions serverAuth */ + serverAuth?: (boolean|null); + + /** ExtendedKeyUsageOptions clientAuth */ + clientAuth?: (boolean|null); + + /** ExtendedKeyUsageOptions codeSigning */ + codeSigning?: (boolean|null); + + /** ExtendedKeyUsageOptions emailProtection */ + emailProtection?: (boolean|null); + + /** ExtendedKeyUsageOptions timeStamping */ + timeStamping?: (boolean|null); + + /** ExtendedKeyUsageOptions ocspSigning */ + ocspSigning?: (boolean|null); + } + + /** Represents an ExtendedKeyUsageOptions. */ + class ExtendedKeyUsageOptions implements IExtendedKeyUsageOptions { + + /** + * Constructs a new ExtendedKeyUsageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions); + + /** ExtendedKeyUsageOptions serverAuth. */ + public serverAuth: boolean; + + /** ExtendedKeyUsageOptions clientAuth. */ + public clientAuth: boolean; + + /** ExtendedKeyUsageOptions codeSigning. */ + public codeSigning: boolean; + + /** ExtendedKeyUsageOptions emailProtection. */ + public emailProtection: boolean; + + /** ExtendedKeyUsageOptions timeStamping. */ + public timeStamping: boolean; + + /** ExtendedKeyUsageOptions ocspSigning. */ + public ocspSigning: boolean; + + /** + * Creates a new ExtendedKeyUsageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtendedKeyUsageOptions instance + */ + public static create(properties?: google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions): google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions; + + /** + * Encodes the specified ExtendedKeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. + * @param message ExtendedKeyUsageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtendedKeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. + * @param message ExtendedKeyUsageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtendedKeyUsageOptions + * @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.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions; + + /** + * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtendedKeyUsageOptions + * @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.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions; + + /** + * Verifies an ExtendedKeyUsageOptions 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 ExtendedKeyUsageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtendedKeyUsageOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions; + + /** + * Creates a plain object from an ExtendedKeyUsageOptions message. Also converts values to other types if specified. + * @param message ExtendedKeyUsageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtendedKeyUsageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtendedKeyUsageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AttributeTypeAndValue. */ + interface IAttributeTypeAndValue { + + /** AttributeTypeAndValue type */ + type?: (google.cloud.security.privateca.v1.AttributeType|keyof typeof google.cloud.security.privateca.v1.AttributeType|null); + + /** AttributeTypeAndValue objectId */ + objectId?: (google.cloud.security.privateca.v1.IObjectId|null); + + /** AttributeTypeAndValue value */ + value?: (string|null); + } + + /** Represents an AttributeTypeAndValue. */ + class AttributeTypeAndValue implements IAttributeTypeAndValue { + + /** + * Constructs a new AttributeTypeAndValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IAttributeTypeAndValue); + + /** AttributeTypeAndValue type. */ + public type?: (google.cloud.security.privateca.v1.AttributeType|keyof typeof google.cloud.security.privateca.v1.AttributeType|null); + + /** AttributeTypeAndValue objectId. */ + public objectId?: (google.cloud.security.privateca.v1.IObjectId|null); + + /** AttributeTypeAndValue value. */ + public value: string; + + /** AttributeTypeAndValue attributeType. */ + public attributeType?: ("type"|"objectId"); + + /** + * Creates a new AttributeTypeAndValue instance using the specified properties. + * @param [properties] Properties to set + * @returns AttributeTypeAndValue instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IAttributeTypeAndValue): google.cloud.security.privateca.v1.AttributeTypeAndValue; + + /** + * Encodes the specified AttributeTypeAndValue message. Does not implicitly {@link google.cloud.security.privateca.v1.AttributeTypeAndValue.verify|verify} messages. + * @param message AttributeTypeAndValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IAttributeTypeAndValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttributeTypeAndValue message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.AttributeTypeAndValue.verify|verify} messages. + * @param message AttributeTypeAndValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IAttributeTypeAndValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttributeTypeAndValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttributeTypeAndValue + * @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.security.privateca.v1.AttributeTypeAndValue; + + /** + * Decodes an AttributeTypeAndValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttributeTypeAndValue + * @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.security.privateca.v1.AttributeTypeAndValue; + + /** + * Verifies an AttributeTypeAndValue 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 AttributeTypeAndValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttributeTypeAndValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.AttributeTypeAndValue; + + /** + * Creates a plain object from an AttributeTypeAndValue message. Also converts values to other types if specified. + * @param message AttributeTypeAndValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.AttributeTypeAndValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttributeTypeAndValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttributeTypeAndValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RelativeDistinguishedName. */ + interface IRelativeDistinguishedName { + + /** RelativeDistinguishedName attributes */ + attributes?: (google.cloud.security.privateca.v1.IAttributeTypeAndValue[]|null); + } + + /** Represents a RelativeDistinguishedName. */ + class RelativeDistinguishedName implements IRelativeDistinguishedName { + + /** + * Constructs a new RelativeDistinguishedName. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IRelativeDistinguishedName); + + /** RelativeDistinguishedName attributes. */ + public attributes: google.cloud.security.privateca.v1.IAttributeTypeAndValue[]; + + /** + * Creates a new RelativeDistinguishedName instance using the specified properties. + * @param [properties] Properties to set + * @returns RelativeDistinguishedName instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IRelativeDistinguishedName): google.cloud.security.privateca.v1.RelativeDistinguishedName; + + /** + * Encodes the specified RelativeDistinguishedName message. Does not implicitly {@link google.cloud.security.privateca.v1.RelativeDistinguishedName.verify|verify} messages. + * @param message RelativeDistinguishedName message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IRelativeDistinguishedName, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelativeDistinguishedName message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.RelativeDistinguishedName.verify|verify} messages. + * @param message RelativeDistinguishedName message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IRelativeDistinguishedName, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelativeDistinguishedName message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelativeDistinguishedName + * @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.security.privateca.v1.RelativeDistinguishedName; + + /** + * Decodes a RelativeDistinguishedName message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelativeDistinguishedName + * @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.security.privateca.v1.RelativeDistinguishedName; + + /** + * Verifies a RelativeDistinguishedName 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 RelativeDistinguishedName message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelativeDistinguishedName + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.RelativeDistinguishedName; + + /** + * Creates a plain object from a RelativeDistinguishedName message. Also converts values to other types if specified. + * @param message RelativeDistinguishedName + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.RelativeDistinguishedName, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelativeDistinguishedName to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelativeDistinguishedName + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Subject. */ + interface ISubject { + + /** Subject commonName */ + commonName?: (string|null); + + /** Subject countryCode */ + countryCode?: (string|null); + + /** Subject organization */ + organization?: (string|null); + + /** Subject organizationalUnit */ + organizationalUnit?: (string|null); + + /** Subject locality */ + locality?: (string|null); + + /** Subject province */ + province?: (string|null); + + /** Subject streetAddress */ + streetAddress?: (string|null); + + /** Subject postalCode */ + postalCode?: (string|null); + + /** Subject rdnSequence */ + rdnSequence?: (google.cloud.security.privateca.v1.IRelativeDistinguishedName[]|null); + } + + /** Represents a Subject. */ + class Subject implements ISubject { + + /** + * Constructs a new Subject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ISubject); + + /** Subject commonName. */ + public commonName: string; + + /** Subject countryCode. */ + public countryCode: string; + + /** Subject organization. */ + public organization: string; + + /** Subject organizationalUnit. */ + public organizationalUnit: string; + + /** Subject locality. */ + public locality: string; + + /** Subject province. */ + public province: string; + + /** Subject streetAddress. */ + public streetAddress: string; + + /** Subject postalCode. */ + public postalCode: string; + + /** Subject rdnSequence. */ + public rdnSequence: google.cloud.security.privateca.v1.IRelativeDistinguishedName[]; + + /** + * Creates a new Subject instance using the specified properties. + * @param [properties] Properties to set + * @returns Subject instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ISubject): google.cloud.security.privateca.v1.Subject; + + /** + * Encodes the specified Subject message. Does not implicitly {@link google.cloud.security.privateca.v1.Subject.verify|verify} messages. + * @param message Subject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Subject.verify|verify} messages. + * @param message Subject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Subject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Subject + * @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.security.privateca.v1.Subject; + + /** + * Decodes a Subject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Subject + * @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.security.privateca.v1.Subject; + + /** + * Verifies a Subject 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 Subject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Subject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.Subject; + + /** + * Creates a plain object from a Subject message. Also converts values to other types if specified. + * @param message Subject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.Subject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Subject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Subject + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubjectAltNames. */ + interface ISubjectAltNames { + + /** SubjectAltNames dnsNames */ + dnsNames?: (string[]|null); + + /** SubjectAltNames uris */ + uris?: (string[]|null); + + /** SubjectAltNames emailAddresses */ + emailAddresses?: (string[]|null); + + /** SubjectAltNames ipAddresses */ + ipAddresses?: (string[]|null); + + /** SubjectAltNames customSans */ + customSans?: (google.cloud.security.privateca.v1.IX509Extension[]|null); + } + + /** Represents a SubjectAltNames. */ + class SubjectAltNames implements ISubjectAltNames { + + /** + * Constructs a new SubjectAltNames. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ISubjectAltNames); + + /** SubjectAltNames dnsNames. */ + public dnsNames: string[]; + + /** SubjectAltNames uris. */ + public uris: string[]; + + /** SubjectAltNames emailAddresses. */ + public emailAddresses: string[]; + + /** SubjectAltNames ipAddresses. */ + public ipAddresses: string[]; + + /** SubjectAltNames customSans. */ + public customSans: google.cloud.security.privateca.v1.IX509Extension[]; + + /** + * Creates a new SubjectAltNames instance using the specified properties. + * @param [properties] Properties to set + * @returns SubjectAltNames instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ISubjectAltNames): google.cloud.security.privateca.v1.SubjectAltNames; + + /** + * Encodes the specified SubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1.SubjectAltNames.verify|verify} messages. + * @param message SubjectAltNames message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ISubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubjectAltNames.verify|verify} messages. + * @param message SubjectAltNames message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ISubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubjectAltNames message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubjectAltNames + * @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.security.privateca.v1.SubjectAltNames; + + /** + * Decodes a SubjectAltNames message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubjectAltNames + * @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.security.privateca.v1.SubjectAltNames; + + /** + * Verifies a SubjectAltNames 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 SubjectAltNames message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubjectAltNames + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.SubjectAltNames; + + /** + * Creates a plain object from a SubjectAltNames message. Also converts values to other types if specified. + * @param message SubjectAltNames + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.SubjectAltNames, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubjectAltNames to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubjectAltNames + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CertificateIdentityConstraints. */ + interface ICertificateIdentityConstraints { + + /** CertificateIdentityConstraints celExpression */ + celExpression?: (google.type.IExpr|null); + + /** CertificateIdentityConstraints allowSubjectPassthrough */ + allowSubjectPassthrough?: (boolean|null); + + /** CertificateIdentityConstraints allowSubjectAltNamesPassthrough */ + allowSubjectAltNamesPassthrough?: (boolean|null); + } + + /** Represents a CertificateIdentityConstraints. */ + class CertificateIdentityConstraints implements ICertificateIdentityConstraints { + + /** + * Constructs a new CertificateIdentityConstraints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICertificateIdentityConstraints); + + /** CertificateIdentityConstraints celExpression. */ + public celExpression?: (google.type.IExpr|null); + + /** CertificateIdentityConstraints allowSubjectPassthrough. */ + public allowSubjectPassthrough?: (boolean|null); + + /** CertificateIdentityConstraints allowSubjectAltNamesPassthrough. */ + public allowSubjectAltNamesPassthrough?: (boolean|null); + + /** + * Creates a new CertificateIdentityConstraints instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateIdentityConstraints instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICertificateIdentityConstraints): google.cloud.security.privateca.v1.CertificateIdentityConstraints; + + /** + * Encodes the specified CertificateIdentityConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify|verify} messages. + * @param message CertificateIdentityConstraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICertificateIdentityConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateIdentityConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify|verify} messages. + * @param message CertificateIdentityConstraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateIdentityConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateIdentityConstraints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateIdentityConstraints + * @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.security.privateca.v1.CertificateIdentityConstraints; + + /** + * Decodes a CertificateIdentityConstraints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateIdentityConstraints + * @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.security.privateca.v1.CertificateIdentityConstraints; + + /** + * Verifies a CertificateIdentityConstraints 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 CertificateIdentityConstraints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateIdentityConstraints + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateIdentityConstraints; + + /** + * Creates a plain object from a CertificateIdentityConstraints message. Also converts values to other types if specified. + * @param message CertificateIdentityConstraints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateIdentityConstraints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateIdentityConstraints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateIdentityConstraints + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CertificateExtensionConstraints. */ + interface ICertificateExtensionConstraints { + + /** CertificateExtensionConstraints knownExtensions */ + knownExtensions?: (google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension[]|null); + + /** CertificateExtensionConstraints additionalExtensions */ + additionalExtensions?: (google.cloud.security.privateca.v1.IObjectId[]|null); + } + + /** Represents a CertificateExtensionConstraints. */ + class CertificateExtensionConstraints implements ICertificateExtensionConstraints { + + /** + * Constructs a new CertificateExtensionConstraints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICertificateExtensionConstraints); + + /** CertificateExtensionConstraints knownExtensions. */ + public knownExtensions: google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension[]; + + /** CertificateExtensionConstraints additionalExtensions. */ + public additionalExtensions: google.cloud.security.privateca.v1.IObjectId[]; + + /** + * Creates a new CertificateExtensionConstraints instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateExtensionConstraints instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICertificateExtensionConstraints): google.cloud.security.privateca.v1.CertificateExtensionConstraints; + + /** + * Encodes the specified CertificateExtensionConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify|verify} messages. + * @param message CertificateExtensionConstraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICertificateExtensionConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateExtensionConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify|verify} messages. + * @param message CertificateExtensionConstraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateExtensionConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateExtensionConstraints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateExtensionConstraints + * @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.security.privateca.v1.CertificateExtensionConstraints; + + /** + * Decodes a CertificateExtensionConstraints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateExtensionConstraints + * @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.security.privateca.v1.CertificateExtensionConstraints; + + /** + * Verifies a CertificateExtensionConstraints 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 CertificateExtensionConstraints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateExtensionConstraints + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateExtensionConstraints; + + /** + * Creates a plain object from a CertificateExtensionConstraints message. Also converts values to other types if specified. + * @param message CertificateExtensionConstraints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CertificateExtensionConstraints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateExtensionConstraints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateExtensionConstraints + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateExtensionConstraints { + + /** KnownCertificateExtension enum. */ + enum KnownCertificateExtension { + KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED = 0, + BASE_KEY_USAGE = 1, + EXTENDED_KEY_USAGE = 2, + CA_OPTIONS = 3, + POLICY_IDS = 4, + AIA_OCSP_SERVERS = 5, + NAME_CONSTRAINTS = 6 + } + } + + /** AttributeType enum. */ + enum AttributeType { + ATTRIBUTE_TYPE_UNSPECIFIED = 0, + COMMON_NAME = 1, + COUNTRY_CODE = 2, + ORGANIZATION = 3, + ORGANIZATIONAL_UNIT = 4, + LOCALITY = 5, + PROVINCE = 6, + STREET_ADDRESS = 7, + POSTAL_CODE = 8 + } + + /** RevocationReason enum. */ + enum RevocationReason { + REVOCATION_REASON_UNSPECIFIED = 0, + KEY_COMPROMISE = 1, + CERTIFICATE_AUTHORITY_COMPROMISE = 2, + AFFILIATION_CHANGED = 3, + SUPERSEDED = 4, + CESSATION_OF_OPERATION = 5, + CERTIFICATE_HOLD = 6, + PRIVILEGE_WITHDRAWN = 7, + ATTRIBUTE_AUTHORITY_COMPROMISE = 8 + } + + /** SubjectRequestMode enum. */ + enum SubjectRequestMode { + SUBJECT_REQUEST_MODE_UNSPECIFIED = 0, + DEFAULT = 1, + RDN_SEQUENCE = 3, + REFLECTED_SPIFFE = 2 + } + + /** Represents a CertificateAuthorityService */ + class CertificateAuthorityService extends $protobuf.rpc.Service { + + /** + * Constructs a new CertificateAuthorityService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new CertificateAuthorityService 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): CertificateAuthorityService; + + /** + * Calls CreateCertificate. + * @param request CreateCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Certificate + */ + public createCertificate(request: google.cloud.security.privateca.v1.ICreateCertificateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateCallback): void; + + /** + * Calls CreateCertificate. + * @param request CreateCertificateRequest message or plain object + * @returns Promise + */ + public createCertificate(request: google.cloud.security.privateca.v1.ICreateCertificateRequest): Promise; + + /** + * Calls GetCertificate. + * @param request GetCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Certificate + */ + public getCertificate(request: google.cloud.security.privateca.v1.IGetCertificateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateCallback): void; + + /** + * Calls GetCertificate. + * @param request GetCertificateRequest message or plain object + * @returns Promise + */ + public getCertificate(request: google.cloud.security.privateca.v1.IGetCertificateRequest): Promise; + + /** + * Calls ListCertificates. + * @param request ListCertificatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCertificatesResponse + */ + public listCertificates(request: google.cloud.security.privateca.v1.IListCertificatesRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificatesCallback): void; + + /** + * Calls ListCertificates. + * @param request ListCertificatesRequest message or plain object + * @returns Promise + */ + public listCertificates(request: google.cloud.security.privateca.v1.IListCertificatesRequest): Promise; + + /** + * Calls RevokeCertificate. + * @param request RevokeCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Certificate + */ + public revokeCertificate(request: google.cloud.security.privateca.v1.IRevokeCertificateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificateCallback): void; + + /** + * Calls RevokeCertificate. + * @param request RevokeCertificateRequest message or plain object + * @returns Promise + */ + public revokeCertificate(request: google.cloud.security.privateca.v1.IRevokeCertificateRequest): Promise; + + /** + * Calls UpdateCertificate. + * @param request UpdateCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Certificate + */ + public updateCertificate(request: google.cloud.security.privateca.v1.IUpdateCertificateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateCallback): void; + + /** + * Calls UpdateCertificate. + * @param request UpdateCertificateRequest message or plain object + * @returns Promise + */ + public updateCertificate(request: google.cloud.security.privateca.v1.IUpdateCertificateRequest): Promise; + + /** + * Calls ActivateCertificateAuthority. + * @param request ActivateCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public activateCertificateAuthority(request: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthorityCallback): void; + + /** + * Calls ActivateCertificateAuthority. + * @param request ActivateCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public activateCertificateAuthority(request: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest): Promise; + + /** + * Calls CreateCertificateAuthority. + * @param request CreateCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCertificateAuthority(request: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthorityCallback): void; + + /** + * Calls CreateCertificateAuthority. + * @param request CreateCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public createCertificateAuthority(request: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest): Promise; + + /** + * Calls DisableCertificateAuthority. + * @param request DisableCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public disableCertificateAuthority(request: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthorityCallback): void; + + /** + * Calls DisableCertificateAuthority. + * @param request DisableCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public disableCertificateAuthority(request: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest): Promise; + + /** + * Calls EnableCertificateAuthority. + * @param request EnableCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public enableCertificateAuthority(request: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthorityCallback): void; + + /** + * Calls EnableCertificateAuthority. + * @param request EnableCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public enableCertificateAuthority(request: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest): Promise; + + /** + * Calls FetchCertificateAuthorityCsr. + * @param request FetchCertificateAuthorityCsrRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchCertificateAuthorityCsrResponse + */ + public fetchCertificateAuthorityCsr(request: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsrCallback): void; + + /** + * Calls FetchCertificateAuthorityCsr. + * @param request FetchCertificateAuthorityCsrRequest message or plain object + * @returns Promise + */ + public fetchCertificateAuthorityCsr(request: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest): Promise; + + /** + * Calls GetCertificateAuthority. + * @param request GetCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CertificateAuthority + */ + public getCertificateAuthority(request: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthorityCallback): void; + + /** + * Calls GetCertificateAuthority. + * @param request GetCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public getCertificateAuthority(request: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest): Promise; + + /** + * Calls ListCertificateAuthorities. + * @param request ListCertificateAuthoritiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCertificateAuthoritiesResponse + */ + public listCertificateAuthorities(request: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthoritiesCallback): void; + + /** + * Calls ListCertificateAuthorities. + * @param request ListCertificateAuthoritiesRequest message or plain object + * @returns Promise + */ + public listCertificateAuthorities(request: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest): Promise; + + /** + * Calls UndeleteCertificateAuthority. + * @param request UndeleteCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeleteCertificateAuthority(request: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthorityCallback): void; + + /** + * Calls UndeleteCertificateAuthority. + * @param request UndeleteCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public undeleteCertificateAuthority(request: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest): Promise; + + /** + * Calls DeleteCertificateAuthority. + * @param request DeleteCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCertificateAuthority(request: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthorityCallback): void; + + /** + * Calls DeleteCertificateAuthority. + * @param request DeleteCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public deleteCertificateAuthority(request: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest): Promise; + + /** + * Calls UpdateCertificateAuthority. + * @param request UpdateCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCertificateAuthority(request: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthorityCallback): void; + + /** + * Calls UpdateCertificateAuthority. + * @param request UpdateCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public updateCertificateAuthority(request: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest): Promise; + + /** + * Calls CreateCaPool. + * @param request CreateCaPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCaPool(request: google.cloud.security.privateca.v1.ICreateCaPoolRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPoolCallback): void; + + /** + * Calls CreateCaPool. + * @param request CreateCaPoolRequest message or plain object + * @returns Promise + */ + public createCaPool(request: google.cloud.security.privateca.v1.ICreateCaPoolRequest): Promise; + + /** + * Calls UpdateCaPool. + * @param request UpdateCaPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCaPool(request: google.cloud.security.privateca.v1.IUpdateCaPoolRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPoolCallback): void; + + /** + * Calls UpdateCaPool. + * @param request UpdateCaPoolRequest message or plain object + * @returns Promise + */ + public updateCaPool(request: google.cloud.security.privateca.v1.IUpdateCaPoolRequest): Promise; + + /** + * Calls GetCaPool. + * @param request GetCaPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CaPool + */ + public getCaPool(request: google.cloud.security.privateca.v1.IGetCaPoolRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPoolCallback): void; + + /** + * Calls GetCaPool. + * @param request GetCaPoolRequest message or plain object + * @returns Promise + */ + public getCaPool(request: google.cloud.security.privateca.v1.IGetCaPoolRequest): Promise; + + /** + * Calls ListCaPools. + * @param request ListCaPoolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCaPoolsResponse + */ + public listCaPools(request: google.cloud.security.privateca.v1.IListCaPoolsRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPoolsCallback): void; + + /** + * Calls ListCaPools. + * @param request ListCaPoolsRequest message or plain object + * @returns Promise + */ + public listCaPools(request: google.cloud.security.privateca.v1.IListCaPoolsRequest): Promise; + + /** + * Calls DeleteCaPool. + * @param request DeleteCaPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCaPool(request: google.cloud.security.privateca.v1.IDeleteCaPoolRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPoolCallback): void; + + /** + * Calls DeleteCaPool. + * @param request DeleteCaPoolRequest message or plain object + * @returns Promise + */ + public deleteCaPool(request: google.cloud.security.privateca.v1.IDeleteCaPoolRequest): Promise; + + /** + * Calls FetchCaCerts. + * @param request FetchCaCertsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchCaCertsResponse + */ + public fetchCaCerts(request: google.cloud.security.privateca.v1.IFetchCaCertsRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCertsCallback): void; + + /** + * Calls FetchCaCerts. + * @param request FetchCaCertsRequest message or plain object + * @returns Promise + */ + public fetchCaCerts(request: google.cloud.security.privateca.v1.IFetchCaCertsRequest): Promise; + + /** + * Calls GetCertificateRevocationList. + * @param request GetCertificateRevocationListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CertificateRevocationList + */ + public getCertificateRevocationList(request: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationListCallback): void; + + /** + * Calls GetCertificateRevocationList. + * @param request GetCertificateRevocationListRequest message or plain object + * @returns Promise + */ + public getCertificateRevocationList(request: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest): Promise; + + /** + * Calls ListCertificateRevocationLists. + * @param request ListCertificateRevocationListsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCertificateRevocationListsResponse + */ + public listCertificateRevocationLists(request: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationListsCallback): void; + + /** + * Calls ListCertificateRevocationLists. + * @param request ListCertificateRevocationListsRequest message or plain object + * @returns Promise + */ + public listCertificateRevocationLists(request: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest): Promise; + + /** + * Calls UpdateCertificateRevocationList. + * @param request UpdateCertificateRevocationListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCertificateRevocationList(request: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationListCallback): void; + + /** + * Calls UpdateCertificateRevocationList. + * @param request UpdateCertificateRevocationListRequest message or plain object + * @returns Promise + */ + public updateCertificateRevocationList(request: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest): Promise; + + /** + * Calls CreateCertificateTemplate. + * @param request CreateCertificateTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCertificateTemplate(request: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplateCallback): void; + + /** + * Calls CreateCertificateTemplate. + * @param request CreateCertificateTemplateRequest message or plain object + * @returns Promise + */ + public createCertificateTemplate(request: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest): Promise; + + /** + * Calls DeleteCertificateTemplate. + * @param request DeleteCertificateTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCertificateTemplate(request: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplateCallback): void; + + /** + * Calls DeleteCertificateTemplate. + * @param request DeleteCertificateTemplateRequest message or plain object + * @returns Promise + */ + public deleteCertificateTemplate(request: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest): Promise; + + /** + * Calls GetCertificateTemplate. + * @param request GetCertificateTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CertificateTemplate + */ + public getCertificateTemplate(request: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplateCallback): void; + + /** + * Calls GetCertificateTemplate. + * @param request GetCertificateTemplateRequest message or plain object + * @returns Promise + */ + public getCertificateTemplate(request: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest): Promise; + + /** + * Calls ListCertificateTemplates. + * @param request ListCertificateTemplatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCertificateTemplatesResponse + */ + public listCertificateTemplates(request: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplatesCallback): void; + + /** + * Calls ListCertificateTemplates. + * @param request ListCertificateTemplatesRequest message or plain object + * @returns Promise + */ + public listCertificateTemplates(request: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest): Promise; + + /** + * Calls UpdateCertificateTemplate. + * @param request UpdateCertificateTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCertificateTemplate(request: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplateCallback): void; + + /** + * Calls UpdateCertificateTemplate. + * @param request UpdateCertificateTemplateRequest message or plain object + * @returns Promise + */ + public updateCertificateTemplate(request: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest): Promise; + } + + namespace CertificateAuthorityService { + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificate}. + * @param error Error, if any + * @param [response] Certificate + */ + type CreateCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.Certificate) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificate}. + * @param error Error, if any + * @param [response] Certificate + */ + type GetCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.Certificate) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificates}. + * @param error Error, if any + * @param [response] ListCertificatesResponse + */ + type ListCertificatesCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.ListCertificatesResponse) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|revokeCertificate}. + * @param error Error, if any + * @param [response] Certificate + */ + type RevokeCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.Certificate) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificate}. + * @param error Error, if any + * @param [response] Certificate + */ + type UpdateCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.Certificate) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|activateCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type ActivateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|disableCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type DisableCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|enableCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type EnableCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|fetchCertificateAuthorityCsr}. + * @param error Error, if any + * @param [response] FetchCertificateAuthorityCsrResponse + */ + type FetchCertificateAuthorityCsrCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateAuthority}. + * @param error Error, if any + * @param [response] CertificateAuthority + */ + type GetCertificateAuthorityCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.CertificateAuthority) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateAuthorities}. + * @param error Error, if any + * @param [response] ListCertificateAuthoritiesResponse + */ + type ListCertificateAuthoritiesCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|undeleteCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeleteCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCaPool}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCaPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCaPool}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCaPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCaPool}. + * @param error Error, if any + * @param [response] CaPool + */ + type GetCaPoolCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.CaPool) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCaPools}. + * @param error Error, if any + * @param [response] ListCaPoolsResponse + */ + type ListCaPoolsCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.ListCaPoolsResponse) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCaPool}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCaPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|fetchCaCerts}. + * @param error Error, if any + * @param [response] FetchCaCertsResponse + */ + type FetchCaCertsCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.FetchCaCertsResponse) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateRevocationList}. + * @param error Error, if any + * @param [response] CertificateRevocationList + */ + type GetCertificateRevocationListCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.CertificateRevocationList) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateRevocationLists}. + * @param error Error, if any + * @param [response] ListCertificateRevocationListsResponse + */ + type ListCertificateRevocationListsCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateRevocationList}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCertificateRevocationListCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificateTemplate}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCertificateTemplateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCertificateTemplate}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCertificateTemplateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateTemplate}. + * @param error Error, if any + * @param [response] CertificateTemplate + */ + type GetCertificateTemplateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.CertificateTemplate) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateTemplates}. + * @param error Error, if any + * @param [response] ListCertificateTemplatesResponse + */ + type ListCertificateTemplatesCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.ListCertificateTemplatesResponse) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateTemplate}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCertificateTemplateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a CreateCertificateRequest. */ + interface ICreateCertificateRequest { + + /** CreateCertificateRequest parent */ + parent?: (string|null); + + /** CreateCertificateRequest certificateId */ + certificateId?: (string|null); + + /** CreateCertificateRequest certificate */ + certificate?: (google.cloud.security.privateca.v1.ICertificate|null); + + /** CreateCertificateRequest requestId */ + requestId?: (string|null); + + /** CreateCertificateRequest validateOnly */ + validateOnly?: (boolean|null); + + /** CreateCertificateRequest issuingCertificateAuthorityId */ + issuingCertificateAuthorityId?: (string|null); + } + + /** Represents a CreateCertificateRequest. */ + class CreateCertificateRequest implements ICreateCertificateRequest { + + /** + * Constructs a new CreateCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICreateCertificateRequest); + + /** CreateCertificateRequest parent. */ + public parent: string; + + /** CreateCertificateRequest certificateId. */ + public certificateId: string; + + /** CreateCertificateRequest certificate. */ + public certificate?: (google.cloud.security.privateca.v1.ICertificate|null); + + /** CreateCertificateRequest requestId. */ + public requestId: string; + + /** CreateCertificateRequest validateOnly. */ + public validateOnly: boolean; + + /** CreateCertificateRequest issuingCertificateAuthorityId. */ + public issuingCertificateAuthorityId: string; + + /** + * Creates a new CreateCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCertificateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICreateCertificateRequest): google.cloud.security.privateca.v1.CreateCertificateRequest; + + /** + * Encodes the specified CreateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateRequest.verify|verify} messages. + * @param message CreateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICreateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateRequest.verify|verify} messages. + * @param message CreateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICreateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCertificateRequest + * @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.security.privateca.v1.CreateCertificateRequest; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCertificateRequest + * @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.security.privateca.v1.CreateCertificateRequest; + + /** + * Verifies a CreateCertificateRequest 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 CreateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CreateCertificateRequest; + + /** + * Creates a plain object from a CreateCertificateRequest message. Also converts values to other types if specified. + * @param message CreateCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CreateCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCertificateRequest. */ + interface IGetCertificateRequest { + + /** GetCertificateRequest name */ + name?: (string|null); + } + + /** Represents a GetCertificateRequest. */ + class GetCertificateRequest implements IGetCertificateRequest { + + /** + * Constructs a new GetCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IGetCertificateRequest); + + /** GetCertificateRequest name. */ + public name: string; + + /** + * Creates a new GetCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCertificateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IGetCertificateRequest): google.cloud.security.privateca.v1.GetCertificateRequest; + + /** + * Encodes the specified GetCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRequest.verify|verify} messages. + * @param message GetCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IGetCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRequest.verify|verify} messages. + * @param message GetCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IGetCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCertificateRequest + * @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.security.privateca.v1.GetCertificateRequest; + + /** + * Decodes a GetCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCertificateRequest + * @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.security.privateca.v1.GetCertificateRequest; + + /** + * Verifies a GetCertificateRequest 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 GetCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.GetCertificateRequest; + + /** + * Creates a plain object from a GetCertificateRequest message. Also converts values to other types if specified. + * @param message GetCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.GetCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificatesRequest. */ + interface IListCertificatesRequest { + + /** ListCertificatesRequest parent */ + parent?: (string|null); + + /** ListCertificatesRequest pageSize */ + pageSize?: (number|null); + + /** ListCertificatesRequest pageToken */ + pageToken?: (string|null); + + /** ListCertificatesRequest filter */ + filter?: (string|null); + + /** ListCertificatesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCertificatesRequest. */ + class ListCertificatesRequest implements IListCertificatesRequest { + + /** + * Constructs a new ListCertificatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IListCertificatesRequest); + + /** ListCertificatesRequest parent. */ + public parent: string; + + /** ListCertificatesRequest pageSize. */ + public pageSize: number; + + /** ListCertificatesRequest pageToken. */ + public pageToken: string; + + /** ListCertificatesRequest filter. */ + public filter: string; + + /** ListCertificatesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCertificatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificatesRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IListCertificatesRequest): google.cloud.security.privateca.v1.ListCertificatesRequest; + + /** + * Encodes the specified ListCertificatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesRequest.verify|verify} messages. + * @param message ListCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IListCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesRequest.verify|verify} messages. + * @param message ListCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificatesRequest + * @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.security.privateca.v1.ListCertificatesRequest; + + /** + * Decodes a ListCertificatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificatesRequest + * @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.security.privateca.v1.ListCertificatesRequest; + + /** + * Verifies a ListCertificatesRequest 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 ListCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificatesRequest; + + /** + * Creates a plain object from a ListCertificatesRequest message. Also converts values to other types if specified. + * @param message ListCertificatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ListCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificatesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificatesResponse. */ + interface IListCertificatesResponse { + + /** ListCertificatesResponse certificates */ + certificates?: (google.cloud.security.privateca.v1.ICertificate[]|null); + + /** ListCertificatesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCertificatesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCertificatesResponse. */ + class ListCertificatesResponse implements IListCertificatesResponse { + + /** + * Constructs a new ListCertificatesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IListCertificatesResponse); + + /** ListCertificatesResponse certificates. */ + public certificates: google.cloud.security.privateca.v1.ICertificate[]; + + /** ListCertificatesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCertificatesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCertificatesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificatesResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IListCertificatesResponse): google.cloud.security.privateca.v1.ListCertificatesResponse; + + /** + * Encodes the specified ListCertificatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesResponse.verify|verify} messages. + * @param message ListCertificatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IListCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesResponse.verify|verify} messages. + * @param message ListCertificatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificatesResponse + * @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.security.privateca.v1.ListCertificatesResponse; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificatesResponse + * @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.security.privateca.v1.ListCertificatesResponse; + + /** + * Verifies a ListCertificatesResponse 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 ListCertificatesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificatesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificatesResponse; + + /** + * Creates a plain object from a ListCertificatesResponse message. Also converts values to other types if specified. + * @param message ListCertificatesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ListCertificatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificatesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificatesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RevokeCertificateRequest. */ + interface IRevokeCertificateRequest { + + /** RevokeCertificateRequest name */ + name?: (string|null); + + /** RevokeCertificateRequest reason */ + reason?: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason|null); + + /** RevokeCertificateRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RevokeCertificateRequest. */ + class RevokeCertificateRequest implements IRevokeCertificateRequest { + + /** + * Constructs a new RevokeCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IRevokeCertificateRequest); + + /** RevokeCertificateRequest name. */ + public name: string; + + /** RevokeCertificateRequest reason. */ + public reason: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason); + + /** RevokeCertificateRequest requestId. */ + public requestId: string; + + /** + * Creates a new RevokeCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RevokeCertificateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IRevokeCertificateRequest): google.cloud.security.privateca.v1.RevokeCertificateRequest; + + /** + * Encodes the specified RevokeCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.RevokeCertificateRequest.verify|verify} messages. + * @param message RevokeCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IRevokeCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RevokeCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.RevokeCertificateRequest.verify|verify} messages. + * @param message RevokeCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IRevokeCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RevokeCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RevokeCertificateRequest + * @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.security.privateca.v1.RevokeCertificateRequest; + + /** + * Decodes a RevokeCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RevokeCertificateRequest + * @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.security.privateca.v1.RevokeCertificateRequest; + + /** + * Verifies a RevokeCertificateRequest 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 RevokeCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RevokeCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.RevokeCertificateRequest; + + /** + * Creates a plain object from a RevokeCertificateRequest message. Also converts values to other types if specified. + * @param message RevokeCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.RevokeCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RevokeCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RevokeCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCertificateRequest. */ + interface IUpdateCertificateRequest { + + /** UpdateCertificateRequest certificate */ + certificate?: (google.cloud.security.privateca.v1.ICertificate|null); + + /** UpdateCertificateRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateCertificateRequest. */ + class UpdateCertificateRequest implements IUpdateCertificateRequest { + + /** + * Constructs a new UpdateCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IUpdateCertificateRequest); + + /** UpdateCertificateRequest certificate. */ + public certificate?: (google.cloud.security.privateca.v1.ICertificate|null); + + /** UpdateCertificateRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCertificateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IUpdateCertificateRequest): google.cloud.security.privateca.v1.UpdateCertificateRequest; + + /** + * Encodes the specified UpdateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRequest.verify|verify} messages. + * @param message UpdateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IUpdateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRequest.verify|verify} messages. + * @param message UpdateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IUpdateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCertificateRequest + * @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.security.privateca.v1.UpdateCertificateRequest; + + /** + * Decodes an UpdateCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCertificateRequest + * @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.security.privateca.v1.UpdateCertificateRequest; + + /** + * Verifies an UpdateCertificateRequest 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 UpdateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UpdateCertificateRequest; + + /** + * Creates a plain object from an UpdateCertificateRequest message. Also converts values to other types if specified. + * @param message UpdateCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.UpdateCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActivateCertificateAuthorityRequest. */ + interface IActivateCertificateAuthorityRequest { + + /** ActivateCertificateAuthorityRequest name */ + name?: (string|null); + + /** ActivateCertificateAuthorityRequest pemCaCertificate */ + pemCaCertificate?: (string|null); + + /** ActivateCertificateAuthorityRequest subordinateConfig */ + subordinateConfig?: (google.cloud.security.privateca.v1.ISubordinateConfig|null); + + /** ActivateCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents an ActivateCertificateAuthorityRequest. */ + class ActivateCertificateAuthorityRequest implements IActivateCertificateAuthorityRequest { + + /** + * Constructs a new ActivateCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest); + + /** ActivateCertificateAuthorityRequest name. */ + public name: string; + + /** ActivateCertificateAuthorityRequest pemCaCertificate. */ + public pemCaCertificate: string; + + /** ActivateCertificateAuthorityRequest subordinateConfig. */ + public subordinateConfig?: (google.cloud.security.privateca.v1.ISubordinateConfig|null); + + /** ActivateCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new ActivateCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ActivateCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest): google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest; + + /** + * Encodes the specified ActivateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest.verify|verify} messages. + * @param message ActivateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActivateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest.verify|verify} messages. + * @param message ActivateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActivateCertificateAuthorityRequest + * @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.security.privateca.v1.ActivateCertificateAuthorityRequest; + + /** + * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActivateCertificateAuthorityRequest + * @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.security.privateca.v1.ActivateCertificateAuthorityRequest; + + /** + * Verifies an ActivateCertificateAuthorityRequest 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 ActivateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActivateCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest; + + /** + * Creates a plain object from an ActivateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message ActivateCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActivateCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActivateCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCertificateAuthorityRequest. */ + interface ICreateCertificateAuthorityRequest { + + /** CreateCertificateAuthorityRequest parent */ + parent?: (string|null); + + /** CreateCertificateAuthorityRequest certificateAuthorityId */ + certificateAuthorityId?: (string|null); + + /** CreateCertificateAuthorityRequest certificateAuthority */ + certificateAuthority?: (google.cloud.security.privateca.v1.ICertificateAuthority|null); + + /** CreateCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateCertificateAuthorityRequest. */ + class CreateCertificateAuthorityRequest implements ICreateCertificateAuthorityRequest { + + /** + * Constructs a new CreateCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest); + + /** CreateCertificateAuthorityRequest parent. */ + public parent: string; + + /** CreateCertificateAuthorityRequest certificateAuthorityId. */ + public certificateAuthorityId: string; + + /** CreateCertificateAuthorityRequest certificateAuthority. */ + public certificateAuthority?: (google.cloud.security.privateca.v1.ICertificateAuthority|null); + + /** CreateCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest): google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest; + + /** + * Encodes the specified CreateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest.verify|verify} messages. + * @param message CreateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest.verify|verify} messages. + * @param message CreateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCertificateAuthorityRequest + * @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.security.privateca.v1.CreateCertificateAuthorityRequest; + + /** + * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCertificateAuthorityRequest + * @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.security.privateca.v1.CreateCertificateAuthorityRequest; + + /** + * Verifies a CreateCertificateAuthorityRequest 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 CreateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest; + + /** + * Creates a plain object from a CreateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message CreateCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisableCertificateAuthorityRequest. */ + interface IDisableCertificateAuthorityRequest { + + /** DisableCertificateAuthorityRequest name */ + name?: (string|null); + + /** DisableCertificateAuthorityRequest requestId */ + requestId?: (string|null); + + /** DisableCertificateAuthorityRequest ignoreDependentResources */ + ignoreDependentResources?: (boolean|null); + } + + /** Represents a DisableCertificateAuthorityRequest. */ + class DisableCertificateAuthorityRequest implements IDisableCertificateAuthorityRequest { + + /** + * Constructs a new DisableCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest); + + /** DisableCertificateAuthorityRequest name. */ + public name: string; + + /** DisableCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** DisableCertificateAuthorityRequest ignoreDependentResources. */ + public ignoreDependentResources: boolean; + + /** + * Creates a new DisableCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest): google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest; + + /** + * Encodes the specified DisableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest.verify|verify} messages. + * @param message DisableCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest.verify|verify} messages. + * @param message DisableCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableCertificateAuthorityRequest + * @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.security.privateca.v1.DisableCertificateAuthorityRequest; + + /** + * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableCertificateAuthorityRequest + * @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.security.privateca.v1.DisableCertificateAuthorityRequest; + + /** + * Verifies a DisableCertificateAuthorityRequest 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 DisableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest; + + /** + * Creates a plain object from a DisableCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message DisableCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisableCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnableCertificateAuthorityRequest. */ + interface IEnableCertificateAuthorityRequest { + + /** EnableCertificateAuthorityRequest name */ + name?: (string|null); + + /** EnableCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents an EnableCertificateAuthorityRequest. */ + class EnableCertificateAuthorityRequest implements IEnableCertificateAuthorityRequest { + + /** + * Constructs a new EnableCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest); + + /** EnableCertificateAuthorityRequest name. */ + public name: string; + + /** EnableCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new EnableCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest): google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest; + + /** + * Encodes the specified EnableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest.verify|verify} messages. + * @param message EnableCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest.verify|verify} messages. + * @param message EnableCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableCertificateAuthorityRequest + * @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.security.privateca.v1.EnableCertificateAuthorityRequest; + + /** + * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableCertificateAuthorityRequest + * @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.security.privateca.v1.EnableCertificateAuthorityRequest; + + /** + * Verifies an EnableCertificateAuthorityRequest 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 EnableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest; + + /** + * Creates a plain object from an EnableCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message EnableCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnableCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchCertificateAuthorityCsrRequest. */ + interface IFetchCertificateAuthorityCsrRequest { + + /** FetchCertificateAuthorityCsrRequest name */ + name?: (string|null); + } + + /** Represents a FetchCertificateAuthorityCsrRequest. */ + class FetchCertificateAuthorityCsrRequest implements IFetchCertificateAuthorityCsrRequest { + + /** + * Constructs a new FetchCertificateAuthorityCsrRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest); + + /** FetchCertificateAuthorityCsrRequest name. */ + public name: string; + + /** + * Creates a new FetchCertificateAuthorityCsrRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchCertificateAuthorityCsrRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest): google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest; + + /** + * Encodes the specified FetchCertificateAuthorityCsrRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. + * @param message FetchCertificateAuthorityCsrRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchCertificateAuthorityCsrRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. + * @param message FetchCertificateAuthorityCsrRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchCertificateAuthorityCsrRequest + * @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.security.privateca.v1.FetchCertificateAuthorityCsrRequest; + + /** + * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchCertificateAuthorityCsrRequest + * @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.security.privateca.v1.FetchCertificateAuthorityCsrRequest; + + /** + * Verifies a FetchCertificateAuthorityCsrRequest 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 FetchCertificateAuthorityCsrRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchCertificateAuthorityCsrRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest; + + /** + * Creates a plain object from a FetchCertificateAuthorityCsrRequest message. Also converts values to other types if specified. + * @param message FetchCertificateAuthorityCsrRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchCertificateAuthorityCsrRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchCertificateAuthorityCsrRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchCertificateAuthorityCsrResponse. */ + interface IFetchCertificateAuthorityCsrResponse { + + /** FetchCertificateAuthorityCsrResponse pemCsr */ + pemCsr?: (string|null); + } + + /** Represents a FetchCertificateAuthorityCsrResponse. */ + class FetchCertificateAuthorityCsrResponse implements IFetchCertificateAuthorityCsrResponse { + + /** + * Constructs a new FetchCertificateAuthorityCsrResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse); + + /** FetchCertificateAuthorityCsrResponse pemCsr. */ + public pemCsr: string; + + /** + * Creates a new FetchCertificateAuthorityCsrResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchCertificateAuthorityCsrResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse): google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse; + + /** + * Encodes the specified FetchCertificateAuthorityCsrResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. + * @param message FetchCertificateAuthorityCsrResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchCertificateAuthorityCsrResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. + * @param message FetchCertificateAuthorityCsrResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchCertificateAuthorityCsrResponse + * @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.security.privateca.v1.FetchCertificateAuthorityCsrResponse; + + /** + * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchCertificateAuthorityCsrResponse + * @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.security.privateca.v1.FetchCertificateAuthorityCsrResponse; + + /** + * Verifies a FetchCertificateAuthorityCsrResponse 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 FetchCertificateAuthorityCsrResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchCertificateAuthorityCsrResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse; + + /** + * Creates a plain object from a FetchCertificateAuthorityCsrResponse message. Also converts values to other types if specified. + * @param message FetchCertificateAuthorityCsrResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchCertificateAuthorityCsrResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchCertificateAuthorityCsrResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCertificateAuthorityRequest. */ + interface IGetCertificateAuthorityRequest { + + /** GetCertificateAuthorityRequest name */ + name?: (string|null); + } + + /** Represents a GetCertificateAuthorityRequest. */ + class GetCertificateAuthorityRequest implements IGetCertificateAuthorityRequest { + + /** + * Constructs a new GetCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest); + + /** GetCertificateAuthorityRequest name. */ + public name: string; + + /** + * Creates a new GetCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest): google.cloud.security.privateca.v1.GetCertificateAuthorityRequest; + + /** + * Encodes the specified GetCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateAuthorityRequest.verify|verify} messages. + * @param message GetCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateAuthorityRequest.verify|verify} messages. + * @param message GetCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCertificateAuthorityRequest + * @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.security.privateca.v1.GetCertificateAuthorityRequest; + + /** + * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCertificateAuthorityRequest + * @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.security.privateca.v1.GetCertificateAuthorityRequest; + + /** + * Verifies a GetCertificateAuthorityRequest 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 GetCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.GetCertificateAuthorityRequest; + + /** + * Creates a plain object from a GetCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message GetCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.GetCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateAuthoritiesRequest. */ + interface IListCertificateAuthoritiesRequest { + + /** ListCertificateAuthoritiesRequest parent */ + parent?: (string|null); + + /** ListCertificateAuthoritiesRequest pageSize */ + pageSize?: (number|null); + + /** ListCertificateAuthoritiesRequest pageToken */ + pageToken?: (string|null); + + /** ListCertificateAuthoritiesRequest filter */ + filter?: (string|null); + + /** ListCertificateAuthoritiesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCertificateAuthoritiesRequest. */ + class ListCertificateAuthoritiesRequest implements IListCertificateAuthoritiesRequest { + + /** + * Constructs a new ListCertificateAuthoritiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest); + + /** ListCertificateAuthoritiesRequest parent. */ + public parent: string; + + /** ListCertificateAuthoritiesRequest pageSize. */ + public pageSize: number; + + /** ListCertificateAuthoritiesRequest pageToken. */ + public pageToken: string; + + /** ListCertificateAuthoritiesRequest filter. */ + public filter: string; + + /** ListCertificateAuthoritiesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCertificateAuthoritiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateAuthoritiesRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest): google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest; + + /** + * Encodes the specified ListCertificateAuthoritiesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.verify|verify} messages. + * @param message ListCertificateAuthoritiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateAuthoritiesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.verify|verify} messages. + * @param message ListCertificateAuthoritiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateAuthoritiesRequest + * @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.security.privateca.v1.ListCertificateAuthoritiesRequest; + + /** + * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateAuthoritiesRequest + * @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.security.privateca.v1.ListCertificateAuthoritiesRequest; + + /** + * Verifies a ListCertificateAuthoritiesRequest 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 ListCertificateAuthoritiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateAuthoritiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest; + + /** + * Creates a plain object from a ListCertificateAuthoritiesRequest message. Also converts values to other types if specified. + * @param message ListCertificateAuthoritiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateAuthoritiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateAuthoritiesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateAuthoritiesResponse. */ + interface IListCertificateAuthoritiesResponse { + + /** ListCertificateAuthoritiesResponse certificateAuthorities */ + certificateAuthorities?: (google.cloud.security.privateca.v1.ICertificateAuthority[]|null); + + /** ListCertificateAuthoritiesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCertificateAuthoritiesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCertificateAuthoritiesResponse. */ + class ListCertificateAuthoritiesResponse implements IListCertificateAuthoritiesResponse { + + /** + * Constructs a new ListCertificateAuthoritiesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse); + + /** ListCertificateAuthoritiesResponse certificateAuthorities. */ + public certificateAuthorities: google.cloud.security.privateca.v1.ICertificateAuthority[]; + + /** ListCertificateAuthoritiesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCertificateAuthoritiesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCertificateAuthoritiesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateAuthoritiesResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse): google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse; + + /** + * Encodes the specified ListCertificateAuthoritiesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.verify|verify} messages. + * @param message ListCertificateAuthoritiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateAuthoritiesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.verify|verify} messages. + * @param message ListCertificateAuthoritiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateAuthoritiesResponse + * @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.security.privateca.v1.ListCertificateAuthoritiesResponse; + + /** + * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateAuthoritiesResponse + * @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.security.privateca.v1.ListCertificateAuthoritiesResponse; + + /** + * Verifies a ListCertificateAuthoritiesResponse 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 ListCertificateAuthoritiesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateAuthoritiesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse; + + /** + * Creates a plain object from a ListCertificateAuthoritiesResponse message. Also converts values to other types if specified. + * @param message ListCertificateAuthoritiesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateAuthoritiesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateAuthoritiesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteCertificateAuthorityRequest. */ + interface IUndeleteCertificateAuthorityRequest { + + /** UndeleteCertificateAuthorityRequest name */ + name?: (string|null); + + /** UndeleteCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UndeleteCertificateAuthorityRequest. */ + class UndeleteCertificateAuthorityRequest implements IUndeleteCertificateAuthorityRequest { + + /** + * Constructs a new UndeleteCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest); + + /** UndeleteCertificateAuthorityRequest name. */ + public name: string; + + /** UndeleteCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new UndeleteCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest): google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest; + + /** + * Encodes the specified UndeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest.verify|verify} messages. + * @param message UndeleteCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest.verify|verify} messages. + * @param message UndeleteCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteCertificateAuthorityRequest + * @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.security.privateca.v1.UndeleteCertificateAuthorityRequest; + + /** + * Decodes an UndeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteCertificateAuthorityRequest + * @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.security.privateca.v1.UndeleteCertificateAuthorityRequest; + + /** + * Verifies an UndeleteCertificateAuthorityRequest 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 UndeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest; + + /** + * Creates a plain object from an UndeleteCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message UndeleteCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCertificateAuthorityRequest. */ + interface IDeleteCertificateAuthorityRequest { + + /** DeleteCertificateAuthorityRequest name */ + name?: (string|null); + + /** DeleteCertificateAuthorityRequest requestId */ + requestId?: (string|null); + + /** DeleteCertificateAuthorityRequest ignoreActiveCertificates */ + ignoreActiveCertificates?: (boolean|null); + + /** DeleteCertificateAuthorityRequest skipGracePeriod */ + skipGracePeriod?: (boolean|null); + + /** DeleteCertificateAuthorityRequest ignoreDependentResources */ + ignoreDependentResources?: (boolean|null); + } + + /** Represents a DeleteCertificateAuthorityRequest. */ + class DeleteCertificateAuthorityRequest implements IDeleteCertificateAuthorityRequest { + + /** + * Constructs a new DeleteCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest); + + /** DeleteCertificateAuthorityRequest name. */ + public name: string; + + /** DeleteCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** DeleteCertificateAuthorityRequest ignoreActiveCertificates. */ + public ignoreActiveCertificates: boolean; + + /** DeleteCertificateAuthorityRequest skipGracePeriod. */ + public skipGracePeriod: boolean; + + /** DeleteCertificateAuthorityRequest ignoreDependentResources. */ + public ignoreDependentResources: boolean; + + /** + * Creates a new DeleteCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest): google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest; + + /** + * Encodes the specified DeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest.verify|verify} messages. + * @param message DeleteCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest.verify|verify} messages. + * @param message DeleteCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCertificateAuthorityRequest + * @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.security.privateca.v1.DeleteCertificateAuthorityRequest; + + /** + * Decodes a DeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCertificateAuthorityRequest + * @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.security.privateca.v1.DeleteCertificateAuthorityRequest; + + /** + * Verifies a DeleteCertificateAuthorityRequest 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 DeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest; + + /** + * Creates a plain object from a DeleteCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message DeleteCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCertificateAuthorityRequest. */ + interface IUpdateCertificateAuthorityRequest { + + /** UpdateCertificateAuthorityRequest certificateAuthority */ + certificateAuthority?: (google.cloud.security.privateca.v1.ICertificateAuthority|null); + + /** UpdateCertificateAuthorityRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateCertificateAuthorityRequest. */ + class UpdateCertificateAuthorityRequest implements IUpdateCertificateAuthorityRequest { + + /** + * Constructs a new UpdateCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest); + + /** UpdateCertificateAuthorityRequest certificateAuthority. */ + public certificateAuthority?: (google.cloud.security.privateca.v1.ICertificateAuthority|null); + + /** UpdateCertificateAuthorityRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest): google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest; + + /** + * Encodes the specified UpdateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.verify|verify} messages. + * @param message UpdateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.verify|verify} messages. + * @param message UpdateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCertificateAuthorityRequest + * @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.security.privateca.v1.UpdateCertificateAuthorityRequest; + + /** + * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCertificateAuthorityRequest + * @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.security.privateca.v1.UpdateCertificateAuthorityRequest; + + /** + * Verifies an UpdateCertificateAuthorityRequest 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 UpdateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest; + + /** + * Creates a plain object from an UpdateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message UpdateCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCaPoolRequest. */ + interface ICreateCaPoolRequest { + + /** CreateCaPoolRequest parent */ + parent?: (string|null); + + /** CreateCaPoolRequest caPoolId */ + caPoolId?: (string|null); + + /** CreateCaPoolRequest caPool */ + caPool?: (google.cloud.security.privateca.v1.ICaPool|null); + + /** CreateCaPoolRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateCaPoolRequest. */ + class CreateCaPoolRequest implements ICreateCaPoolRequest { + + /** + * Constructs a new CreateCaPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICreateCaPoolRequest); + + /** CreateCaPoolRequest parent. */ + public parent: string; + + /** CreateCaPoolRequest caPoolId. */ + public caPoolId: string; + + /** CreateCaPoolRequest caPool. */ + public caPool?: (google.cloud.security.privateca.v1.ICaPool|null); + + /** CreateCaPoolRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateCaPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCaPoolRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICreateCaPoolRequest): google.cloud.security.privateca.v1.CreateCaPoolRequest; + + /** + * Encodes the specified CreateCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCaPoolRequest.verify|verify} messages. + * @param message CreateCaPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICreateCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCaPoolRequest.verify|verify} messages. + * @param message CreateCaPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICreateCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCaPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCaPoolRequest + * @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.security.privateca.v1.CreateCaPoolRequest; + + /** + * Decodes a CreateCaPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCaPoolRequest + * @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.security.privateca.v1.CreateCaPoolRequest; + + /** + * Verifies a CreateCaPoolRequest 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 CreateCaPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCaPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CreateCaPoolRequest; + + /** + * Creates a plain object from a CreateCaPoolRequest message. Also converts values to other types if specified. + * @param message CreateCaPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CreateCaPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCaPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCaPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCaPoolRequest. */ + interface IUpdateCaPoolRequest { + + /** UpdateCaPoolRequest caPool */ + caPool?: (google.cloud.security.privateca.v1.ICaPool|null); + + /** UpdateCaPoolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCaPoolRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateCaPoolRequest. */ + class UpdateCaPoolRequest implements IUpdateCaPoolRequest { + + /** + * Constructs a new UpdateCaPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IUpdateCaPoolRequest); + + /** UpdateCaPoolRequest caPool. */ + public caPool?: (google.cloud.security.privateca.v1.ICaPool|null); + + /** UpdateCaPoolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCaPoolRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateCaPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCaPoolRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IUpdateCaPoolRequest): google.cloud.security.privateca.v1.UpdateCaPoolRequest; + + /** + * Encodes the specified UpdateCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCaPoolRequest.verify|verify} messages. + * @param message UpdateCaPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IUpdateCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCaPoolRequest.verify|verify} messages. + * @param message UpdateCaPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IUpdateCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCaPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCaPoolRequest + * @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.security.privateca.v1.UpdateCaPoolRequest; + + /** + * Decodes an UpdateCaPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCaPoolRequest + * @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.security.privateca.v1.UpdateCaPoolRequest; + + /** + * Verifies an UpdateCaPoolRequest 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 UpdateCaPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCaPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UpdateCaPoolRequest; + + /** + * Creates a plain object from an UpdateCaPoolRequest message. Also converts values to other types if specified. + * @param message UpdateCaPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.UpdateCaPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCaPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCaPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCaPoolRequest. */ + interface IDeleteCaPoolRequest { + + /** DeleteCaPoolRequest name */ + name?: (string|null); + + /** DeleteCaPoolRequest requestId */ + requestId?: (string|null); + + /** DeleteCaPoolRequest ignoreDependentResources */ + ignoreDependentResources?: (boolean|null); + } + + /** Represents a DeleteCaPoolRequest. */ + class DeleteCaPoolRequest implements IDeleteCaPoolRequest { + + /** + * Constructs a new DeleteCaPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IDeleteCaPoolRequest); + + /** DeleteCaPoolRequest name. */ + public name: string; + + /** DeleteCaPoolRequest requestId. */ + public requestId: string; + + /** DeleteCaPoolRequest ignoreDependentResources. */ + public ignoreDependentResources: boolean; + + /** + * Creates a new DeleteCaPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCaPoolRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IDeleteCaPoolRequest): google.cloud.security.privateca.v1.DeleteCaPoolRequest; + + /** + * Encodes the specified DeleteCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCaPoolRequest.verify|verify} messages. + * @param message DeleteCaPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IDeleteCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCaPoolRequest.verify|verify} messages. + * @param message DeleteCaPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IDeleteCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCaPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCaPoolRequest + * @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.security.privateca.v1.DeleteCaPoolRequest; + + /** + * Decodes a DeleteCaPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCaPoolRequest + * @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.security.privateca.v1.DeleteCaPoolRequest; + + /** + * Verifies a DeleteCaPoolRequest 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 DeleteCaPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCaPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.DeleteCaPoolRequest; + + /** + * Creates a plain object from a DeleteCaPoolRequest message. Also converts values to other types if specified. + * @param message DeleteCaPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.DeleteCaPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCaPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCaPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchCaCertsRequest. */ + interface IFetchCaCertsRequest { + + /** FetchCaCertsRequest caPool */ + caPool?: (string|null); + + /** FetchCaCertsRequest requestId */ + requestId?: (string|null); + } + + /** Represents a FetchCaCertsRequest. */ + class FetchCaCertsRequest implements IFetchCaCertsRequest { + + /** + * Constructs a new FetchCaCertsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IFetchCaCertsRequest); + + /** FetchCaCertsRequest caPool. */ + public caPool: string; + + /** FetchCaCertsRequest requestId. */ + public requestId: string; + + /** + * Creates a new FetchCaCertsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchCaCertsRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IFetchCaCertsRequest): google.cloud.security.privateca.v1.FetchCaCertsRequest; + + /** + * Encodes the specified FetchCaCertsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsRequest.verify|verify} messages. + * @param message FetchCaCertsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IFetchCaCertsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchCaCertsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsRequest.verify|verify} messages. + * @param message FetchCaCertsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IFetchCaCertsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchCaCertsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchCaCertsRequest + * @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.security.privateca.v1.FetchCaCertsRequest; + + /** + * Decodes a FetchCaCertsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchCaCertsRequest + * @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.security.privateca.v1.FetchCaCertsRequest; + + /** + * Verifies a FetchCaCertsRequest 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 FetchCaCertsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchCaCertsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.FetchCaCertsRequest; + + /** + * Creates a plain object from a FetchCaCertsRequest message. Also converts values to other types if specified. + * @param message FetchCaCertsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.FetchCaCertsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchCaCertsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchCaCertsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchCaCertsResponse. */ + interface IFetchCaCertsResponse { + + /** FetchCaCertsResponse caCerts */ + caCerts?: (google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain[]|null); + } + + /** Represents a FetchCaCertsResponse. */ + class FetchCaCertsResponse implements IFetchCaCertsResponse { + + /** + * Constructs a new FetchCaCertsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IFetchCaCertsResponse); + + /** FetchCaCertsResponse caCerts. */ + public caCerts: google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain[]; + + /** + * Creates a new FetchCaCertsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchCaCertsResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IFetchCaCertsResponse): google.cloud.security.privateca.v1.FetchCaCertsResponse; + + /** + * Encodes the specified FetchCaCertsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.verify|verify} messages. + * @param message FetchCaCertsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IFetchCaCertsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchCaCertsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.verify|verify} messages. + * @param message FetchCaCertsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IFetchCaCertsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchCaCertsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchCaCertsResponse + * @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.security.privateca.v1.FetchCaCertsResponse; + + /** + * Decodes a FetchCaCertsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchCaCertsResponse + * @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.security.privateca.v1.FetchCaCertsResponse; + + /** + * Verifies a FetchCaCertsResponse 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 FetchCaCertsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchCaCertsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.FetchCaCertsResponse; + + /** + * Creates a plain object from a FetchCaCertsResponse message. Also converts values to other types if specified. + * @param message FetchCaCertsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.FetchCaCertsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchCaCertsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchCaCertsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FetchCaCertsResponse { + + /** Properties of a CertChain. */ + interface ICertChain { + + /** CertChain certificates */ + certificates?: (string[]|null); + } + + /** Represents a CertChain. */ + class CertChain implements ICertChain { + + /** + * Constructs a new CertChain. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain); + + /** CertChain certificates. */ + public certificates: string[]; + + /** + * Creates a new CertChain instance using the specified properties. + * @param [properties] Properties to set + * @returns CertChain instance + */ + public static create(properties?: google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain): google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain; + + /** + * Encodes the specified CertChain message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.verify|verify} messages. + * @param message CertChain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.verify|verify} messages. + * @param message CertChain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertChain message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertChain + * @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.security.privateca.v1.FetchCaCertsResponse.CertChain; + + /** + * Decodes a CertChain message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertChain + * @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.security.privateca.v1.FetchCaCertsResponse.CertChain; + + /** + * Verifies a CertChain 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 CertChain message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertChain + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain; + + /** + * Creates a plain object from a CertChain message. Also converts values to other types if specified. + * @param message CertChain + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertChain to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertChain + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GetCaPoolRequest. */ + interface IGetCaPoolRequest { + + /** GetCaPoolRequest name */ + name?: (string|null); + } + + /** Represents a GetCaPoolRequest. */ + class GetCaPoolRequest implements IGetCaPoolRequest { + + /** + * Constructs a new GetCaPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IGetCaPoolRequest); + + /** GetCaPoolRequest name. */ + public name: string; + + /** + * Creates a new GetCaPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCaPoolRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IGetCaPoolRequest): google.cloud.security.privateca.v1.GetCaPoolRequest; + + /** + * Encodes the specified GetCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCaPoolRequest.verify|verify} messages. + * @param message GetCaPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IGetCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCaPoolRequest.verify|verify} messages. + * @param message GetCaPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IGetCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCaPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCaPoolRequest + * @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.security.privateca.v1.GetCaPoolRequest; + + /** + * Decodes a GetCaPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCaPoolRequest + * @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.security.privateca.v1.GetCaPoolRequest; + + /** + * Verifies a GetCaPoolRequest 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 GetCaPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCaPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.GetCaPoolRequest; + + /** + * Creates a plain object from a GetCaPoolRequest message. Also converts values to other types if specified. + * @param message GetCaPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.GetCaPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCaPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCaPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCaPoolsRequest. */ + interface IListCaPoolsRequest { + + /** ListCaPoolsRequest parent */ + parent?: (string|null); + + /** ListCaPoolsRequest pageSize */ + pageSize?: (number|null); + + /** ListCaPoolsRequest pageToken */ + pageToken?: (string|null); + + /** ListCaPoolsRequest filter */ + filter?: (string|null); + + /** ListCaPoolsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCaPoolsRequest. */ + class ListCaPoolsRequest implements IListCaPoolsRequest { + + /** + * Constructs a new ListCaPoolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IListCaPoolsRequest); + + /** ListCaPoolsRequest parent. */ + public parent: string; + + /** ListCaPoolsRequest pageSize. */ + public pageSize: number; + + /** ListCaPoolsRequest pageToken. */ + public pageToken: string; + + /** ListCaPoolsRequest filter. */ + public filter: string; + + /** ListCaPoolsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCaPoolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCaPoolsRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IListCaPoolsRequest): google.cloud.security.privateca.v1.ListCaPoolsRequest; + + /** + * Encodes the specified ListCaPoolsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsRequest.verify|verify} messages. + * @param message ListCaPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IListCaPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCaPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsRequest.verify|verify} messages. + * @param message ListCaPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCaPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCaPoolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCaPoolsRequest + * @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.security.privateca.v1.ListCaPoolsRequest; + + /** + * Decodes a ListCaPoolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCaPoolsRequest + * @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.security.privateca.v1.ListCaPoolsRequest; + + /** + * Verifies a ListCaPoolsRequest 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 ListCaPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCaPoolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCaPoolsRequest; + + /** + * Creates a plain object from a ListCaPoolsRequest message. Also converts values to other types if specified. + * @param message ListCaPoolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ListCaPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCaPoolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCaPoolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCaPoolsResponse. */ + interface IListCaPoolsResponse { + + /** ListCaPoolsResponse caPools */ + caPools?: (google.cloud.security.privateca.v1.ICaPool[]|null); + + /** ListCaPoolsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCaPoolsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCaPoolsResponse. */ + class ListCaPoolsResponse implements IListCaPoolsResponse { + + /** + * Constructs a new ListCaPoolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IListCaPoolsResponse); + + /** ListCaPoolsResponse caPools. */ + public caPools: google.cloud.security.privateca.v1.ICaPool[]; + + /** ListCaPoolsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCaPoolsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCaPoolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCaPoolsResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IListCaPoolsResponse): google.cloud.security.privateca.v1.ListCaPoolsResponse; + + /** + * Encodes the specified ListCaPoolsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.verify|verify} messages. + * @param message ListCaPoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IListCaPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCaPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.verify|verify} messages. + * @param message ListCaPoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCaPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCaPoolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCaPoolsResponse + * @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.security.privateca.v1.ListCaPoolsResponse; + + /** + * Decodes a ListCaPoolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCaPoolsResponse + * @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.security.privateca.v1.ListCaPoolsResponse; + + /** + * Verifies a ListCaPoolsResponse 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 ListCaPoolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCaPoolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCaPoolsResponse; + + /** + * Creates a plain object from a ListCaPoolsResponse message. Also converts values to other types if specified. + * @param message ListCaPoolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ListCaPoolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCaPoolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCaPoolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCertificateRevocationListRequest. */ + interface IGetCertificateRevocationListRequest { + + /** GetCertificateRevocationListRequest name */ + name?: (string|null); + } + + /** Represents a GetCertificateRevocationListRequest. */ + class GetCertificateRevocationListRequest implements IGetCertificateRevocationListRequest { + + /** + * Constructs a new GetCertificateRevocationListRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest); + + /** GetCertificateRevocationListRequest name. */ + public name: string; + + /** + * Creates a new GetCertificateRevocationListRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCertificateRevocationListRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest): google.cloud.security.privateca.v1.GetCertificateRevocationListRequest; + + /** + * Encodes the specified GetCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRevocationListRequest.verify|verify} messages. + * @param message GetCertificateRevocationListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRevocationListRequest.verify|verify} messages. + * @param message GetCertificateRevocationListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCertificateRevocationListRequest + * @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.security.privateca.v1.GetCertificateRevocationListRequest; + + /** + * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCertificateRevocationListRequest + * @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.security.privateca.v1.GetCertificateRevocationListRequest; + + /** + * Verifies a GetCertificateRevocationListRequest 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 GetCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCertificateRevocationListRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.GetCertificateRevocationListRequest; + + /** + * Creates a plain object from a GetCertificateRevocationListRequest message. Also converts values to other types if specified. + * @param message GetCertificateRevocationListRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.GetCertificateRevocationListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCertificateRevocationListRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCertificateRevocationListRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateRevocationListsRequest. */ + interface IListCertificateRevocationListsRequest { + + /** ListCertificateRevocationListsRequest parent */ + parent?: (string|null); + + /** ListCertificateRevocationListsRequest pageSize */ + pageSize?: (number|null); + + /** ListCertificateRevocationListsRequest pageToken */ + pageToken?: (string|null); + + /** ListCertificateRevocationListsRequest filter */ + filter?: (string|null); + + /** ListCertificateRevocationListsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCertificateRevocationListsRequest. */ + class ListCertificateRevocationListsRequest implements IListCertificateRevocationListsRequest { + + /** + * Constructs a new ListCertificateRevocationListsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest); + + /** ListCertificateRevocationListsRequest parent. */ + public parent: string; + + /** ListCertificateRevocationListsRequest pageSize. */ + public pageSize: number; + + /** ListCertificateRevocationListsRequest pageToken. */ + public pageToken: string; + + /** ListCertificateRevocationListsRequest filter. */ + public filter: string; + + /** ListCertificateRevocationListsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCertificateRevocationListsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateRevocationListsRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest): google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest; + + /** + * Encodes the specified ListCertificateRevocationListsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.verify|verify} messages. + * @param message ListCertificateRevocationListsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateRevocationListsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.verify|verify} messages. + * @param message ListCertificateRevocationListsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateRevocationListsRequest + * @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.security.privateca.v1.ListCertificateRevocationListsRequest; + + /** + * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateRevocationListsRequest + * @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.security.privateca.v1.ListCertificateRevocationListsRequest; + + /** + * Verifies a ListCertificateRevocationListsRequest 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 ListCertificateRevocationListsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateRevocationListsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest; + + /** + * Creates a plain object from a ListCertificateRevocationListsRequest message. Also converts values to other types if specified. + * @param message ListCertificateRevocationListsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateRevocationListsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateRevocationListsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateRevocationListsResponse. */ + interface IListCertificateRevocationListsResponse { + + /** ListCertificateRevocationListsResponse certificateRevocationLists */ + certificateRevocationLists?: (google.cloud.security.privateca.v1.ICertificateRevocationList[]|null); + + /** ListCertificateRevocationListsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCertificateRevocationListsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCertificateRevocationListsResponse. */ + class ListCertificateRevocationListsResponse implements IListCertificateRevocationListsResponse { + + /** + * Constructs a new ListCertificateRevocationListsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse); + + /** ListCertificateRevocationListsResponse certificateRevocationLists. */ + public certificateRevocationLists: google.cloud.security.privateca.v1.ICertificateRevocationList[]; + + /** ListCertificateRevocationListsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCertificateRevocationListsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCertificateRevocationListsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateRevocationListsResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse): google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse; + + /** + * Encodes the specified ListCertificateRevocationListsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.verify|verify} messages. + * @param message ListCertificateRevocationListsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateRevocationListsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.verify|verify} messages. + * @param message ListCertificateRevocationListsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateRevocationListsResponse + * @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.security.privateca.v1.ListCertificateRevocationListsResponse; + + /** + * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateRevocationListsResponse + * @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.security.privateca.v1.ListCertificateRevocationListsResponse; + + /** + * Verifies a ListCertificateRevocationListsResponse 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 ListCertificateRevocationListsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateRevocationListsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse; + + /** + * Creates a plain object from a ListCertificateRevocationListsResponse message. Also converts values to other types if specified. + * @param message ListCertificateRevocationListsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateRevocationListsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateRevocationListsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCertificateRevocationListRequest. */ + interface IUpdateCertificateRevocationListRequest { + + /** UpdateCertificateRevocationListRequest certificateRevocationList */ + certificateRevocationList?: (google.cloud.security.privateca.v1.ICertificateRevocationList|null); + + /** UpdateCertificateRevocationListRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateRevocationListRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateCertificateRevocationListRequest. */ + class UpdateCertificateRevocationListRequest implements IUpdateCertificateRevocationListRequest { + + /** + * Constructs a new UpdateCertificateRevocationListRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest); + + /** UpdateCertificateRevocationListRequest certificateRevocationList. */ + public certificateRevocationList?: (google.cloud.security.privateca.v1.ICertificateRevocationList|null); + + /** UpdateCertificateRevocationListRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateRevocationListRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateCertificateRevocationListRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCertificateRevocationListRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest): google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest; + + /** + * Encodes the specified UpdateCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.verify|verify} messages. + * @param message UpdateCertificateRevocationListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.verify|verify} messages. + * @param message UpdateCertificateRevocationListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCertificateRevocationListRequest + * @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.security.privateca.v1.UpdateCertificateRevocationListRequest; + + /** + * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCertificateRevocationListRequest + * @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.security.privateca.v1.UpdateCertificateRevocationListRequest; + + /** + * Verifies an UpdateCertificateRevocationListRequest 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 UpdateCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCertificateRevocationListRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest; + + /** + * Creates a plain object from an UpdateCertificateRevocationListRequest message. Also converts values to other types if specified. + * @param message UpdateCertificateRevocationListRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCertificateRevocationListRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCertificateRevocationListRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCertificateTemplateRequest. */ + interface ICreateCertificateTemplateRequest { + + /** CreateCertificateTemplateRequest parent */ + parent?: (string|null); + + /** CreateCertificateTemplateRequest certificateTemplateId */ + certificateTemplateId?: (string|null); + + /** CreateCertificateTemplateRequest certificateTemplate */ + certificateTemplate?: (google.cloud.security.privateca.v1.ICertificateTemplate|null); + + /** CreateCertificateTemplateRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateCertificateTemplateRequest. */ + class CreateCertificateTemplateRequest implements ICreateCertificateTemplateRequest { + + /** + * Constructs a new CreateCertificateTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest); + + /** CreateCertificateTemplateRequest parent. */ + public parent: string; + + /** CreateCertificateTemplateRequest certificateTemplateId. */ + public certificateTemplateId: string; + + /** CreateCertificateTemplateRequest certificateTemplate. */ + public certificateTemplate?: (google.cloud.security.privateca.v1.ICertificateTemplate|null); + + /** CreateCertificateTemplateRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateCertificateTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCertificateTemplateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest): google.cloud.security.privateca.v1.CreateCertificateTemplateRequest; + + /** + * Encodes the specified CreateCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateTemplateRequest.verify|verify} messages. + * @param message CreateCertificateTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateTemplateRequest.verify|verify} messages. + * @param message CreateCertificateTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCertificateTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCertificateTemplateRequest + * @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.security.privateca.v1.CreateCertificateTemplateRequest; + + /** + * Decodes a CreateCertificateTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCertificateTemplateRequest + * @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.security.privateca.v1.CreateCertificateTemplateRequest; + + /** + * Verifies a CreateCertificateTemplateRequest 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 CreateCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCertificateTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CreateCertificateTemplateRequest; + + /** + * Creates a plain object from a CreateCertificateTemplateRequest message. Also converts values to other types if specified. + * @param message CreateCertificateTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.CreateCertificateTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCertificateTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCertificateTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCertificateTemplateRequest. */ + interface IDeleteCertificateTemplateRequest { + + /** DeleteCertificateTemplateRequest name */ + name?: (string|null); + + /** DeleteCertificateTemplateRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteCertificateTemplateRequest. */ + class DeleteCertificateTemplateRequest implements IDeleteCertificateTemplateRequest { + + /** + * Constructs a new DeleteCertificateTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest); + + /** DeleteCertificateTemplateRequest name. */ + public name: string; + + /** DeleteCertificateTemplateRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteCertificateTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCertificateTemplateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest): google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest; + + /** + * Encodes the specified DeleteCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest.verify|verify} messages. + * @param message DeleteCertificateTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest.verify|verify} messages. + * @param message DeleteCertificateTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCertificateTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCertificateTemplateRequest + * @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.security.privateca.v1.DeleteCertificateTemplateRequest; + + /** + * Decodes a DeleteCertificateTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCertificateTemplateRequest + * @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.security.privateca.v1.DeleteCertificateTemplateRequest; + + /** + * Verifies a DeleteCertificateTemplateRequest 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 DeleteCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCertificateTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest; + + /** + * Creates a plain object from a DeleteCertificateTemplateRequest message. Also converts values to other types if specified. + * @param message DeleteCertificateTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCertificateTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCertificateTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCertificateTemplateRequest. */ + interface IGetCertificateTemplateRequest { + + /** GetCertificateTemplateRequest name */ + name?: (string|null); + } + + /** Represents a GetCertificateTemplateRequest. */ + class GetCertificateTemplateRequest implements IGetCertificateTemplateRequest { + + /** + * Constructs a new GetCertificateTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest); + + /** GetCertificateTemplateRequest name. */ + public name: string; + + /** + * Creates a new GetCertificateTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCertificateTemplateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest): google.cloud.security.privateca.v1.GetCertificateTemplateRequest; + + /** + * Encodes the specified GetCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateTemplateRequest.verify|verify} messages. + * @param message GetCertificateTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateTemplateRequest.verify|verify} messages. + * @param message GetCertificateTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCertificateTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCertificateTemplateRequest + * @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.security.privateca.v1.GetCertificateTemplateRequest; + + /** + * Decodes a GetCertificateTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCertificateTemplateRequest + * @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.security.privateca.v1.GetCertificateTemplateRequest; + + /** + * Verifies a GetCertificateTemplateRequest 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 GetCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCertificateTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.GetCertificateTemplateRequest; + + /** + * Creates a plain object from a GetCertificateTemplateRequest message. Also converts values to other types if specified. + * @param message GetCertificateTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.GetCertificateTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCertificateTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCertificateTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateTemplatesRequest. */ + interface IListCertificateTemplatesRequest { + + /** ListCertificateTemplatesRequest parent */ + parent?: (string|null); + + /** ListCertificateTemplatesRequest pageSize */ + pageSize?: (number|null); + + /** ListCertificateTemplatesRequest pageToken */ + pageToken?: (string|null); + + /** ListCertificateTemplatesRequest filter */ + filter?: (string|null); + + /** ListCertificateTemplatesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCertificateTemplatesRequest. */ + class ListCertificateTemplatesRequest implements IListCertificateTemplatesRequest { + + /** + * Constructs a new ListCertificateTemplatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest); + + /** ListCertificateTemplatesRequest parent. */ + public parent: string; + + /** ListCertificateTemplatesRequest pageSize. */ + public pageSize: number; + + /** ListCertificateTemplatesRequest pageToken. */ + public pageToken: string; + + /** ListCertificateTemplatesRequest filter. */ + public filter: string; + + /** ListCertificateTemplatesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCertificateTemplatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateTemplatesRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest): google.cloud.security.privateca.v1.ListCertificateTemplatesRequest; + + /** + * Encodes the specified ListCertificateTemplatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.verify|verify} messages. + * @param message ListCertificateTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.verify|verify} messages. + * @param message ListCertificateTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateTemplatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateTemplatesRequest + * @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.security.privateca.v1.ListCertificateTemplatesRequest; + + /** + * Decodes a ListCertificateTemplatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateTemplatesRequest + * @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.security.privateca.v1.ListCertificateTemplatesRequest; + + /** + * Verifies a ListCertificateTemplatesRequest 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 ListCertificateTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateTemplatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateTemplatesRequest; + + /** + * Creates a plain object from a ListCertificateTemplatesRequest message. Also converts values to other types if specified. + * @param message ListCertificateTemplatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ListCertificateTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateTemplatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateTemplatesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateTemplatesResponse. */ + interface IListCertificateTemplatesResponse { + + /** ListCertificateTemplatesResponse certificateTemplates */ + certificateTemplates?: (google.cloud.security.privateca.v1.ICertificateTemplate[]|null); + + /** ListCertificateTemplatesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCertificateTemplatesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCertificateTemplatesResponse. */ + class ListCertificateTemplatesResponse implements IListCertificateTemplatesResponse { + + /** + * Constructs a new ListCertificateTemplatesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IListCertificateTemplatesResponse); + + /** ListCertificateTemplatesResponse certificateTemplates. */ + public certificateTemplates: google.cloud.security.privateca.v1.ICertificateTemplate[]; + + /** ListCertificateTemplatesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCertificateTemplatesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCertificateTemplatesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateTemplatesResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IListCertificateTemplatesResponse): google.cloud.security.privateca.v1.ListCertificateTemplatesResponse; + + /** + * Encodes the specified ListCertificateTemplatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.verify|verify} messages. + * @param message ListCertificateTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IListCertificateTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.verify|verify} messages. + * @param message ListCertificateTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateTemplatesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateTemplatesResponse + * @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.security.privateca.v1.ListCertificateTemplatesResponse; + + /** + * Decodes a ListCertificateTemplatesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateTemplatesResponse + * @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.security.privateca.v1.ListCertificateTemplatesResponse; + + /** + * Verifies a ListCertificateTemplatesResponse 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 ListCertificateTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateTemplatesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateTemplatesResponse; + + /** + * Creates a plain object from a ListCertificateTemplatesResponse message. Also converts values to other types if specified. + * @param message ListCertificateTemplatesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.ListCertificateTemplatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateTemplatesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateTemplatesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCertificateTemplateRequest. */ + interface IUpdateCertificateTemplateRequest { + + /** UpdateCertificateTemplateRequest certificateTemplate */ + certificateTemplate?: (google.cloud.security.privateca.v1.ICertificateTemplate|null); + + /** UpdateCertificateTemplateRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateTemplateRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateCertificateTemplateRequest. */ + class UpdateCertificateTemplateRequest implements IUpdateCertificateTemplateRequest { + + /** + * Constructs a new UpdateCertificateTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest); + + /** UpdateCertificateTemplateRequest certificateTemplate. */ + public certificateTemplate?: (google.cloud.security.privateca.v1.ICertificateTemplate|null); + + /** UpdateCertificateTemplateRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateTemplateRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateCertificateTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCertificateTemplateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest): google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest; + + /** + * Encodes the specified UpdateCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.verify|verify} messages. + * @param message UpdateCertificateTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.verify|verify} messages. + * @param message UpdateCertificateTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCertificateTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCertificateTemplateRequest + * @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.security.privateca.v1.UpdateCertificateTemplateRequest; + + /** + * Decodes an UpdateCertificateTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCertificateTemplateRequest + * @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.security.privateca.v1.UpdateCertificateTemplateRequest; + + /** + * Verifies an UpdateCertificateTemplateRequest 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 UpdateCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCertificateTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest; + + /** + * Creates a plain object from an UpdateCertificateTemplateRequest message. Also converts values to other types if specified. + * @param message UpdateCertificateTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCertificateTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCertificateTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IOperationMetadata): google.cloud.security.privateca.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.security.privateca.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.security.privateca.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.security.privateca.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Properties of a CertificateAuthority. */ + interface ICertificateAuthority { + + /** CertificateAuthority name */ + name?: (string|null); + + /** CertificateAuthority type */ + type?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.Type|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.Type|null); + + /** CertificateAuthority tier */ + tier?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier|null); + + /** CertificateAuthority config */ + config?: (google.cloud.security.privateca.v1beta1.ICertificateConfig|null); + + /** CertificateAuthority lifetime */ + lifetime?: (google.protobuf.IDuration|null); + + /** CertificateAuthority keySpec */ + keySpec?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec|null); + + /** CertificateAuthority certificatePolicy */ + certificatePolicy?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy|null); + + /** CertificateAuthority issuingOptions */ + issuingOptions?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions|null); + + /** CertificateAuthority subordinateConfig */ + subordinateConfig?: (google.cloud.security.privateca.v1beta1.ISubordinateConfig|null); + + /** CertificateAuthority state */ + state?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.State|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.State|null); + + /** CertificateAuthority pemCaCertificates */ + pemCaCertificates?: (string[]|null); + + /** CertificateAuthority caCertificateDescriptions */ + caCertificateDescriptions?: (google.cloud.security.privateca.v1beta1.ICertificateDescription[]|null); + + /** CertificateAuthority gcsBucket */ + gcsBucket?: (string|null); + + /** CertificateAuthority accessUrls */ + accessUrls?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls|null); + + /** CertificateAuthority createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a CertificateAuthority. */ + class CertificateAuthority implements ICertificateAuthority { + + /** + * Constructs a new CertificateAuthority. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.ICertificateAuthority); + + /** CertificateAuthority name. */ + public name: string; + + /** CertificateAuthority type. */ + public type: (google.cloud.security.privateca.v1beta1.CertificateAuthority.Type|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.Type); + + /** CertificateAuthority tier. */ + public tier: (google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier); + + /** CertificateAuthority config. */ + public config?: (google.cloud.security.privateca.v1beta1.ICertificateConfig|null); + + /** CertificateAuthority lifetime. */ + public lifetime?: (google.protobuf.IDuration|null); + + /** CertificateAuthority keySpec. */ + public keySpec?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec|null); + + /** CertificateAuthority certificatePolicy. */ + public certificatePolicy?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy|null); + + /** CertificateAuthority issuingOptions. */ + public issuingOptions?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions|null); + + /** CertificateAuthority subordinateConfig. */ + public subordinateConfig?: (google.cloud.security.privateca.v1beta1.ISubordinateConfig|null); + + /** CertificateAuthority state. */ + public state: (google.cloud.security.privateca.v1beta1.CertificateAuthority.State|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.State); + + /** CertificateAuthority pemCaCertificates. */ + public pemCaCertificates: string[]; + + /** CertificateAuthority caCertificateDescriptions. */ + public caCertificateDescriptions: google.cloud.security.privateca.v1beta1.ICertificateDescription[]; + + /** CertificateAuthority gcsBucket. */ + public gcsBucket: string; + + /** CertificateAuthority accessUrls. */ + public accessUrls?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls|null); + + /** CertificateAuthority createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** CertificateAuthority labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new CertificateAuthority instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateAuthority instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.ICertificateAuthority): google.cloud.security.privateca.v1beta1.CertificateAuthority; + + /** + * Encodes the specified CertificateAuthority message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.verify|verify} messages. + * @param message CertificateAuthority message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.ICertificateAuthority, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateAuthority message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.verify|verify} messages. + * @param message CertificateAuthority message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICertificateAuthority, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateAuthority message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateAuthority + * @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.security.privateca.v1beta1.CertificateAuthority; + + /** + * Decodes a CertificateAuthority message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateAuthority + * @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.security.privateca.v1beta1.CertificateAuthority; + + /** + * Verifies a CertificateAuthority 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 CertificateAuthority message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateAuthority + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority; + + /** + * Creates a plain object from a CertificateAuthority message. Also converts values to other types if specified. + * @param message CertificateAuthority + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateAuthority to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateAuthority + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateAuthority { + + /** Properties of an IssuingOptions. */ + interface IIssuingOptions { + + /** IssuingOptions includeCaCertUrl */ + includeCaCertUrl?: (boolean|null); + + /** IssuingOptions includeCrlAccessUrl */ + includeCrlAccessUrl?: (boolean|null); + } + + /** Represents an IssuingOptions. */ + class IssuingOptions implements IIssuingOptions { + + /** + * Constructs a new IssuingOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions); + + /** IssuingOptions includeCaCertUrl. */ + public includeCaCertUrl: boolean; + + /** IssuingOptions includeCrlAccessUrl. */ + public includeCrlAccessUrl: boolean; + + /** + * Creates a new IssuingOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns IssuingOptions instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions): google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions; + + /** + * Encodes the specified IssuingOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.verify|verify} messages. + * @param message IssuingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IssuingOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.verify|verify} messages. + * @param message IssuingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IssuingOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IssuingOptions + * @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.security.privateca.v1beta1.CertificateAuthority.IssuingOptions; + + /** + * Decodes an IssuingOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IssuingOptions + * @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.security.privateca.v1beta1.CertificateAuthority.IssuingOptions; + + /** + * Verifies an IssuingOptions 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 IssuingOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IssuingOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions; + + /** + * Creates a plain object from an IssuingOptions message. Also converts values to other types if specified. + * @param message IssuingOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IssuingOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IssuingOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CertificateAuthorityPolicy. */ + interface ICertificateAuthorityPolicy { + + /** CertificateAuthorityPolicy allowedConfigList */ + allowedConfigList?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList|null); + + /** CertificateAuthorityPolicy overwriteConfigValues */ + overwriteConfigValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null); + + /** CertificateAuthorityPolicy allowedLocationsAndOrganizations */ + allowedLocationsAndOrganizations?: (google.cloud.security.privateca.v1beta1.ISubject[]|null); + + /** CertificateAuthorityPolicy allowedCommonNames */ + allowedCommonNames?: (string[]|null); + + /** CertificateAuthorityPolicy allowedSans */ + allowedSans?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames|null); + + /** CertificateAuthorityPolicy maximumLifetime */ + maximumLifetime?: (google.protobuf.IDuration|null); + + /** CertificateAuthorityPolicy allowedIssuanceModes */ + allowedIssuanceModes?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes|null); + } + + /** Represents a CertificateAuthorityPolicy. */ + class CertificateAuthorityPolicy implements ICertificateAuthorityPolicy { + + /** + * Constructs a new CertificateAuthorityPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy); + + /** CertificateAuthorityPolicy allowedConfigList. */ + public allowedConfigList?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList|null); + + /** CertificateAuthorityPolicy overwriteConfigValues. */ + public overwriteConfigValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null); + + /** CertificateAuthorityPolicy allowedLocationsAndOrganizations. */ + public allowedLocationsAndOrganizations: google.cloud.security.privateca.v1beta1.ISubject[]; + + /** CertificateAuthorityPolicy allowedCommonNames. */ + public allowedCommonNames: string[]; + + /** CertificateAuthorityPolicy allowedSans. */ + public allowedSans?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames|null); + + /** CertificateAuthorityPolicy maximumLifetime. */ + public maximumLifetime?: (google.protobuf.IDuration|null); + + /** CertificateAuthorityPolicy allowedIssuanceModes. */ + public allowedIssuanceModes?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes|null); + + /** CertificateAuthorityPolicy configPolicy. */ + public configPolicy?: ("allowedConfigList"|"overwriteConfigValues"); + + /** + * Creates a new CertificateAuthorityPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateAuthorityPolicy instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy; + + /** + * Encodes the specified CertificateAuthorityPolicy message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.verify|verify} messages. + * @param message CertificateAuthorityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateAuthorityPolicy message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.verify|verify} messages. + * @param message CertificateAuthorityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateAuthorityPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateAuthorityPolicy + * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy; + + /** + * Decodes a CertificateAuthorityPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateAuthorityPolicy + * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy; + + /** + * Verifies a CertificateAuthorityPolicy 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 CertificateAuthorityPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateAuthorityPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy; + + /** + * Creates a plain object from a CertificateAuthorityPolicy message. Also converts values to other types if specified. + * @param message CertificateAuthorityPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateAuthorityPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateAuthorityPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateAuthorityPolicy { + + /** Properties of an AllowedConfigList. */ + interface IAllowedConfigList { + + /** AllowedConfigList allowedConfigValues */ + allowedConfigValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigWrapper[]|null); + } + + /** Represents an AllowedConfigList. */ + class AllowedConfigList implements IAllowedConfigList { + + /** + * Constructs a new AllowedConfigList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList); + + /** AllowedConfigList allowedConfigValues. */ + public allowedConfigValues: google.cloud.security.privateca.v1beta1.IReusableConfigWrapper[]; + + /** + * Creates a new AllowedConfigList instance using the specified properties. + * @param [properties] Properties to set + * @returns AllowedConfigList instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList; + + /** + * Encodes the specified AllowedConfigList message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.verify|verify} messages. + * @param message AllowedConfigList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllowedConfigList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.verify|verify} messages. + * @param message AllowedConfigList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllowedConfigList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllowedConfigList + * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList; + + /** + * Decodes an AllowedConfigList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllowedConfigList + * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList; + + /** + * Verifies an AllowedConfigList 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 AllowedConfigList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllowedConfigList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList; + + /** + * Creates a plain object from an AllowedConfigList message. Also converts values to other types if specified. + * @param message AllowedConfigList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllowedConfigList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllowedConfigList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AllowedSubjectAltNames. */ + interface IAllowedSubjectAltNames { + + /** AllowedSubjectAltNames allowedDnsNames */ + allowedDnsNames?: (string[]|null); + + /** AllowedSubjectAltNames allowedUris */ + allowedUris?: (string[]|null); + + /** AllowedSubjectAltNames allowedEmailAddresses */ + allowedEmailAddresses?: (string[]|null); + + /** AllowedSubjectAltNames allowedIps */ + allowedIps?: (string[]|null); + + /** AllowedSubjectAltNames allowGlobbingDnsWildcards */ + allowGlobbingDnsWildcards?: (boolean|null); + + /** AllowedSubjectAltNames allowCustomSans */ + allowCustomSans?: (boolean|null); + } + + /** Represents an AllowedSubjectAltNames. */ + class AllowedSubjectAltNames implements IAllowedSubjectAltNames { + + /** + * Constructs a new AllowedSubjectAltNames. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames); + + /** AllowedSubjectAltNames allowedDnsNames. */ + public allowedDnsNames: string[]; + + /** AllowedSubjectAltNames allowedUris. */ + public allowedUris: string[]; + + /** AllowedSubjectAltNames allowedEmailAddresses. */ + public allowedEmailAddresses: string[]; + + /** AllowedSubjectAltNames allowedIps. */ + public allowedIps: string[]; + + /** AllowedSubjectAltNames allowGlobbingDnsWildcards. */ + public allowGlobbingDnsWildcards: boolean; + + /** AllowedSubjectAltNames allowCustomSans. */ + public allowCustomSans: boolean; + + /** + * Creates a new AllowedSubjectAltNames instance using the specified properties. + * @param [properties] Properties to set + * @returns AllowedSubjectAltNames instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames; + + /** + * Encodes the specified AllowedSubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.verify|verify} messages. + * @param message AllowedSubjectAltNames message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllowedSubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.verify|verify} messages. + * @param message AllowedSubjectAltNames message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllowedSubjectAltNames message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllowedSubjectAltNames + * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames; + + /** + * Decodes an AllowedSubjectAltNames message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllowedSubjectAltNames + * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames; + + /** + * Verifies an AllowedSubjectAltNames 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 AllowedSubjectAltNames message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllowedSubjectAltNames + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames; + + /** + * Creates a plain object from an AllowedSubjectAltNames message. Also converts values to other types if specified. + * @param message AllowedSubjectAltNames + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllowedSubjectAltNames to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllowedSubjectAltNames + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IssuanceModes. */ + interface IIssuanceModes { + + /** IssuanceModes allowCsrBasedIssuance */ + allowCsrBasedIssuance?: (boolean|null); + + /** IssuanceModes allowConfigBasedIssuance */ + allowConfigBasedIssuance?: (boolean|null); + } + + /** Represents an IssuanceModes. */ + class IssuanceModes implements IIssuanceModes { + + /** + * Constructs a new IssuanceModes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes); + + /** IssuanceModes allowCsrBasedIssuance. */ + public allowCsrBasedIssuance: boolean; + + /** IssuanceModes allowConfigBasedIssuance. */ + public allowConfigBasedIssuance: boolean; + + /** + * Creates a new IssuanceModes instance using the specified properties. + * @param [properties] Properties to set + * @returns IssuanceModes instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes; + + /** + * Encodes the specified IssuanceModes message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.verify|verify} messages. + * @param message IssuanceModes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IssuanceModes message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.verify|verify} messages. + * @param message IssuanceModes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IssuanceModes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IssuanceModes + * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes; + + /** + * Decodes an IssuanceModes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IssuanceModes + * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes; + + /** + * Verifies an IssuanceModes 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 IssuanceModes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IssuanceModes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes; + + /** + * Creates a plain object from an IssuanceModes message. Also converts values to other types if specified. + * @param message IssuanceModes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IssuanceModes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IssuanceModes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AccessUrls. */ + interface IAccessUrls { + + /** AccessUrls caCertificateAccessUrl */ + caCertificateAccessUrl?: (string|null); + + /** AccessUrls crlAccessUrl */ + crlAccessUrl?: (string|null); + } + + /** Represents an AccessUrls. */ + class AccessUrls implements IAccessUrls { + + /** + * Constructs a new AccessUrls. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls); + + /** AccessUrls caCertificateAccessUrl. */ + public caCertificateAccessUrl: string; + + /** AccessUrls crlAccessUrl. */ + public crlAccessUrl: string; + + /** + * Creates a new AccessUrls instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessUrls instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls): google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls; + + /** + * Encodes the specified AccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.verify|verify} messages. + * @param message AccessUrls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.verify|verify} messages. + * @param message AccessUrls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessUrls message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessUrls + * @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.security.privateca.v1beta1.CertificateAuthority.AccessUrls; + + /** + * Decodes an AccessUrls message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessUrls + * @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.security.privateca.v1beta1.CertificateAuthority.AccessUrls; + + /** + * Verifies an AccessUrls 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 AccessUrls message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessUrls + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls; + + /** + * Creates a plain object from an AccessUrls message. Also converts values to other types if specified. + * @param message AccessUrls + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessUrls to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessUrls + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyVersionSpec. */ + interface IKeyVersionSpec { + + /** KeyVersionSpec cloudKmsKeyVersion */ + cloudKmsKeyVersion?: (string|null); + + /** KeyVersionSpec algorithm */ + algorithm?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|null); + } + + /** Represents a KeyVersionSpec. */ + class KeyVersionSpec implements IKeyVersionSpec { + + /** + * Constructs a new KeyVersionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec); + + /** KeyVersionSpec cloudKmsKeyVersion. */ + public cloudKmsKeyVersion?: (string|null); + + /** KeyVersionSpec algorithm. */ + public algorithm?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|null); + + /** KeyVersionSpec KeyVersion. */ + public KeyVersion?: ("cloudKmsKeyVersion"|"algorithm"); + + /** + * Creates a new KeyVersionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyVersionSpec instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec): google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec; + + /** + * Encodes the specified KeyVersionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. + * @param message KeyVersionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyVersionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. + * @param message KeyVersionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyVersionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyVersionSpec + * @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.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec; + + /** + * Decodes a KeyVersionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyVersionSpec + * @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.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec; + + /** + * Verifies a KeyVersionSpec 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 KeyVersionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyVersionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec; + + /** + * Creates a plain object from a KeyVersionSpec message. Also converts values to other types if specified. + * @param message KeyVersionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyVersionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyVersionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + SELF_SIGNED = 1, + SUBORDINATE = 2 + } + + /** Tier enum. */ + enum Tier { + TIER_UNSPECIFIED = 0, + ENTERPRISE = 1, + DEVOPS = 2 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2, + PENDING_ACTIVATION = 3, + PENDING_DELETION = 4 + } + + /** SignHashAlgorithm enum. */ + enum SignHashAlgorithm { + SIGN_HASH_ALGORITHM_UNSPECIFIED = 0, + RSA_PSS_2048_SHA256 = 1, + RSA_PSS_3072_SHA256 = 2, + RSA_PSS_4096_SHA256 = 3, + RSA_PKCS1_2048_SHA256 = 6, + RSA_PKCS1_3072_SHA256 = 7, + RSA_PKCS1_4096_SHA256 = 8, + EC_P256_SHA256 = 4, + EC_P384_SHA384 = 5 + } + } + + /** Properties of a CertificateRevocationList. */ + interface ICertificateRevocationList { + + /** CertificateRevocationList name */ + name?: (string|null); + + /** CertificateRevocationList sequenceNumber */ + sequenceNumber?: (number|Long|string|null); + + /** CertificateRevocationList revokedCertificates */ + revokedCertificates?: (google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate[]|null); + + /** CertificateRevocationList pemCrl */ + pemCrl?: (string|null); + + /** CertificateRevocationList accessUrl */ + accessUrl?: (string|null); + + /** CertificateRevocationList state */ + state?: (google.cloud.security.privateca.v1beta1.CertificateRevocationList.State|keyof typeof google.cloud.security.privateca.v1beta1.CertificateRevocationList.State|null); + + /** CertificateRevocationList createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateRevocationList updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateRevocationList labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a CertificateRevocationList. */ + class CertificateRevocationList implements ICertificateRevocationList { + + /** + * Constructs a new CertificateRevocationList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.ICertificateRevocationList); + + /** CertificateRevocationList name. */ + public name: string; + + /** CertificateRevocationList sequenceNumber. */ + public sequenceNumber: (number|Long|string); + + /** CertificateRevocationList revokedCertificates. */ + public revokedCertificates: google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate[]; + + /** CertificateRevocationList pemCrl. */ + public pemCrl: string; + + /** CertificateRevocationList accessUrl. */ + public accessUrl: string; + + /** CertificateRevocationList state. */ + public state: (google.cloud.security.privateca.v1beta1.CertificateRevocationList.State|keyof typeof google.cloud.security.privateca.v1beta1.CertificateRevocationList.State); + + /** CertificateRevocationList createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateRevocationList updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateRevocationList labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new CertificateRevocationList instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateRevocationList instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.ICertificateRevocationList): google.cloud.security.privateca.v1beta1.CertificateRevocationList; + + /** + * Encodes the specified CertificateRevocationList message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify|verify} messages. + * @param message CertificateRevocationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.ICertificateRevocationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateRevocationList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify|verify} messages. + * @param message CertificateRevocationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICertificateRevocationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateRevocationList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateRevocationList + * @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.security.privateca.v1beta1.CertificateRevocationList; + + /** + * Decodes a CertificateRevocationList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateRevocationList + * @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.security.privateca.v1beta1.CertificateRevocationList; + + /** + * Verifies a CertificateRevocationList 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 CertificateRevocationList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateRevocationList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateRevocationList; + + /** + * Creates a plain object from a CertificateRevocationList message. Also converts values to other types if specified. + * @param message CertificateRevocationList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateRevocationList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateRevocationList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateRevocationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateRevocationList { + + /** Properties of a RevokedCertificate. */ + interface IRevokedCertificate { + + /** RevokedCertificate certificate */ + certificate?: (string|null); + + /** RevokedCertificate hexSerialNumber */ + hexSerialNumber?: (string|null); + + /** RevokedCertificate revocationReason */ + revocationReason?: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason|null); + } + + /** Represents a RevokedCertificate. */ + class RevokedCertificate implements IRevokedCertificate { + + /** + * Constructs a new RevokedCertificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate); + + /** RevokedCertificate certificate. */ + public certificate: string; + + /** RevokedCertificate hexSerialNumber. */ + public hexSerialNumber: string; + + /** RevokedCertificate revocationReason. */ + public revocationReason: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason); + + /** + * Creates a new RevokedCertificate instance using the specified properties. + * @param [properties] Properties to set + * @returns RevokedCertificate instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate): google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate; + + /** + * Encodes the specified RevokedCertificate message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. + * @param message RevokedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RevokedCertificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. + * @param message RevokedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RevokedCertificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RevokedCertificate + * @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.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate; + + /** + * Decodes a RevokedCertificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RevokedCertificate + * @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.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate; + + /** + * Verifies a RevokedCertificate 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 RevokedCertificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RevokedCertificate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate; + + /** + * Creates a plain object from a RevokedCertificate message. Also converts values to other types if specified. + * @param message RevokedCertificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RevokedCertificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RevokedCertificate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + SUPERSEDED = 2 + } + } + + /** Properties of a Certificate. */ + interface ICertificate { + + /** Certificate name */ + name?: (string|null); + + /** Certificate pemCsr */ + pemCsr?: (string|null); + + /** Certificate config */ + config?: (google.cloud.security.privateca.v1beta1.ICertificateConfig|null); + + /** Certificate lifetime */ + lifetime?: (google.protobuf.IDuration|null); + + /** Certificate revocationDetails */ + revocationDetails?: (google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails|null); + + /** Certificate pemCertificate */ + pemCertificate?: (string|null); + + /** Certificate certificateDescription */ + certificateDescription?: (google.cloud.security.privateca.v1beta1.ICertificateDescription|null); + + /** Certificate pemCertificateChain */ + pemCertificateChain?: (string[]|null); + + /** Certificate createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Certificate updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Certificate labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Certificate. */ + class Certificate implements ICertificate { + + /** + * Constructs a new Certificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.ICertificate); + + /** Certificate name. */ + public name: string; + + /** Certificate pemCsr. */ + public pemCsr?: (string|null); + + /** Certificate config. */ + public config?: (google.cloud.security.privateca.v1beta1.ICertificateConfig|null); + + /** Certificate lifetime. */ + public lifetime?: (google.protobuf.IDuration|null); + + /** Certificate revocationDetails. */ + public revocationDetails?: (google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails|null); + + /** Certificate pemCertificate. */ + public pemCertificate: string; + + /** Certificate certificateDescription. */ + public certificateDescription?: (google.cloud.security.privateca.v1beta1.ICertificateDescription|null); + + /** Certificate pemCertificateChain. */ + public pemCertificateChain: string[]; + + /** Certificate createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Certificate updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Certificate labels. */ + public labels: { [k: string]: string }; + + /** Certificate certificateConfig. */ + public certificateConfig?: ("pemCsr"|"config"); + + /** + * Creates a new Certificate instance using the specified properties. + * @param [properties] Properties to set + * @returns Certificate instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.ICertificate): google.cloud.security.privateca.v1beta1.Certificate; + + /** + * Encodes the specified Certificate message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.verify|verify} messages. + * @param message Certificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.ICertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Certificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.verify|verify} messages. + * @param message Certificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Certificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Certificate + * @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.security.privateca.v1beta1.Certificate; + + /** + * Decodes a Certificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Certificate + * @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.security.privateca.v1beta1.Certificate; + + /** + * Verifies a Certificate 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 Certificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Certificate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.Certificate; + + /** + * Creates a plain object from a Certificate message. Also converts values to other types if specified. + * @param message Certificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.Certificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Certificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Certificate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Certificate { + + /** Properties of a RevocationDetails. */ + interface IRevocationDetails { + + /** RevocationDetails revocationState */ + revocationState?: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason|null); + + /** RevocationDetails revocationTime */ + revocationTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RevocationDetails. */ + class RevocationDetails implements IRevocationDetails { + + /** + * Constructs a new RevocationDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails); + + /** RevocationDetails revocationState. */ + public revocationState: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason); + + /** RevocationDetails revocationTime. */ + public revocationTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new RevocationDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns RevocationDetails instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails): google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails; + + /** + * Encodes the specified RevocationDetails message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.verify|verify} messages. + * @param message RevocationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RevocationDetails message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.verify|verify} messages. + * @param message RevocationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RevocationDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RevocationDetails + * @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.security.privateca.v1beta1.Certificate.RevocationDetails; + + /** + * Decodes a RevocationDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RevocationDetails + * @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.security.privateca.v1beta1.Certificate.RevocationDetails; + + /** + * Verifies a RevocationDetails 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 RevocationDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RevocationDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails; + + /** + * Creates a plain object from a RevocationDetails message. Also converts values to other types if specified. + * @param message RevocationDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RevocationDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RevocationDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReusableConfig. */ + interface IReusableConfig { + + /** ReusableConfig name */ + name?: (string|null); + + /** ReusableConfig values */ + values?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); + + /** ReusableConfig description */ + description?: (string|null); + + /** ReusableConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ReusableConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ReusableConfig labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a ReusableConfig. */ + class ReusableConfig implements IReusableConfig { + + /** + * Constructs a new ReusableConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IReusableConfig); + + /** ReusableConfig name. */ + public name: string; + + /** ReusableConfig values. */ + public values?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); + + /** ReusableConfig description. */ + public description: string; + + /** ReusableConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ReusableConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ReusableConfig labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new ReusableConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ReusableConfig instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IReusableConfig): google.cloud.security.privateca.v1beta1.ReusableConfig; + + /** + * Encodes the specified ReusableConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfig.verify|verify} messages. + * @param message ReusableConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IReusableConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReusableConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfig.verify|verify} messages. + * @param message ReusableConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IReusableConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReusableConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReusableConfig + * @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.security.privateca.v1beta1.ReusableConfig; + + /** + * Decodes a ReusableConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReusableConfig + * @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.security.privateca.v1beta1.ReusableConfig; + + /** + * Verifies a ReusableConfig 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 ReusableConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReusableConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ReusableConfig; + + /** + * Creates a plain object from a ReusableConfig message. Also converts values to other types if specified. + * @param message ReusableConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ReusableConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReusableConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReusableConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReusableConfigValues. */ + interface IReusableConfigValues { + + /** ReusableConfigValues keyUsage */ + keyUsage?: (google.cloud.security.privateca.v1beta1.IKeyUsage|null); + + /** ReusableConfigValues caOptions */ + caOptions?: (google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions|null); + + /** ReusableConfigValues policyIds */ + policyIds?: (google.cloud.security.privateca.v1beta1.IObjectId[]|null); + + /** ReusableConfigValues aiaOcspServers */ + aiaOcspServers?: (string[]|null); + + /** ReusableConfigValues additionalExtensions */ + additionalExtensions?: (google.cloud.security.privateca.v1beta1.IX509Extension[]|null); + } + + /** Represents a ReusableConfigValues. */ + class ReusableConfigValues implements IReusableConfigValues { + + /** + * Constructs a new ReusableConfigValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IReusableConfigValues); + + /** ReusableConfigValues keyUsage. */ + public keyUsage?: (google.cloud.security.privateca.v1beta1.IKeyUsage|null); + + /** ReusableConfigValues caOptions. */ + public caOptions?: (google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions|null); + + /** ReusableConfigValues policyIds. */ + public policyIds: google.cloud.security.privateca.v1beta1.IObjectId[]; + + /** ReusableConfigValues aiaOcspServers. */ + public aiaOcspServers: string[]; + + /** ReusableConfigValues additionalExtensions. */ + public additionalExtensions: google.cloud.security.privateca.v1beta1.IX509Extension[]; + + /** + * Creates a new ReusableConfigValues instance using the specified properties. + * @param [properties] Properties to set + * @returns ReusableConfigValues instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IReusableConfigValues): google.cloud.security.privateca.v1beta1.ReusableConfigValues; + + /** + * Encodes the specified ReusableConfigValues message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify|verify} messages. + * @param message ReusableConfigValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IReusableConfigValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReusableConfigValues message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify|verify} messages. + * @param message ReusableConfigValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IReusableConfigValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReusableConfigValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReusableConfigValues + * @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.security.privateca.v1beta1.ReusableConfigValues; + + /** + * Decodes a ReusableConfigValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReusableConfigValues + * @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.security.privateca.v1beta1.ReusableConfigValues; + + /** + * Verifies a ReusableConfigValues 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 ReusableConfigValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReusableConfigValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ReusableConfigValues; + + /** + * Creates a plain object from a ReusableConfigValues message. Also converts values to other types if specified. + * @param message ReusableConfigValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ReusableConfigValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReusableConfigValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReusableConfigValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReusableConfigValues { + + /** Properties of a CaOptions. */ + interface ICaOptions { + + /** CaOptions isCa */ + isCa?: (google.protobuf.IBoolValue|null); + + /** CaOptions maxIssuerPathLength */ + maxIssuerPathLength?: (google.protobuf.IInt32Value|null); + } + + /** Represents a CaOptions. */ + class CaOptions implements ICaOptions { + + /** + * Constructs a new CaOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions); + + /** CaOptions isCa. */ + public isCa?: (google.protobuf.IBoolValue|null); + + /** CaOptions maxIssuerPathLength. */ + public maxIssuerPathLength?: (google.protobuf.IInt32Value|null); + + /** + * Creates a new CaOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CaOptions instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions): google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions; + + /** + * Encodes the specified CaOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.verify|verify} messages. + * @param message CaOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.verify|verify} messages. + * @param message CaOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaOptions + * @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.security.privateca.v1beta1.ReusableConfigValues.CaOptions; + + /** + * Decodes a CaOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaOptions + * @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.security.privateca.v1beta1.ReusableConfigValues.CaOptions; + + /** + * Verifies a CaOptions 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 CaOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions; + + /** + * Creates a plain object from a CaOptions message. Also converts values to other types if specified. + * @param message CaOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReusableConfigWrapper. */ + interface IReusableConfigWrapper { + + /** ReusableConfigWrapper reusableConfig */ + reusableConfig?: (string|null); + + /** ReusableConfigWrapper reusableConfigValues */ + reusableConfigValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); + } + + /** Represents a ReusableConfigWrapper. */ + class ReusableConfigWrapper implements IReusableConfigWrapper { + + /** + * Constructs a new ReusableConfigWrapper. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IReusableConfigWrapper); + + /** ReusableConfigWrapper reusableConfig. */ + public reusableConfig?: (string|null); + + /** ReusableConfigWrapper reusableConfigValues. */ + public reusableConfigValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); + + /** ReusableConfigWrapper configValues. */ + public configValues?: ("reusableConfig"|"reusableConfigValues"); + + /** + * Creates a new ReusableConfigWrapper instance using the specified properties. + * @param [properties] Properties to set + * @returns ReusableConfigWrapper instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IReusableConfigWrapper): google.cloud.security.privateca.v1beta1.ReusableConfigWrapper; + + /** + * Encodes the specified ReusableConfigWrapper message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify|verify} messages. + * @param message ReusableConfigWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IReusableConfigWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReusableConfigWrapper message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify|verify} messages. + * @param message ReusableConfigWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IReusableConfigWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReusableConfigWrapper message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReusableConfigWrapper + * @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.security.privateca.v1beta1.ReusableConfigWrapper; + + /** + * Decodes a ReusableConfigWrapper message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReusableConfigWrapper + * @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.security.privateca.v1beta1.ReusableConfigWrapper; + + /** + * Verifies a ReusableConfigWrapper 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 ReusableConfigWrapper message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReusableConfigWrapper + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ReusableConfigWrapper; + + /** + * Creates a plain object from a ReusableConfigWrapper message. Also converts values to other types if specified. + * @param message ReusableConfigWrapper + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ReusableConfigWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReusableConfigWrapper to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReusableConfigWrapper + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubordinateConfig. */ + interface ISubordinateConfig { + + /** SubordinateConfig certificateAuthority */ + certificateAuthority?: (string|null); + + /** SubordinateConfig pemIssuerChain */ + pemIssuerChain?: (google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain|null); + } + + /** Represents a SubordinateConfig. */ + class SubordinateConfig implements ISubordinateConfig { + + /** + * Constructs a new SubordinateConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.ISubordinateConfig); + + /** SubordinateConfig certificateAuthority. */ + public certificateAuthority?: (string|null); + + /** SubordinateConfig pemIssuerChain. */ + public pemIssuerChain?: (google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain|null); + + /** SubordinateConfig subordinateConfig. */ + public subordinateConfig?: ("certificateAuthority"|"pemIssuerChain"); + + /** + * Creates a new SubordinateConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SubordinateConfig instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.ISubordinateConfig): google.cloud.security.privateca.v1beta1.SubordinateConfig; + + /** + * Encodes the specified SubordinateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.verify|verify} messages. + * @param message SubordinateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.ISubordinateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubordinateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.verify|verify} messages. + * @param message SubordinateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ISubordinateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubordinateConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubordinateConfig + * @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.security.privateca.v1beta1.SubordinateConfig; + + /** + * Decodes a SubordinateConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubordinateConfig + * @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.security.privateca.v1beta1.SubordinateConfig; + + /** + * Verifies a SubordinateConfig 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 SubordinateConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubordinateConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.SubordinateConfig; + + /** + * Creates a plain object from a SubordinateConfig message. Also converts values to other types if specified. + * @param message SubordinateConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.SubordinateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubordinateConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubordinateConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SubordinateConfig { + + /** Properties of a SubordinateConfigChain. */ + interface ISubordinateConfigChain { + + /** SubordinateConfigChain pemCertificates */ + pemCertificates?: (string[]|null); + } + + /** Represents a SubordinateConfigChain. */ + class SubordinateConfigChain implements ISubordinateConfigChain { + + /** + * Constructs a new SubordinateConfigChain. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain); + + /** SubordinateConfigChain pemCertificates. */ + public pemCertificates: string[]; + + /** + * Creates a new SubordinateConfigChain instance using the specified properties. + * @param [properties] Properties to set + * @returns SubordinateConfigChain instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain): google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain; + + /** + * Encodes the specified SubordinateConfigChain message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. + * @param message SubordinateConfigChain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubordinateConfigChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. + * @param message SubordinateConfigChain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubordinateConfigChain message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubordinateConfigChain + * @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.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain; + + /** + * Decodes a SubordinateConfigChain message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubordinateConfigChain + * @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.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain; + + /** + * Verifies a SubordinateConfigChain 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 SubordinateConfigChain message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubordinateConfigChain + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain; + + /** + * Creates a plain object from a SubordinateConfigChain message. Also converts values to other types if specified. + * @param message SubordinateConfigChain + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubordinateConfigChain to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubordinateConfigChain + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PublicKey. */ + interface IPublicKey { + + /** PublicKey type */ + type?: (google.cloud.security.privateca.v1beta1.PublicKey.KeyType|keyof typeof google.cloud.security.privateca.v1beta1.PublicKey.KeyType|null); + + /** PublicKey key */ + key?: (Uint8Array|Buffer|string|null); + } + + /** Represents a PublicKey. */ + class PublicKey implements IPublicKey { + + /** + * Constructs a new PublicKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IPublicKey); + + /** PublicKey type. */ + public type: (google.cloud.security.privateca.v1beta1.PublicKey.KeyType|keyof typeof google.cloud.security.privateca.v1beta1.PublicKey.KeyType); + + /** PublicKey key. */ + public key: (Uint8Array|Buffer|string); + + /** + * Creates a new PublicKey instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicKey instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IPublicKey): google.cloud.security.privateca.v1beta1.PublicKey; + + /** + * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.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.security.privateca.v1beta1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.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.security.privateca.v1beta1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.security.privateca.v1beta1.PublicKey; + + /** + * 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.security.privateca.v1beta1.PublicKey; + + /** + * 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 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.security.privateca.v1beta1.PublicKey; + + /** + * 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.security.privateca.v1beta1.PublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublicKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublicKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PublicKey { + + /** KeyType enum. */ + enum KeyType { + KEY_TYPE_UNSPECIFIED = 0, + PEM_RSA_KEY = 1, + PEM_EC_KEY = 2 + } + } + + /** Properties of a CertificateConfig. */ + interface ICertificateConfig { + + /** CertificateConfig subjectConfig */ + subjectConfig?: (google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig|null); + + /** CertificateConfig reusableConfig */ + reusableConfig?: (google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null); + + /** CertificateConfig publicKey */ + publicKey?: (google.cloud.security.privateca.v1beta1.IPublicKey|null); + } + + /** Represents a CertificateConfig. */ + class CertificateConfig implements ICertificateConfig { + + /** + * Constructs a new CertificateConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.ICertificateConfig); + + /** CertificateConfig subjectConfig. */ + public subjectConfig?: (google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig|null); + + /** CertificateConfig reusableConfig. */ + public reusableConfig?: (google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null); + + /** CertificateConfig publicKey. */ + public publicKey?: (google.cloud.security.privateca.v1beta1.IPublicKey|null); + + /** + * Creates a new CertificateConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateConfig instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.ICertificateConfig): google.cloud.security.privateca.v1beta1.CertificateConfig; + + /** + * Encodes the specified CertificateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.verify|verify} messages. + * @param message CertificateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.ICertificateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.verify|verify} messages. + * @param message CertificateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICertificateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateConfig + * @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.security.privateca.v1beta1.CertificateConfig; + + /** + * Decodes a CertificateConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateConfig + * @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.security.privateca.v1beta1.CertificateConfig; + + /** + * Verifies a CertificateConfig 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 CertificateConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateConfig; + + /** + * Creates a plain object from a CertificateConfig message. Also converts values to other types if specified. + * @param message CertificateConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateConfig { + + /** Properties of a SubjectConfig. */ + interface ISubjectConfig { + + /** SubjectConfig subject */ + subject?: (google.cloud.security.privateca.v1beta1.ISubject|null); + + /** SubjectConfig commonName */ + commonName?: (string|null); + + /** SubjectConfig subjectAltName */ + subjectAltName?: (google.cloud.security.privateca.v1beta1.ISubjectAltNames|null); + } + + /** Represents a SubjectConfig. */ + class SubjectConfig implements ISubjectConfig { + + /** + * Constructs a new SubjectConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig); + + /** SubjectConfig subject. */ + public subject?: (google.cloud.security.privateca.v1beta1.ISubject|null); + + /** SubjectConfig commonName. */ + public commonName: string; + + /** SubjectConfig subjectAltName. */ + public subjectAltName?: (google.cloud.security.privateca.v1beta1.ISubjectAltNames|null); + + /** + * Creates a new SubjectConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SubjectConfig instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig): google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig; + + /** + * Encodes the specified SubjectConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.verify|verify} messages. + * @param message SubjectConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubjectConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.verify|verify} messages. + * @param message SubjectConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubjectConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubjectConfig + * @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.security.privateca.v1beta1.CertificateConfig.SubjectConfig; + + /** + * Decodes a SubjectConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubjectConfig + * @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.security.privateca.v1beta1.CertificateConfig.SubjectConfig; + + /** + * Verifies a SubjectConfig 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 SubjectConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubjectConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig; + + /** + * Creates a plain object from a SubjectConfig message. Also converts values to other types if specified. + * @param message SubjectConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubjectConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubjectConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CertificateDescription. */ + interface ICertificateDescription { + + /** CertificateDescription subjectDescription */ + subjectDescription?: (google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription|null); + + /** CertificateDescription configValues */ + configValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); + + /** CertificateDescription publicKey */ + publicKey?: (google.cloud.security.privateca.v1beta1.IPublicKey|null); + + /** CertificateDescription subjectKeyId */ + subjectKeyId?: (google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null); + + /** CertificateDescription authorityKeyId */ + authorityKeyId?: (google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null); + + /** CertificateDescription crlDistributionPoints */ + crlDistributionPoints?: (string[]|null); + + /** CertificateDescription aiaIssuingCertificateUrls */ + aiaIssuingCertificateUrls?: (string[]|null); + + /** CertificateDescription certFingerprint */ + certFingerprint?: (google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint|null); + } + + /** Represents a CertificateDescription. */ + class CertificateDescription implements ICertificateDescription { + + /** + * Constructs a new CertificateDescription. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.ICertificateDescription); + + /** CertificateDescription subjectDescription. */ + public subjectDescription?: (google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription|null); + + /** CertificateDescription configValues. */ + public configValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); + + /** CertificateDescription publicKey. */ + public publicKey?: (google.cloud.security.privateca.v1beta1.IPublicKey|null); + + /** CertificateDescription subjectKeyId. */ + public subjectKeyId?: (google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null); + + /** CertificateDescription authorityKeyId. */ + public authorityKeyId?: (google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null); + + /** CertificateDescription crlDistributionPoints. */ + public crlDistributionPoints: string[]; + + /** CertificateDescription aiaIssuingCertificateUrls. */ + public aiaIssuingCertificateUrls: string[]; + + /** CertificateDescription certFingerprint. */ + public certFingerprint?: (google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint|null); + + /** + * Creates a new CertificateDescription instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateDescription instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.ICertificateDescription): google.cloud.security.privateca.v1beta1.CertificateDescription; + + /** + * Encodes the specified CertificateDescription message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.verify|verify} messages. + * @param message CertificateDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.ICertificateDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.verify|verify} messages. + * @param message CertificateDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICertificateDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateDescription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateDescription + * @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.security.privateca.v1beta1.CertificateDescription; + + /** + * Decodes a CertificateDescription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateDescription + * @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.security.privateca.v1beta1.CertificateDescription; + + /** + * Verifies a CertificateDescription 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 CertificateDescription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateDescription + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateDescription; + + /** + * Creates a plain object from a CertificateDescription message. Also converts values to other types if specified. + * @param message CertificateDescription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateDescription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateDescription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateDescription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateDescription { + + /** Properties of a SubjectDescription. */ + interface ISubjectDescription { + + /** SubjectDescription subject */ + subject?: (google.cloud.security.privateca.v1beta1.ISubject|null); + + /** SubjectDescription commonName */ + commonName?: (string|null); + + /** SubjectDescription subjectAltName */ + subjectAltName?: (google.cloud.security.privateca.v1beta1.ISubjectAltNames|null); + + /** SubjectDescription hexSerialNumber */ + hexSerialNumber?: (string|null); + + /** SubjectDescription lifetime */ + lifetime?: (google.protobuf.IDuration|null); + + /** SubjectDescription notBeforeTime */ + notBeforeTime?: (google.protobuf.ITimestamp|null); + + /** SubjectDescription notAfterTime */ + notAfterTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SubjectDescription. */ + class SubjectDescription implements ISubjectDescription { + + /** + * Constructs a new SubjectDescription. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription); + + /** SubjectDescription subject. */ + public subject?: (google.cloud.security.privateca.v1beta1.ISubject|null); + + /** SubjectDescription commonName. */ + public commonName: string; + + /** SubjectDescription subjectAltName. */ + public subjectAltName?: (google.cloud.security.privateca.v1beta1.ISubjectAltNames|null); + + /** SubjectDescription hexSerialNumber. */ + public hexSerialNumber: string; + + /** SubjectDescription lifetime. */ + public lifetime?: (google.protobuf.IDuration|null); + + /** SubjectDescription notBeforeTime. */ + public notBeforeTime?: (google.protobuf.ITimestamp|null); + + /** SubjectDescription notAfterTime. */ + public notAfterTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SubjectDescription instance using the specified properties. + * @param [properties] Properties to set + * @returns SubjectDescription instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription): google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription; + + /** + * Encodes the specified SubjectDescription message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.verify|verify} messages. + * @param message SubjectDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubjectDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.verify|verify} messages. + * @param message SubjectDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubjectDescription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubjectDescription + * @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.security.privateca.v1beta1.CertificateDescription.SubjectDescription; + + /** + * Decodes a SubjectDescription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubjectDescription + * @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.security.privateca.v1beta1.CertificateDescription.SubjectDescription; + + /** + * Verifies a SubjectDescription 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 SubjectDescription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubjectDescription + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription; + + /** + * Creates a plain object from a SubjectDescription message. Also converts values to other types if specified. + * @param message SubjectDescription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubjectDescription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubjectDescription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyId. */ + interface IKeyId { + + /** KeyId keyId */ + keyId?: (string|null); + } + + /** Represents a KeyId. */ + class KeyId implements IKeyId { + + /** + * Constructs a new KeyId. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId); + + /** KeyId keyId. */ + public keyId: string; + + /** + * Creates a new KeyId instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyId instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId): google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId; + + /** + * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify|verify} messages. + * @param message KeyId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify|verify} messages. + * @param message KeyId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyId + * @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.security.privateca.v1beta1.CertificateDescription.KeyId; + + /** + * Decodes a KeyId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyId + * @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.security.privateca.v1beta1.CertificateDescription.KeyId; + + /** + * Verifies a KeyId 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 KeyId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyId + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId; + + /** + * Creates a plain object from a KeyId message. Also converts values to other types if specified. + * @param message KeyId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CertificateFingerprint. */ + interface ICertificateFingerprint { + + /** CertificateFingerprint sha256Hash */ + sha256Hash?: (string|null); + } + + /** Represents a CertificateFingerprint. */ + class CertificateFingerprint implements ICertificateFingerprint { + + /** + * Constructs a new CertificateFingerprint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint); + + /** CertificateFingerprint sha256Hash. */ + public sha256Hash: string; + + /** + * Creates a new CertificateFingerprint instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateFingerprint instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint): google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint; + + /** + * Encodes the specified CertificateFingerprint message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.verify|verify} messages. + * @param message CertificateFingerprint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateFingerprint message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.verify|verify} messages. + * @param message CertificateFingerprint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateFingerprint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateFingerprint + * @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.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint; + + /** + * Decodes a CertificateFingerprint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateFingerprint + * @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.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint; + + /** + * Verifies a CertificateFingerprint 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 CertificateFingerprint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateFingerprint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint; + + /** + * Creates a plain object from a CertificateFingerprint message. Also converts values to other types if specified. + * @param message CertificateFingerprint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateFingerprint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateFingerprint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ObjectId. */ + interface IObjectId { + + /** ObjectId objectIdPath */ + objectIdPath?: (number[]|null); + } + + /** Represents an ObjectId. */ + class ObjectId implements IObjectId { + + /** + * Constructs a new ObjectId. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IObjectId); + + /** ObjectId objectIdPath. */ + public objectIdPath: number[]; + + /** + * Creates a new ObjectId instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectId instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IObjectId): google.cloud.security.privateca.v1beta1.ObjectId; + + /** + * Encodes the specified ObjectId message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ObjectId.verify|verify} messages. + * @param message ObjectId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IObjectId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ObjectId.verify|verify} messages. + * @param message ObjectId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IObjectId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectId + * @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.security.privateca.v1beta1.ObjectId; + + /** + * Decodes an ObjectId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectId + * @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.security.privateca.v1beta1.ObjectId; + + /** + * Verifies an ObjectId 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 ObjectId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectId + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ObjectId; + + /** + * Creates a plain object from an ObjectId message. Also converts values to other types if specified. + * @param message ObjectId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ObjectId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a X509Extension. */ + interface IX509Extension { + + /** X509Extension objectId */ + objectId?: (google.cloud.security.privateca.v1beta1.IObjectId|null); + + /** X509Extension critical */ + critical?: (boolean|null); + + /** X509Extension value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a X509Extension. */ + class X509Extension implements IX509Extension { + + /** + * Constructs a new X509Extension. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IX509Extension); + + /** X509Extension objectId. */ + public objectId?: (google.cloud.security.privateca.v1beta1.IObjectId|null); + + /** X509Extension critical. */ + public critical: boolean; + + /** X509Extension value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new X509Extension instance using the specified properties. + * @param [properties] Properties to set + * @returns X509Extension instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IX509Extension): google.cloud.security.privateca.v1beta1.X509Extension; + + /** + * Encodes the specified X509Extension message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.X509Extension.verify|verify} messages. + * @param message X509Extension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IX509Extension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified X509Extension message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.X509Extension.verify|verify} messages. + * @param message X509Extension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IX509Extension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a X509Extension message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns X509Extension + * @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.security.privateca.v1beta1.X509Extension; + + /** + * Decodes a X509Extension message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns X509Extension + * @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.security.privateca.v1beta1.X509Extension; + + /** + * Verifies a X509Extension 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 X509Extension message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns X509Extension + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.X509Extension; + + /** + * Creates a plain object from a X509Extension message. Also converts values to other types if specified. + * @param message X509Extension + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.X509Extension, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this X509Extension to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for X509Extension + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyUsage. */ + interface IKeyUsage { + + /** KeyUsage baseKeyUsage */ + baseKeyUsage?: (google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions|null); + + /** KeyUsage extendedKeyUsage */ + extendedKeyUsage?: (google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions|null); + + /** KeyUsage unknownExtendedKeyUsages */ + unknownExtendedKeyUsages?: (google.cloud.security.privateca.v1beta1.IObjectId[]|null); + } + + /** Represents a KeyUsage. */ + class KeyUsage implements IKeyUsage { + + /** + * Constructs a new KeyUsage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IKeyUsage); + + /** KeyUsage baseKeyUsage. */ + public baseKeyUsage?: (google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions|null); + + /** KeyUsage extendedKeyUsage. */ + public extendedKeyUsage?: (google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions|null); + + /** KeyUsage unknownExtendedKeyUsages. */ + public unknownExtendedKeyUsages: google.cloud.security.privateca.v1beta1.IObjectId[]; + + /** + * Creates a new KeyUsage instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyUsage instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IKeyUsage): google.cloud.security.privateca.v1beta1.KeyUsage; + + /** + * Encodes the specified KeyUsage message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.verify|verify} messages. + * @param message KeyUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IKeyUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyUsage message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.verify|verify} messages. + * @param message KeyUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IKeyUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyUsage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyUsage + * @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.security.privateca.v1beta1.KeyUsage; + + /** + * Decodes a KeyUsage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyUsage + * @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.security.privateca.v1beta1.KeyUsage; + + /** + * Verifies a KeyUsage 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 KeyUsage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyUsage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.KeyUsage; + + /** + * Creates a plain object from a KeyUsage message. Also converts values to other types if specified. + * @param message KeyUsage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.KeyUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyUsage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyUsage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace KeyUsage { + + /** Properties of a KeyUsageOptions. */ + interface IKeyUsageOptions { + + /** KeyUsageOptions digitalSignature */ + digitalSignature?: (boolean|null); + + /** KeyUsageOptions contentCommitment */ + contentCommitment?: (boolean|null); + + /** KeyUsageOptions keyEncipherment */ + keyEncipherment?: (boolean|null); + + /** KeyUsageOptions dataEncipherment */ + dataEncipherment?: (boolean|null); + + /** KeyUsageOptions keyAgreement */ + keyAgreement?: (boolean|null); + + /** KeyUsageOptions certSign */ + certSign?: (boolean|null); + + /** KeyUsageOptions crlSign */ + crlSign?: (boolean|null); + + /** KeyUsageOptions encipherOnly */ + encipherOnly?: (boolean|null); + + /** KeyUsageOptions decipherOnly */ + decipherOnly?: (boolean|null); + } + + /** Represents a KeyUsageOptions. */ + class KeyUsageOptions implements IKeyUsageOptions { + + /** + * Constructs a new KeyUsageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions); + + /** KeyUsageOptions digitalSignature. */ + public digitalSignature: boolean; + + /** KeyUsageOptions contentCommitment. */ + public contentCommitment: boolean; + + /** KeyUsageOptions keyEncipherment. */ + public keyEncipherment: boolean; + + /** KeyUsageOptions dataEncipherment. */ + public dataEncipherment: boolean; + + /** KeyUsageOptions keyAgreement. */ + public keyAgreement: boolean; + + /** KeyUsageOptions certSign. */ + public certSign: boolean; + + /** KeyUsageOptions crlSign. */ + public crlSign: boolean; + + /** KeyUsageOptions encipherOnly. */ + public encipherOnly: boolean; + + /** KeyUsageOptions decipherOnly. */ + public decipherOnly: boolean; + + /** + * Creates a new KeyUsageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyUsageOptions instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions): google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions; + + /** + * Encodes the specified KeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.verify|verify} messages. + * @param message KeyUsageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.verify|verify} messages. + * @param message KeyUsageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyUsageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyUsageOptions + * @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.security.privateca.v1beta1.KeyUsage.KeyUsageOptions; + + /** + * Decodes a KeyUsageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyUsageOptions + * @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.security.privateca.v1beta1.KeyUsage.KeyUsageOptions; + + /** + * Verifies a KeyUsageOptions 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 KeyUsageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyUsageOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions; + + /** + * Creates a plain object from a KeyUsageOptions message. Also converts values to other types if specified. + * @param message KeyUsageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyUsageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyUsageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExtendedKeyUsageOptions. */ + interface IExtendedKeyUsageOptions { + + /** ExtendedKeyUsageOptions serverAuth */ + serverAuth?: (boolean|null); + + /** ExtendedKeyUsageOptions clientAuth */ + clientAuth?: (boolean|null); + + /** ExtendedKeyUsageOptions codeSigning */ + codeSigning?: (boolean|null); + + /** ExtendedKeyUsageOptions emailProtection */ + emailProtection?: (boolean|null); + + /** ExtendedKeyUsageOptions timeStamping */ + timeStamping?: (boolean|null); + + /** ExtendedKeyUsageOptions ocspSigning */ + ocspSigning?: (boolean|null); + } + + /** Represents an ExtendedKeyUsageOptions. */ + class ExtendedKeyUsageOptions implements IExtendedKeyUsageOptions { + + /** + * Constructs a new ExtendedKeyUsageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions); + + /** ExtendedKeyUsageOptions serverAuth. */ + public serverAuth: boolean; + + /** ExtendedKeyUsageOptions clientAuth. */ + public clientAuth: boolean; + + /** ExtendedKeyUsageOptions codeSigning. */ + public codeSigning: boolean; + + /** ExtendedKeyUsageOptions emailProtection. */ + public emailProtection: boolean; + + /** ExtendedKeyUsageOptions timeStamping. */ + public timeStamping: boolean; + + /** ExtendedKeyUsageOptions ocspSigning. */ + public ocspSigning: boolean; + + /** + * Creates a new ExtendedKeyUsageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtendedKeyUsageOptions instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions): google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions; + + /** + * Encodes the specified ExtendedKeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. + * @param message ExtendedKeyUsageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtendedKeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. + * @param message ExtendedKeyUsageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtendedKeyUsageOptions + * @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.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions; + + /** + * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtendedKeyUsageOptions + * @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.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions; + + /** + * Verifies an ExtendedKeyUsageOptions 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 ExtendedKeyUsageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtendedKeyUsageOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions; + + /** + * Creates a plain object from an ExtendedKeyUsageOptions message. Also converts values to other types if specified. + * @param message ExtendedKeyUsageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtendedKeyUsageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtendedKeyUsageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Subject. */ + interface ISubject { + + /** Subject countryCode */ + countryCode?: (string|null); + + /** Subject organization */ + organization?: (string|null); + + /** Subject organizationalUnit */ + organizationalUnit?: (string|null); + + /** Subject locality */ + locality?: (string|null); + + /** Subject province */ + province?: (string|null); + + /** Subject streetAddress */ + streetAddress?: (string|null); + + /** Subject postalCode */ + postalCode?: (string|null); + } + + /** Represents a Subject. */ + class Subject implements ISubject { + + /** + * Constructs a new Subject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.ISubject); + + /** Subject countryCode. */ + public countryCode: string; + + /** Subject organization. */ + public organization: string; + + /** Subject organizationalUnit. */ + public organizationalUnit: string; + + /** Subject locality. */ + public locality: string; + + /** Subject province. */ + public province: string; + + /** Subject streetAddress. */ + public streetAddress: string; + + /** Subject postalCode. */ + public postalCode: string; + + /** + * Creates a new Subject instance using the specified properties. + * @param [properties] Properties to set + * @returns Subject instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.ISubject): google.cloud.security.privateca.v1beta1.Subject; + + /** + * Encodes the specified Subject message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Subject.verify|verify} messages. + * @param message Subject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Subject.verify|verify} messages. + * @param message Subject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Subject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Subject + * @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.security.privateca.v1beta1.Subject; + + /** + * Decodes a Subject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Subject + * @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.security.privateca.v1beta1.Subject; + + /** + * Verifies a Subject 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 Subject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Subject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.Subject; + + /** + * Creates a plain object from a Subject message. Also converts values to other types if specified. + * @param message Subject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.Subject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Subject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Subject + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubjectAltNames. */ + interface ISubjectAltNames { + + /** SubjectAltNames dnsNames */ + dnsNames?: (string[]|null); + + /** SubjectAltNames uris */ + uris?: (string[]|null); + + /** SubjectAltNames emailAddresses */ + emailAddresses?: (string[]|null); + + /** SubjectAltNames ipAddresses */ + ipAddresses?: (string[]|null); + + /** SubjectAltNames customSans */ + customSans?: (google.cloud.security.privateca.v1beta1.IX509Extension[]|null); + } + + /** Represents a SubjectAltNames. */ + class SubjectAltNames implements ISubjectAltNames { + + /** + * Constructs a new SubjectAltNames. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.ISubjectAltNames); + + /** SubjectAltNames dnsNames. */ + public dnsNames: string[]; + + /** SubjectAltNames uris. */ + public uris: string[]; + + /** SubjectAltNames emailAddresses. */ + public emailAddresses: string[]; + + /** SubjectAltNames ipAddresses. */ + public ipAddresses: string[]; + + /** SubjectAltNames customSans. */ + public customSans: google.cloud.security.privateca.v1beta1.IX509Extension[]; + + /** + * Creates a new SubjectAltNames instance using the specified properties. + * @param [properties] Properties to set + * @returns SubjectAltNames instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.ISubjectAltNames): google.cloud.security.privateca.v1beta1.SubjectAltNames; + + /** + * Encodes the specified SubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubjectAltNames.verify|verify} messages. + * @param message SubjectAltNames message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.ISubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubjectAltNames.verify|verify} messages. + * @param message SubjectAltNames message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ISubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubjectAltNames message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubjectAltNames + * @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.security.privateca.v1beta1.SubjectAltNames; + + /** + * Decodes a SubjectAltNames message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubjectAltNames + * @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.security.privateca.v1beta1.SubjectAltNames; + + /** + * Verifies a SubjectAltNames 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 SubjectAltNames message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubjectAltNames + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.SubjectAltNames; + + /** + * Creates a plain object from a SubjectAltNames message. Also converts values to other types if specified. + * @param message SubjectAltNames + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.SubjectAltNames, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubjectAltNames to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubjectAltNames + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RevocationReason enum. */ + enum RevocationReason { + REVOCATION_REASON_UNSPECIFIED = 0, + KEY_COMPROMISE = 1, + CERTIFICATE_AUTHORITY_COMPROMISE = 2, + AFFILIATION_CHANGED = 3, + SUPERSEDED = 4, + CESSATION_OF_OPERATION = 5, + CERTIFICATE_HOLD = 6, + PRIVILEGE_WITHDRAWN = 7, + ATTRIBUTE_AUTHORITY_COMPROMISE = 8 + } + + /** Represents a CertificateAuthorityService */ + class CertificateAuthorityService extends $protobuf.rpc.Service { + + /** + * Constructs a new CertificateAuthorityService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new CertificateAuthorityService 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): CertificateAuthorityService; + + /** + * Calls CreateCertificate. + * @param request CreateCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Certificate + */ + public createCertificate(request: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateCallback): void; + + /** + * Calls CreateCertificate. + * @param request CreateCertificateRequest message or plain object + * @returns Promise + */ + public createCertificate(request: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest): Promise; + + /** + * Calls GetCertificate. + * @param request GetCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Certificate + */ + public getCertificate(request: google.cloud.security.privateca.v1beta1.IGetCertificateRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateCallback): void; + + /** + * Calls GetCertificate. + * @param request GetCertificateRequest message or plain object + * @returns Promise + */ + public getCertificate(request: google.cloud.security.privateca.v1beta1.IGetCertificateRequest): Promise; + + /** + * Calls ListCertificates. + * @param request ListCertificatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCertificatesResponse + */ + public listCertificates(request: google.cloud.security.privateca.v1beta1.IListCertificatesRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificatesCallback): void; + + /** + * Calls ListCertificates. + * @param request ListCertificatesRequest message or plain object + * @returns Promise + */ + public listCertificates(request: google.cloud.security.privateca.v1beta1.IListCertificatesRequest): Promise; + + /** + * Calls RevokeCertificate. + * @param request RevokeCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Certificate + */ + public revokeCertificate(request: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificateCallback): void; + + /** + * Calls RevokeCertificate. + * @param request RevokeCertificateRequest message or plain object + * @returns Promise + */ + public revokeCertificate(request: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest): Promise; + + /** + * Calls UpdateCertificate. + * @param request UpdateCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Certificate + */ + public updateCertificate(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateCallback): void; + + /** + * Calls UpdateCertificate. + * @param request UpdateCertificateRequest message or plain object + * @returns Promise + */ + public updateCertificate(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest): Promise; + + /** + * Calls ActivateCertificateAuthority. + * @param request ActivateCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public activateCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthorityCallback): void; + + /** + * Calls ActivateCertificateAuthority. + * @param request ActivateCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public activateCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest): Promise; + + /** + * Calls CreateCertificateAuthority. + * @param request CreateCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCertificateAuthority(request: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthorityCallback): void; + + /** + * Calls CreateCertificateAuthority. + * @param request CreateCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public createCertificateAuthority(request: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest): Promise; + + /** + * Calls DisableCertificateAuthority. + * @param request DisableCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public disableCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthorityCallback): void; + + /** + * Calls DisableCertificateAuthority. + * @param request DisableCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public disableCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest): Promise; + + /** + * Calls EnableCertificateAuthority. + * @param request EnableCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public enableCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthorityCallback): void; + + /** + * Calls EnableCertificateAuthority. + * @param request EnableCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public enableCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest): Promise; + + /** + * Calls FetchCertificateAuthorityCsr. + * @param request FetchCertificateAuthorityCsrRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchCertificateAuthorityCsrResponse + */ + public fetchCertificateAuthorityCsr(request: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsrCallback): void; + + /** + * Calls FetchCertificateAuthorityCsr. + * @param request FetchCertificateAuthorityCsrRequest message or plain object + * @returns Promise + */ + public fetchCertificateAuthorityCsr(request: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest): Promise; + + /** + * Calls GetCertificateAuthority. + * @param request GetCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CertificateAuthority + */ + public getCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthorityCallback): void; + + /** + * Calls GetCertificateAuthority. + * @param request GetCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public getCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest): Promise; + + /** + * Calls ListCertificateAuthorities. + * @param request ListCertificateAuthoritiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCertificateAuthoritiesResponse + */ + public listCertificateAuthorities(request: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthoritiesCallback): void; + + /** + * Calls ListCertificateAuthorities. + * @param request ListCertificateAuthoritiesRequest message or plain object + * @returns Promise + */ + public listCertificateAuthorities(request: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest): Promise; + + /** + * Calls RestoreCertificateAuthority. + * @param request RestoreCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthorityCallback): void; + + /** + * Calls RestoreCertificateAuthority. + * @param request RestoreCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public restoreCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest): Promise; + + /** + * Calls ScheduleDeleteCertificateAuthority. + * @param request ScheduleDeleteCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public scheduleDeleteCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthorityCallback): void; + + /** + * Calls ScheduleDeleteCertificateAuthority. + * @param request ScheduleDeleteCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public scheduleDeleteCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest): Promise; + + /** + * Calls UpdateCertificateAuthority. + * @param request UpdateCertificateAuthorityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthorityCallback): void; + + /** + * Calls UpdateCertificateAuthority. + * @param request UpdateCertificateAuthorityRequest message or plain object + * @returns Promise + */ + public updateCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest): Promise; + + /** + * Calls GetCertificateRevocationList. + * @param request GetCertificateRevocationListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CertificateRevocationList + */ + public getCertificateRevocationList(request: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationListCallback): void; + + /** + * Calls GetCertificateRevocationList. + * @param request GetCertificateRevocationListRequest message or plain object + * @returns Promise + */ + public getCertificateRevocationList(request: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest): Promise; + + /** + * Calls ListCertificateRevocationLists. + * @param request ListCertificateRevocationListsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCertificateRevocationListsResponse + */ + public listCertificateRevocationLists(request: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationListsCallback): void; + + /** + * Calls ListCertificateRevocationLists. + * @param request ListCertificateRevocationListsRequest message or plain object + * @returns Promise + */ + public listCertificateRevocationLists(request: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest): Promise; + + /** + * Calls UpdateCertificateRevocationList. + * @param request UpdateCertificateRevocationListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCertificateRevocationList(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationListCallback): void; + + /** + * Calls UpdateCertificateRevocationList. + * @param request UpdateCertificateRevocationListRequest message or plain object + * @returns Promise + */ + public updateCertificateRevocationList(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest): Promise; + + /** + * Calls GetReusableConfig. + * @param request GetReusableConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReusableConfig + */ + public getReusableConfig(request: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfigCallback): void; + + /** + * Calls GetReusableConfig. + * @param request GetReusableConfigRequest message or plain object + * @returns Promise + */ + public getReusableConfig(request: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest): Promise; + + /** + * Calls ListReusableConfigs. + * @param request ListReusableConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReusableConfigsResponse + */ + public listReusableConfigs(request: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigsCallback): void; + + /** + * Calls ListReusableConfigs. + * @param request ListReusableConfigsRequest message or plain object + * @returns Promise + */ + public listReusableConfigs(request: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest): Promise; + } + + namespace CertificateAuthorityService { + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|createCertificate}. + * @param error Error, if any + * @param [response] Certificate + */ + type CreateCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.Certificate) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificate}. + * @param error Error, if any + * @param [response] Certificate + */ + type GetCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.Certificate) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificates}. + * @param error Error, if any + * @param [response] ListCertificatesResponse + */ + type ListCertificatesCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.ListCertificatesResponse) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|revokeCertificate}. + * @param error Error, if any + * @param [response] Certificate + */ + type RevokeCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.Certificate) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificate}. + * @param error Error, if any + * @param [response] Certificate + */ + type UpdateCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.Certificate) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|activateCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type ActivateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|createCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|disableCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type DisableCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|enableCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type EnableCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|fetchCertificateAuthorityCsr}. + * @param error Error, if any + * @param [response] FetchCertificateAuthorityCsrResponse + */ + type FetchCertificateAuthorityCsrCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificateAuthority}. + * @param error Error, if any + * @param [response] CertificateAuthority + */ + type GetCertificateAuthorityCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.CertificateAuthority) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificateAuthorities}. + * @param error Error, if any + * @param [response] ListCertificateAuthoritiesResponse + */ + type ListCertificateAuthoritiesCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|restoreCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|scheduleDeleteCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type ScheduleDeleteCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificateAuthority}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificateRevocationList}. + * @param error Error, if any + * @param [response] CertificateRevocationList + */ + type GetCertificateRevocationListCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.CertificateRevocationList) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificateRevocationLists}. + * @param error Error, if any + * @param [response] ListCertificateRevocationListsResponse + */ + type ListCertificateRevocationListsCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificateRevocationList}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCertificateRevocationListCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getReusableConfig}. + * @param error Error, if any + * @param [response] ReusableConfig + */ + type GetReusableConfigCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.ReusableConfig) => void; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listReusableConfigs}. + * @param error Error, if any + * @param [response] ListReusableConfigsResponse + */ + type ListReusableConfigsCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse) => void; + } + + /** Properties of a CreateCertificateRequest. */ + interface ICreateCertificateRequest { + + /** CreateCertificateRequest parent */ + parent?: (string|null); + + /** CreateCertificateRequest certificateId */ + certificateId?: (string|null); + + /** CreateCertificateRequest certificate */ + certificate?: (google.cloud.security.privateca.v1beta1.ICertificate|null); + + /** CreateCertificateRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateCertificateRequest. */ + class CreateCertificateRequest implements ICreateCertificateRequest { + + /** + * Constructs a new CreateCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest); + + /** CreateCertificateRequest parent. */ + public parent: string; + + /** CreateCertificateRequest certificateId. */ + public certificateId: string; + + /** CreateCertificateRequest certificate. */ + public certificate?: (google.cloud.security.privateca.v1beta1.ICertificate|null); + + /** CreateCertificateRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCertificateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest): google.cloud.security.privateca.v1beta1.CreateCertificateRequest; + + /** + * Encodes the specified CreateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateRequest.verify|verify} messages. + * @param message CreateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateRequest.verify|verify} messages. + * @param message CreateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCertificateRequest + * @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.security.privateca.v1beta1.CreateCertificateRequest; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCertificateRequest + * @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.security.privateca.v1beta1.CreateCertificateRequest; + + /** + * Verifies a CreateCertificateRequest 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 CreateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CreateCertificateRequest; + + /** + * Creates a plain object from a CreateCertificateRequest message. Also converts values to other types if specified. + * @param message CreateCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CreateCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCertificateRequest. */ + interface IGetCertificateRequest { + + /** GetCertificateRequest name */ + name?: (string|null); + } + + /** Represents a GetCertificateRequest. */ + class GetCertificateRequest implements IGetCertificateRequest { + + /** + * Constructs a new GetCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateRequest); + + /** GetCertificateRequest name. */ + public name: string; + + /** + * Creates a new GetCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCertificateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateRequest): google.cloud.security.privateca.v1beta1.GetCertificateRequest; + + /** + * Encodes the specified GetCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRequest.verify|verify} messages. + * @param message GetCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IGetCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRequest.verify|verify} messages. + * @param message GetCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IGetCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCertificateRequest + * @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.security.privateca.v1beta1.GetCertificateRequest; + + /** + * Decodes a GetCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCertificateRequest + * @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.security.privateca.v1beta1.GetCertificateRequest; + + /** + * Verifies a GetCertificateRequest 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 GetCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.GetCertificateRequest; + + /** + * Creates a plain object from a GetCertificateRequest message. Also converts values to other types if specified. + * @param message GetCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.GetCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificatesRequest. */ + interface IListCertificatesRequest { + + /** ListCertificatesRequest parent */ + parent?: (string|null); + + /** ListCertificatesRequest pageSize */ + pageSize?: (number|null); + + /** ListCertificatesRequest pageToken */ + pageToken?: (string|null); + + /** ListCertificatesRequest filter */ + filter?: (string|null); + + /** ListCertificatesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCertificatesRequest. */ + class ListCertificatesRequest implements IListCertificatesRequest { + + /** + * Constructs a new ListCertificatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificatesRequest); + + /** ListCertificatesRequest parent. */ + public parent: string; + + /** ListCertificatesRequest pageSize. */ + public pageSize: number; + + /** ListCertificatesRequest pageToken. */ + public pageToken: string; + + /** ListCertificatesRequest filter. */ + public filter: string; + + /** ListCertificatesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCertificatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificatesRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificatesRequest): google.cloud.security.privateca.v1beta1.ListCertificatesRequest; + + /** + * Encodes the specified ListCertificatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesRequest.verify|verify} messages. + * @param message ListCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesRequest.verify|verify} messages. + * @param message ListCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificatesRequest + * @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.security.privateca.v1beta1.ListCertificatesRequest; + + /** + * Decodes a ListCertificatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificatesRequest + * @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.security.privateca.v1beta1.ListCertificatesRequest; + + /** + * Verifies a ListCertificatesRequest 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 ListCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificatesRequest; + + /** + * Creates a plain object from a ListCertificatesRequest message. Also converts values to other types if specified. + * @param message ListCertificatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificatesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificatesResponse. */ + interface IListCertificatesResponse { + + /** ListCertificatesResponse certificates */ + certificates?: (google.cloud.security.privateca.v1beta1.ICertificate[]|null); + + /** ListCertificatesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCertificatesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCertificatesResponse. */ + class ListCertificatesResponse implements IListCertificatesResponse { + + /** + * Constructs a new ListCertificatesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificatesResponse); + + /** ListCertificatesResponse certificates. */ + public certificates: google.cloud.security.privateca.v1beta1.ICertificate[]; + + /** ListCertificatesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCertificatesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCertificatesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificatesResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificatesResponse): google.cloud.security.privateca.v1beta1.ListCertificatesResponse; + + /** + * Encodes the specified ListCertificatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesResponse.verify|verify} messages. + * @param message ListCertificatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesResponse.verify|verify} messages. + * @param message ListCertificatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificatesResponse + * @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.security.privateca.v1beta1.ListCertificatesResponse; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificatesResponse + * @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.security.privateca.v1beta1.ListCertificatesResponse; + + /** + * Verifies a ListCertificatesResponse 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 ListCertificatesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificatesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificatesResponse; + + /** + * Creates a plain object from a ListCertificatesResponse message. Also converts values to other types if specified. + * @param message ListCertificatesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificatesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificatesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RevokeCertificateRequest. */ + interface IRevokeCertificateRequest { + + /** RevokeCertificateRequest name */ + name?: (string|null); + + /** RevokeCertificateRequest reason */ + reason?: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason|null); + + /** RevokeCertificateRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RevokeCertificateRequest. */ + class RevokeCertificateRequest implements IRevokeCertificateRequest { + + /** + * Constructs a new RevokeCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest); + + /** RevokeCertificateRequest name. */ + public name: string; + + /** RevokeCertificateRequest reason. */ + public reason: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason); + + /** RevokeCertificateRequest requestId. */ + public requestId: string; + + /** + * Creates a new RevokeCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RevokeCertificateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest): google.cloud.security.privateca.v1beta1.RevokeCertificateRequest; + + /** + * Encodes the specified RevokeCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RevokeCertificateRequest.verify|verify} messages. + * @param message RevokeCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RevokeCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RevokeCertificateRequest.verify|verify} messages. + * @param message RevokeCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RevokeCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RevokeCertificateRequest + * @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.security.privateca.v1beta1.RevokeCertificateRequest; + + /** + * Decodes a RevokeCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RevokeCertificateRequest + * @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.security.privateca.v1beta1.RevokeCertificateRequest; + + /** + * Verifies a RevokeCertificateRequest 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 RevokeCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RevokeCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.RevokeCertificateRequest; + + /** + * Creates a plain object from a RevokeCertificateRequest message. Also converts values to other types if specified. + * @param message RevokeCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.RevokeCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RevokeCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RevokeCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCertificateRequest. */ + interface IUpdateCertificateRequest { + + /** UpdateCertificateRequest certificate */ + certificate?: (google.cloud.security.privateca.v1beta1.ICertificate|null); + + /** UpdateCertificateRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateCertificateRequest. */ + class UpdateCertificateRequest implements IUpdateCertificateRequest { + + /** + * Constructs a new UpdateCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest); + + /** UpdateCertificateRequest certificate. */ + public certificate?: (google.cloud.security.privateca.v1beta1.ICertificate|null); + + /** UpdateCertificateRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCertificateRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest): google.cloud.security.privateca.v1beta1.UpdateCertificateRequest; + + /** + * Encodes the specified UpdateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.verify|verify} messages. + * @param message UpdateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.verify|verify} messages. + * @param message UpdateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCertificateRequest + * @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.security.privateca.v1beta1.UpdateCertificateRequest; + + /** + * Decodes an UpdateCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCertificateRequest + * @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.security.privateca.v1beta1.UpdateCertificateRequest; + + /** + * Verifies an UpdateCertificateRequest 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 UpdateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.UpdateCertificateRequest; + + /** + * Creates a plain object from an UpdateCertificateRequest message. Also converts values to other types if specified. + * @param message UpdateCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.UpdateCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActivateCertificateAuthorityRequest. */ + interface IActivateCertificateAuthorityRequest { + + /** ActivateCertificateAuthorityRequest name */ + name?: (string|null); + + /** ActivateCertificateAuthorityRequest pemCaCertificate */ + pemCaCertificate?: (string|null); + + /** ActivateCertificateAuthorityRequest subordinateConfig */ + subordinateConfig?: (google.cloud.security.privateca.v1beta1.ISubordinateConfig|null); + + /** ActivateCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents an ActivateCertificateAuthorityRequest. */ + class ActivateCertificateAuthorityRequest implements IActivateCertificateAuthorityRequest { + + /** + * Constructs a new ActivateCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest); + + /** ActivateCertificateAuthorityRequest name. */ + public name: string; + + /** ActivateCertificateAuthorityRequest pemCaCertificate. */ + public pemCaCertificate: string; + + /** ActivateCertificateAuthorityRequest subordinateConfig. */ + public subordinateConfig?: (google.cloud.security.privateca.v1beta1.ISubordinateConfig|null); + + /** ActivateCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new ActivateCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ActivateCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest; + + /** + * Encodes the specified ActivateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest.verify|verify} messages. + * @param message ActivateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActivateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest.verify|verify} messages. + * @param message ActivateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActivateCertificateAuthorityRequest + * @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.security.privateca.v1beta1.ActivateCertificateAuthorityRequest; + + /** + * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActivateCertificateAuthorityRequest + * @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.security.privateca.v1beta1.ActivateCertificateAuthorityRequest; + + /** + * Verifies an ActivateCertificateAuthorityRequest 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 ActivateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActivateCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest; + + /** + * Creates a plain object from an ActivateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message ActivateCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActivateCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActivateCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCertificateAuthorityRequest. */ + interface ICreateCertificateAuthorityRequest { + + /** CreateCertificateAuthorityRequest parent */ + parent?: (string|null); + + /** CreateCertificateAuthorityRequest certificateAuthorityId */ + certificateAuthorityId?: (string|null); + + /** CreateCertificateAuthorityRequest certificateAuthority */ + certificateAuthority?: (google.cloud.security.privateca.v1beta1.ICertificateAuthority|null); + + /** CreateCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateCertificateAuthorityRequest. */ + class CreateCertificateAuthorityRequest implements ICreateCertificateAuthorityRequest { + + /** + * Constructs a new CreateCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest); + + /** CreateCertificateAuthorityRequest parent. */ + public parent: string; + + /** CreateCertificateAuthorityRequest certificateAuthorityId. */ + public certificateAuthorityId: string; + + /** CreateCertificateAuthorityRequest certificateAuthority. */ + public certificateAuthority?: (google.cloud.security.privateca.v1beta1.ICertificateAuthority|null); + + /** CreateCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest; + + /** + * Encodes the specified CreateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest.verify|verify} messages. + * @param message CreateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest.verify|verify} messages. + * @param message CreateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCertificateAuthorityRequest + * @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.security.privateca.v1beta1.CreateCertificateAuthorityRequest; + + /** + * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCertificateAuthorityRequest + * @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.security.privateca.v1beta1.CreateCertificateAuthorityRequest; + + /** + * Verifies a CreateCertificateAuthorityRequest 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 CreateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest; + + /** + * Creates a plain object from a CreateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message CreateCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisableCertificateAuthorityRequest. */ + interface IDisableCertificateAuthorityRequest { + + /** DisableCertificateAuthorityRequest name */ + name?: (string|null); + + /** DisableCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DisableCertificateAuthorityRequest. */ + class DisableCertificateAuthorityRequest implements IDisableCertificateAuthorityRequest { + + /** + * Constructs a new DisableCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest); + + /** DisableCertificateAuthorityRequest name. */ + public name: string; + + /** DisableCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new DisableCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest; + + /** + * Encodes the specified DisableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest.verify|verify} messages. + * @param message DisableCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest.verify|verify} messages. + * @param message DisableCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableCertificateAuthorityRequest + * @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.security.privateca.v1beta1.DisableCertificateAuthorityRequest; + + /** + * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableCertificateAuthorityRequest + * @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.security.privateca.v1beta1.DisableCertificateAuthorityRequest; + + /** + * Verifies a DisableCertificateAuthorityRequest 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 DisableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest; + + /** + * Creates a plain object from a DisableCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message DisableCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisableCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnableCertificateAuthorityRequest. */ + interface IEnableCertificateAuthorityRequest { + + /** EnableCertificateAuthorityRequest name */ + name?: (string|null); + + /** EnableCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents an EnableCertificateAuthorityRequest. */ + class EnableCertificateAuthorityRequest implements IEnableCertificateAuthorityRequest { + + /** + * Constructs a new EnableCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest); + + /** EnableCertificateAuthorityRequest name. */ + public name: string; + + /** EnableCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new EnableCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest; + + /** + * Encodes the specified EnableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest.verify|verify} messages. + * @param message EnableCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest.verify|verify} messages. + * @param message EnableCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableCertificateAuthorityRequest + * @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.security.privateca.v1beta1.EnableCertificateAuthorityRequest; + + /** + * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableCertificateAuthorityRequest + * @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.security.privateca.v1beta1.EnableCertificateAuthorityRequest; + + /** + * Verifies an EnableCertificateAuthorityRequest 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 EnableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest; + + /** + * Creates a plain object from an EnableCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message EnableCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnableCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchCertificateAuthorityCsrRequest. */ + interface IFetchCertificateAuthorityCsrRequest { + + /** FetchCertificateAuthorityCsrRequest name */ + name?: (string|null); + } + + /** Represents a FetchCertificateAuthorityCsrRequest. */ + class FetchCertificateAuthorityCsrRequest implements IFetchCertificateAuthorityCsrRequest { + + /** + * Constructs a new FetchCertificateAuthorityCsrRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest); + + /** FetchCertificateAuthorityCsrRequest name. */ + public name: string; + + /** + * Creates a new FetchCertificateAuthorityCsrRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchCertificateAuthorityCsrRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest): google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest; + + /** + * Encodes the specified FetchCertificateAuthorityCsrRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. + * @param message FetchCertificateAuthorityCsrRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchCertificateAuthorityCsrRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. + * @param message FetchCertificateAuthorityCsrRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchCertificateAuthorityCsrRequest + * @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.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest; + + /** + * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchCertificateAuthorityCsrRequest + * @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.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest; + + /** + * Verifies a FetchCertificateAuthorityCsrRequest 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 FetchCertificateAuthorityCsrRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchCertificateAuthorityCsrRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest; + + /** + * Creates a plain object from a FetchCertificateAuthorityCsrRequest message. Also converts values to other types if specified. + * @param message FetchCertificateAuthorityCsrRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchCertificateAuthorityCsrRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchCertificateAuthorityCsrRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchCertificateAuthorityCsrResponse. */ + interface IFetchCertificateAuthorityCsrResponse { + + /** FetchCertificateAuthorityCsrResponse pemCsr */ + pemCsr?: (string|null); + } + + /** Represents a FetchCertificateAuthorityCsrResponse. */ + class FetchCertificateAuthorityCsrResponse implements IFetchCertificateAuthorityCsrResponse { + + /** + * Constructs a new FetchCertificateAuthorityCsrResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse); + + /** FetchCertificateAuthorityCsrResponse pemCsr. */ + public pemCsr: string; + + /** + * Creates a new FetchCertificateAuthorityCsrResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchCertificateAuthorityCsrResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse): google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse; + + /** + * Encodes the specified FetchCertificateAuthorityCsrResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. + * @param message FetchCertificateAuthorityCsrResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchCertificateAuthorityCsrResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. + * @param message FetchCertificateAuthorityCsrResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchCertificateAuthorityCsrResponse + * @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.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse; + + /** + * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchCertificateAuthorityCsrResponse + * @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.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse; + + /** + * Verifies a FetchCertificateAuthorityCsrResponse 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 FetchCertificateAuthorityCsrResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchCertificateAuthorityCsrResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse; + + /** + * Creates a plain object from a FetchCertificateAuthorityCsrResponse message. Also converts values to other types if specified. + * @param message FetchCertificateAuthorityCsrResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchCertificateAuthorityCsrResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchCertificateAuthorityCsrResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCertificateAuthorityRequest. */ + interface IGetCertificateAuthorityRequest { + + /** GetCertificateAuthorityRequest name */ + name?: (string|null); + } + + /** Represents a GetCertificateAuthorityRequest. */ + class GetCertificateAuthorityRequest implements IGetCertificateAuthorityRequest { + + /** + * Constructs a new GetCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest); + + /** GetCertificateAuthorityRequest name. */ + public name: string; + + /** + * Creates a new GetCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest; + + /** + * Encodes the specified GetCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest.verify|verify} messages. + * @param message GetCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest.verify|verify} messages. + * @param message GetCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCertificateAuthorityRequest + * @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.security.privateca.v1beta1.GetCertificateAuthorityRequest; + + /** + * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCertificateAuthorityRequest + * @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.security.privateca.v1beta1.GetCertificateAuthorityRequest; + + /** + * Verifies a GetCertificateAuthorityRequest 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 GetCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest; + + /** + * Creates a plain object from a GetCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message GetCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateAuthoritiesRequest. */ + interface IListCertificateAuthoritiesRequest { + + /** ListCertificateAuthoritiesRequest parent */ + parent?: (string|null); + + /** ListCertificateAuthoritiesRequest pageSize */ + pageSize?: (number|null); + + /** ListCertificateAuthoritiesRequest pageToken */ + pageToken?: (string|null); + + /** ListCertificateAuthoritiesRequest filter */ + filter?: (string|null); + + /** ListCertificateAuthoritiesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCertificateAuthoritiesRequest. */ + class ListCertificateAuthoritiesRequest implements IListCertificateAuthoritiesRequest { + + /** + * Constructs a new ListCertificateAuthoritiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest); + + /** ListCertificateAuthoritiesRequest parent. */ + public parent: string; + + /** ListCertificateAuthoritiesRequest pageSize. */ + public pageSize: number; + + /** ListCertificateAuthoritiesRequest pageToken. */ + public pageToken: string; + + /** ListCertificateAuthoritiesRequest filter. */ + public filter: string; + + /** ListCertificateAuthoritiesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCertificateAuthoritiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateAuthoritiesRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest): google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest; + + /** + * Encodes the specified ListCertificateAuthoritiesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest.verify|verify} messages. + * @param message ListCertificateAuthoritiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateAuthoritiesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest.verify|verify} messages. + * @param message ListCertificateAuthoritiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateAuthoritiesRequest + * @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.security.privateca.v1beta1.ListCertificateAuthoritiesRequest; + + /** + * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateAuthoritiesRequest + * @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.security.privateca.v1beta1.ListCertificateAuthoritiesRequest; + + /** + * Verifies a ListCertificateAuthoritiesRequest 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 ListCertificateAuthoritiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateAuthoritiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest; + + /** + * Creates a plain object from a ListCertificateAuthoritiesRequest message. Also converts values to other types if specified. + * @param message ListCertificateAuthoritiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateAuthoritiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateAuthoritiesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateAuthoritiesResponse. */ + interface IListCertificateAuthoritiesResponse { + + /** ListCertificateAuthoritiesResponse certificateAuthorities */ + certificateAuthorities?: (google.cloud.security.privateca.v1beta1.ICertificateAuthority[]|null); + + /** ListCertificateAuthoritiesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCertificateAuthoritiesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCertificateAuthoritiesResponse. */ + class ListCertificateAuthoritiesResponse implements IListCertificateAuthoritiesResponse { + + /** + * Constructs a new ListCertificateAuthoritiesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse); + + /** ListCertificateAuthoritiesResponse certificateAuthorities. */ + public certificateAuthorities: google.cloud.security.privateca.v1beta1.ICertificateAuthority[]; + + /** ListCertificateAuthoritiesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCertificateAuthoritiesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCertificateAuthoritiesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateAuthoritiesResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse): google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse; + + /** + * Encodes the specified ListCertificateAuthoritiesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.verify|verify} messages. + * @param message ListCertificateAuthoritiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateAuthoritiesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.verify|verify} messages. + * @param message ListCertificateAuthoritiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateAuthoritiesResponse + * @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.security.privateca.v1beta1.ListCertificateAuthoritiesResponse; + + /** + * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateAuthoritiesResponse + * @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.security.privateca.v1beta1.ListCertificateAuthoritiesResponse; + + /** + * Verifies a ListCertificateAuthoritiesResponse 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 ListCertificateAuthoritiesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateAuthoritiesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse; + + /** + * Creates a plain object from a ListCertificateAuthoritiesResponse message. Also converts values to other types if specified. + * @param message ListCertificateAuthoritiesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateAuthoritiesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateAuthoritiesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreCertificateAuthorityRequest. */ + interface IRestoreCertificateAuthorityRequest { + + /** RestoreCertificateAuthorityRequest name */ + name?: (string|null); + + /** RestoreCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RestoreCertificateAuthorityRequest. */ + class RestoreCertificateAuthorityRequest implements IRestoreCertificateAuthorityRequest { + + /** + * Constructs a new RestoreCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest); + + /** RestoreCertificateAuthorityRequest name. */ + public name: string; + + /** RestoreCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new RestoreCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest; + + /** + * Encodes the specified RestoreCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest.verify|verify} messages. + * @param message RestoreCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest.verify|verify} messages. + * @param message RestoreCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreCertificateAuthorityRequest + * @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.security.privateca.v1beta1.RestoreCertificateAuthorityRequest; + + /** + * Decodes a RestoreCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreCertificateAuthorityRequest + * @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.security.privateca.v1beta1.RestoreCertificateAuthorityRequest; + + /** + * Verifies a RestoreCertificateAuthorityRequest 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 RestoreCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest; + + /** + * Creates a plain object from a RestoreCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message RestoreCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleDeleteCertificateAuthorityRequest. */ + interface IScheduleDeleteCertificateAuthorityRequest { + + /** ScheduleDeleteCertificateAuthorityRequest name */ + name?: (string|null); + + /** ScheduleDeleteCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents a ScheduleDeleteCertificateAuthorityRequest. */ + class ScheduleDeleteCertificateAuthorityRequest implements IScheduleDeleteCertificateAuthorityRequest { + + /** + * Constructs a new ScheduleDeleteCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest); + + /** ScheduleDeleteCertificateAuthorityRequest name. */ + public name: string; + + /** ScheduleDeleteCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new ScheduleDeleteCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleDeleteCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest; + + /** + * Encodes the specified ScheduleDeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest.verify|verify} messages. + * @param message ScheduleDeleteCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduleDeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest.verify|verify} messages. + * @param message ScheduleDeleteCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleDeleteCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduleDeleteCertificateAuthorityRequest + * @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.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest; + + /** + * Decodes a ScheduleDeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduleDeleteCertificateAuthorityRequest + * @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.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest; + + /** + * Verifies a ScheduleDeleteCertificateAuthorityRequest 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 ScheduleDeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduleDeleteCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest; + + /** + * Creates a plain object from a ScheduleDeleteCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message ScheduleDeleteCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduleDeleteCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScheduleDeleteCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCertificateAuthorityRequest. */ + interface IUpdateCertificateAuthorityRequest { + + /** UpdateCertificateAuthorityRequest certificateAuthority */ + certificateAuthority?: (google.cloud.security.privateca.v1beta1.ICertificateAuthority|null); + + /** UpdateCertificateAuthorityRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateAuthorityRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateCertificateAuthorityRequest. */ + class UpdateCertificateAuthorityRequest implements IUpdateCertificateAuthorityRequest { + + /** + * Constructs a new UpdateCertificateAuthorityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest); + + /** UpdateCertificateAuthorityRequest certificateAuthority. */ + public certificateAuthority?: (google.cloud.security.privateca.v1beta1.ICertificateAuthority|null); + + /** UpdateCertificateAuthorityRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateAuthorityRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateCertificateAuthorityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCertificateAuthorityRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest; + + /** + * Encodes the specified UpdateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.verify|verify} messages. + * @param message UpdateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.verify|verify} messages. + * @param message UpdateCertificateAuthorityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCertificateAuthorityRequest + * @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.security.privateca.v1beta1.UpdateCertificateAuthorityRequest; + + /** + * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCertificateAuthorityRequest + * @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.security.privateca.v1beta1.UpdateCertificateAuthorityRequest; + + /** + * Verifies an UpdateCertificateAuthorityRequest 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 UpdateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCertificateAuthorityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest; + + /** + * Creates a plain object from an UpdateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @param message UpdateCertificateAuthorityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCertificateAuthorityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCertificateAuthorityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCertificateRevocationListRequest. */ + interface IGetCertificateRevocationListRequest { + + /** GetCertificateRevocationListRequest name */ + name?: (string|null); + } + + /** Represents a GetCertificateRevocationListRequest. */ + class GetCertificateRevocationListRequest implements IGetCertificateRevocationListRequest { + + /** + * Constructs a new GetCertificateRevocationListRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest); + + /** GetCertificateRevocationListRequest name. */ + public name: string; + + /** + * Creates a new GetCertificateRevocationListRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCertificateRevocationListRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest): google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest; + + /** + * Encodes the specified GetCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest.verify|verify} messages. + * @param message GetCertificateRevocationListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest.verify|verify} messages. + * @param message GetCertificateRevocationListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCertificateRevocationListRequest + * @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.security.privateca.v1beta1.GetCertificateRevocationListRequest; + + /** + * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCertificateRevocationListRequest + * @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.security.privateca.v1beta1.GetCertificateRevocationListRequest; + + /** + * Verifies a GetCertificateRevocationListRequest 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 GetCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCertificateRevocationListRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest; + + /** + * Creates a plain object from a GetCertificateRevocationListRequest message. Also converts values to other types if specified. + * @param message GetCertificateRevocationListRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCertificateRevocationListRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCertificateRevocationListRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateRevocationListsRequest. */ + interface IListCertificateRevocationListsRequest { + + /** ListCertificateRevocationListsRequest parent */ + parent?: (string|null); + + /** ListCertificateRevocationListsRequest pageSize */ + pageSize?: (number|null); + + /** ListCertificateRevocationListsRequest pageToken */ + pageToken?: (string|null); + + /** ListCertificateRevocationListsRequest filter */ + filter?: (string|null); + + /** ListCertificateRevocationListsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCertificateRevocationListsRequest. */ + class ListCertificateRevocationListsRequest implements IListCertificateRevocationListsRequest { + + /** + * Constructs a new ListCertificateRevocationListsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest); + + /** ListCertificateRevocationListsRequest parent. */ + public parent: string; + + /** ListCertificateRevocationListsRequest pageSize. */ + public pageSize: number; + + /** ListCertificateRevocationListsRequest pageToken. */ + public pageToken: string; + + /** ListCertificateRevocationListsRequest filter. */ + public filter: string; + + /** ListCertificateRevocationListsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCertificateRevocationListsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateRevocationListsRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest): google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest; + + /** + * Encodes the specified ListCertificateRevocationListsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest.verify|verify} messages. + * @param message ListCertificateRevocationListsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateRevocationListsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest.verify|verify} messages. + * @param message ListCertificateRevocationListsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateRevocationListsRequest + * @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.security.privateca.v1beta1.ListCertificateRevocationListsRequest; + + /** + * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateRevocationListsRequest + * @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.security.privateca.v1beta1.ListCertificateRevocationListsRequest; + + /** + * Verifies a ListCertificateRevocationListsRequest 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 ListCertificateRevocationListsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateRevocationListsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest; + + /** + * Creates a plain object from a ListCertificateRevocationListsRequest message. Also converts values to other types if specified. + * @param message ListCertificateRevocationListsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateRevocationListsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateRevocationListsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateRevocationListsResponse. */ + interface IListCertificateRevocationListsResponse { + + /** ListCertificateRevocationListsResponse certificateRevocationLists */ + certificateRevocationLists?: (google.cloud.security.privateca.v1beta1.ICertificateRevocationList[]|null); + + /** ListCertificateRevocationListsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCertificateRevocationListsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCertificateRevocationListsResponse. */ + class ListCertificateRevocationListsResponse implements IListCertificateRevocationListsResponse { + + /** + * Constructs a new ListCertificateRevocationListsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse); + + /** ListCertificateRevocationListsResponse certificateRevocationLists. */ + public certificateRevocationLists: google.cloud.security.privateca.v1beta1.ICertificateRevocationList[]; + + /** ListCertificateRevocationListsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCertificateRevocationListsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCertificateRevocationListsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateRevocationListsResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse): google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse; + + /** + * Encodes the specified ListCertificateRevocationListsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.verify|verify} messages. + * @param message ListCertificateRevocationListsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateRevocationListsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.verify|verify} messages. + * @param message ListCertificateRevocationListsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateRevocationListsResponse + * @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.security.privateca.v1beta1.ListCertificateRevocationListsResponse; + + /** + * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateRevocationListsResponse + * @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.security.privateca.v1beta1.ListCertificateRevocationListsResponse; + + /** + * Verifies a ListCertificateRevocationListsResponse 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 ListCertificateRevocationListsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateRevocationListsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse; + + /** + * Creates a plain object from a ListCertificateRevocationListsResponse message. Also converts values to other types if specified. + * @param message ListCertificateRevocationListsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateRevocationListsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateRevocationListsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCertificateRevocationListRequest. */ + interface IUpdateCertificateRevocationListRequest { + + /** UpdateCertificateRevocationListRequest certificateRevocationList */ + certificateRevocationList?: (google.cloud.security.privateca.v1beta1.ICertificateRevocationList|null); + + /** UpdateCertificateRevocationListRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateRevocationListRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateCertificateRevocationListRequest. */ + class UpdateCertificateRevocationListRequest implements IUpdateCertificateRevocationListRequest { + + /** + * Constructs a new UpdateCertificateRevocationListRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest); + + /** UpdateCertificateRevocationListRequest certificateRevocationList. */ + public certificateRevocationList?: (google.cloud.security.privateca.v1beta1.ICertificateRevocationList|null); + + /** UpdateCertificateRevocationListRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCertificateRevocationListRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateCertificateRevocationListRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCertificateRevocationListRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest): google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest; + + /** + * Encodes the specified UpdateCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.verify|verify} messages. + * @param message UpdateCertificateRevocationListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.verify|verify} messages. + * @param message UpdateCertificateRevocationListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCertificateRevocationListRequest + * @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.security.privateca.v1beta1.UpdateCertificateRevocationListRequest; + + /** + * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCertificateRevocationListRequest + * @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.security.privateca.v1beta1.UpdateCertificateRevocationListRequest; + + /** + * Verifies an UpdateCertificateRevocationListRequest 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 UpdateCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCertificateRevocationListRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest; + + /** + * Creates a plain object from an UpdateCertificateRevocationListRequest message. Also converts values to other types if specified. + * @param message UpdateCertificateRevocationListRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCertificateRevocationListRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCertificateRevocationListRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetReusableConfigRequest. */ + interface IGetReusableConfigRequest { + + /** GetReusableConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetReusableConfigRequest. */ + class GetReusableConfigRequest implements IGetReusableConfigRequest { + + /** + * Constructs a new GetReusableConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest); + + /** GetReusableConfigRequest name. */ + public name: string; + + /** + * Creates a new GetReusableConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetReusableConfigRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest): google.cloud.security.privateca.v1beta1.GetReusableConfigRequest; + + /** + * Encodes the specified GetReusableConfigRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetReusableConfigRequest.verify|verify} messages. + * @param message GetReusableConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetReusableConfigRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetReusableConfigRequest.verify|verify} messages. + * @param message GetReusableConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetReusableConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetReusableConfigRequest + * @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.security.privateca.v1beta1.GetReusableConfigRequest; + + /** + * Decodes a GetReusableConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetReusableConfigRequest + * @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.security.privateca.v1beta1.GetReusableConfigRequest; + + /** + * Verifies a GetReusableConfigRequest 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 GetReusableConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetReusableConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.GetReusableConfigRequest; + + /** + * Creates a plain object from a GetReusableConfigRequest message. Also converts values to other types if specified. + * @param message GetReusableConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.GetReusableConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetReusableConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetReusableConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReusableConfigsRequest. */ + interface IListReusableConfigsRequest { + + /** ListReusableConfigsRequest parent */ + parent?: (string|null); + + /** ListReusableConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListReusableConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListReusableConfigsRequest filter */ + filter?: (string|null); + + /** ListReusableConfigsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListReusableConfigsRequest. */ + class ListReusableConfigsRequest implements IListReusableConfigsRequest { + + /** + * Constructs a new ListReusableConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest); + + /** ListReusableConfigsRequest parent. */ + public parent: string; + + /** ListReusableConfigsRequest pageSize. */ + public pageSize: number; + + /** ListReusableConfigsRequest pageToken. */ + public pageToken: string; + + /** ListReusableConfigsRequest filter. */ + public filter: string; + + /** ListReusableConfigsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListReusableConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReusableConfigsRequest instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest): google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest; + + /** + * Encodes the specified ListReusableConfigsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest.verify|verify} messages. + * @param message ListReusableConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReusableConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest.verify|verify} messages. + * @param message ListReusableConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReusableConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReusableConfigsRequest + * @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.security.privateca.v1beta1.ListReusableConfigsRequest; + + /** + * Decodes a ListReusableConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReusableConfigsRequest + * @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.security.privateca.v1beta1.ListReusableConfigsRequest; + + /** + * Verifies a ListReusableConfigsRequest 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 ListReusableConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReusableConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest; + + /** + * Creates a plain object from a ListReusableConfigsRequest message. Also converts values to other types if specified. + * @param message ListReusableConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReusableConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReusableConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReusableConfigsResponse. */ + interface IListReusableConfigsResponse { + + /** ListReusableConfigsResponse reusableConfigs */ + reusableConfigs?: (google.cloud.security.privateca.v1beta1.IReusableConfig[]|null); + + /** ListReusableConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListReusableConfigsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListReusableConfigsResponse. */ + class ListReusableConfigsResponse implements IListReusableConfigsResponse { + + /** + * Constructs a new ListReusableConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse); + + /** ListReusableConfigsResponse reusableConfigs. */ + public reusableConfigs: google.cloud.security.privateca.v1beta1.IReusableConfig[]; + + /** ListReusableConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListReusableConfigsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListReusableConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReusableConfigsResponse instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse): google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse; + + /** + * Encodes the specified ListReusableConfigsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.verify|verify} messages. + * @param message ListReusableConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReusableConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.verify|verify} messages. + * @param message ListReusableConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReusableConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReusableConfigsResponse + * @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.security.privateca.v1beta1.ListReusableConfigsResponse; + + /** + * Decodes a ListReusableConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReusableConfigsResponse + * @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.security.privateca.v1beta1.ListReusableConfigsResponse; + + /** + * Verifies a ListReusableConfigsResponse 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 ListReusableConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReusableConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse; + + /** + * Creates a plain object from a ListReusableConfigsResponse message. Also converts values to other types if specified. + * @param message ListReusableConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReusableConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReusableConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1beta1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.security.privateca.v1beta1.IOperationMetadata): google.cloud.security.privateca.v1beta1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.security.privateca.v1beta1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.security.privateca.v1beta1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1beta1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @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); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: 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; + + /** + * 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 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; + + /** + * 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 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; + + /** + * 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); + + /** + * 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 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 }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @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.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @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.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @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.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @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.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @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.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @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.Publishing; + + /** + * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @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.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @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.JavaSettings; + + /** + * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @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.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @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.CppSettings; + + /** + * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @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.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @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.PhpSettings; + + /** + * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @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.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @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.PythonSettings; + + /** + * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @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.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @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.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures 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 ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @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.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @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.NodeSettings; + + /** + * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @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.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @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.DotnetSettings; + + /** + * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @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.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @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.RubySettings; + + /** + * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @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.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @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.GoSettings; + + /** + * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @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.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @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.MethodSettings; + + /** + * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @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.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @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.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @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.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @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.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration 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 SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + + /** FieldInfo referencedTypes */ + referencedTypes?: (google.api.ITypeReference[]|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** FieldInfo referencedTypes. */ + public referencedTypes: google.api.ITypeReference[]; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @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.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @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.FieldInfo; + + /** + * Verifies a FieldInfo 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 FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + + /** Properties of a TypeReference. */ + interface ITypeReference { + + /** TypeReference typeName */ + typeName?: (string|null); + } + + /** Represents a TypeReference. */ + class TypeReference implements ITypeReference { + + /** + * Constructs a new TypeReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ITypeReference); + + /** TypeReference typeName. */ + public typeName: string; + + /** + * Creates a new TypeReference instance using the specified properties. + * @param [properties] Properties to set + * @returns TypeReference instance + */ + public static create(properties?: google.api.ITypeReference): google.api.TypeReference; + + /** + * Encodes the specified TypeReference message. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. + * @param message TypeReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ITypeReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TypeReference message, length delimited. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. + * @param message TypeReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ITypeReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TypeReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TypeReference + * @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.TypeReference; + + /** + * Decodes a TypeReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TypeReference + * @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.TypeReference; + + /** + * Verifies a TypeReference 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 TypeReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TypeReference + */ + public static fromObject(object: { [k: string]: any }): google.api.TypeReference; + + /** + * Creates a plain object from a TypeReference message. Also converts values to other types if specified. + * @param message TypeReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.TypeReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TypeReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TypeReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** 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 optionDependency */ + optionDependency?: (string[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * 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; + + /** + * 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 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; + + /** + * 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 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; + + /** + * 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); + + /** + * 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 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 }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @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.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @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.Declaration; + + /** + * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * 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 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 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 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 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 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 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 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 FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** 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 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * 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 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 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 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 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 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 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 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 EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @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.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @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.EditionDefault; + + /** + * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @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.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @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.FeatureSupport; + + /** + * Verifies a FeatureSupport 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 FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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 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 }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * 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 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 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 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 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 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 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 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 ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * 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 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; + + /** + * 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 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; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @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.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @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.FeatureSet; + + /** + * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @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.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @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.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature 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 VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @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.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @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.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|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); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @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.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @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.Any; + + /** + * Verifies an Any 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 Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @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.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @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.Empty; + + /** + * Verifies an Empty 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 Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @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.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @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.DoubleValue; + + /** + * Verifies a DoubleValue 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 DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @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.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @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.FloatValue; + + /** + * Verifies a FloatValue 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 FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @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.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @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.Int64Value; + + /** + * Verifies an Int64Value 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 Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @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.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @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.UInt64Value; + + /** + * Verifies a UInt64Value 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 UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @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.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @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.Int32Value; + + /** + * Verifies an Int32Value 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 Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @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.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @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.UInt32Value; + + /** + * Verifies a UInt32Value 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 UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @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.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @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.BoolValue; + + /** + * Verifies a BoolValue 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 BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @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.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @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.StringValue; + + /** + * Verifies a StringValue 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 StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @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.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @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.BytesValue; + + /** + * Verifies a BytesValue 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 BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * 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 }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @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.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @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.longrunning.Operation; + + /** + * Verifies an Operation 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 Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest 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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse 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 ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest 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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest 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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest 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 WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo 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 OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @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.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @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.rpc.Status; + + /** + * Verifies a Status 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 Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/protos.js b/owl-bot-staging/google-cloud-security-privateca/protos/protos.js new file mode 100644 index 000000000000..c44fa93b948e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/protos/protos.js @@ -0,0 +1,68543 @@ +// Copyright 2026 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_security_private_ca_protos || ($protobuf.roots._google_cloud_security_private_ca_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.security = (function() { + + /** + * Namespace security. + * @memberof google.cloud + * @namespace + */ + var security = {}; + + security.privateca = (function() { + + /** + * Namespace privateca. + * @memberof google.cloud.security + * @namespace + */ + var privateca = {}; + + privateca.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.security.privateca + * @namespace + */ + var v1 = {}; + + v1.CertificateAuthority = (function() { + + /** + * Properties of a CertificateAuthority. + * @memberof google.cloud.security.privateca.v1 + * @interface ICertificateAuthority + * @property {string|null} [name] CertificateAuthority name + * @property {google.cloud.security.privateca.v1.CertificateAuthority.Type|null} [type] CertificateAuthority type + * @property {google.cloud.security.privateca.v1.ICertificateConfig|null} [config] CertificateAuthority config + * @property {google.protobuf.IDuration|null} [lifetime] CertificateAuthority lifetime + * @property {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec|null} [keySpec] CertificateAuthority keySpec + * @property {google.cloud.security.privateca.v1.ISubordinateConfig|null} [subordinateConfig] CertificateAuthority subordinateConfig + * @property {google.cloud.security.privateca.v1.CaPool.Tier|null} [tier] CertificateAuthority tier + * @property {google.cloud.security.privateca.v1.CertificateAuthority.State|null} [state] CertificateAuthority state + * @property {Array.|null} [pemCaCertificates] CertificateAuthority pemCaCertificates + * @property {Array.|null} [caCertificateDescriptions] CertificateAuthority caCertificateDescriptions + * @property {string|null} [gcsBucket] CertificateAuthority gcsBucket + * @property {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls|null} [accessUrls] CertificateAuthority accessUrls + * @property {google.protobuf.ITimestamp|null} [createTime] CertificateAuthority createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateAuthority updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] CertificateAuthority deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] CertificateAuthority expireTime + * @property {Object.|null} [labels] CertificateAuthority labels + * @property {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls|null} [userDefinedAccessUrls] CertificateAuthority userDefinedAccessUrls + * @property {boolean|null} [satisfiesPzs] CertificateAuthority satisfiesPzs + * @property {boolean|null} [satisfiesPzi] CertificateAuthority satisfiesPzi + */ + + /** + * Constructs a new CertificateAuthority. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CertificateAuthority. + * @implements ICertificateAuthority + * @constructor + * @param {google.cloud.security.privateca.v1.ICertificateAuthority=} [properties] Properties to set + */ + function CertificateAuthority(properties) { + this.pemCaCertificates = []; + this.caCertificateDescriptions = []; + 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]]; + } + + /** + * CertificateAuthority name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.name = ""; + + /** + * CertificateAuthority type. + * @member {google.cloud.security.privateca.v1.CertificateAuthority.Type} type + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.type = 0; + + /** + * CertificateAuthority config. + * @member {google.cloud.security.privateca.v1.ICertificateConfig|null|undefined} config + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.config = null; + + /** + * CertificateAuthority lifetime. + * @member {google.protobuf.IDuration|null|undefined} lifetime + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.lifetime = null; + + /** + * CertificateAuthority keySpec. + * @member {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec|null|undefined} keySpec + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.keySpec = null; + + /** + * CertificateAuthority subordinateConfig. + * @member {google.cloud.security.privateca.v1.ISubordinateConfig|null|undefined} subordinateConfig + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.subordinateConfig = null; + + /** + * CertificateAuthority tier. + * @member {google.cloud.security.privateca.v1.CaPool.Tier} tier + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.tier = 0; + + /** + * CertificateAuthority state. + * @member {google.cloud.security.privateca.v1.CertificateAuthority.State} state + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.state = 0; + + /** + * CertificateAuthority pemCaCertificates. + * @member {Array.} pemCaCertificates + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.pemCaCertificates = $util.emptyArray; + + /** + * CertificateAuthority caCertificateDescriptions. + * @member {Array.} caCertificateDescriptions + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.caCertificateDescriptions = $util.emptyArray; + + /** + * CertificateAuthority gcsBucket. + * @member {string} gcsBucket + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.gcsBucket = ""; + + /** + * CertificateAuthority accessUrls. + * @member {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls|null|undefined} accessUrls + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.accessUrls = null; + + /** + * CertificateAuthority createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.createTime = null; + + /** + * CertificateAuthority updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.updateTime = null; + + /** + * CertificateAuthority deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.deleteTime = null; + + /** + * CertificateAuthority expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.expireTime = null; + + /** + * CertificateAuthority labels. + * @member {Object.} labels + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.labels = $util.emptyObject; + + /** + * CertificateAuthority userDefinedAccessUrls. + * @member {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls|null|undefined} userDefinedAccessUrls + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.userDefinedAccessUrls = null; + + /** + * CertificateAuthority satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.satisfiesPzs = false; + + /** + * CertificateAuthority satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.satisfiesPzi = false; + + /** + * Creates a new CertificateAuthority instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @static + * @param {google.cloud.security.privateca.v1.ICertificateAuthority=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateAuthority} CertificateAuthority instance + */ + CertificateAuthority.create = function create(properties) { + return new CertificateAuthority(properties); + }; + + /** + * Encodes the specified CertificateAuthority message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @static + * @param {google.cloud.security.privateca.v1.ICertificateAuthority} message CertificateAuthority message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateAuthority.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.security.privateca.v1.CertificateConfig.encode(message.config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) + $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.keySpec != null && Object.hasOwnProperty.call(message, "keySpec")) + $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.encode(message.keySpec, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.subordinateConfig != null && Object.hasOwnProperty.call(message, "subordinateConfig")) + $root.google.cloud.security.privateca.v1.SubordinateConfig.encode(message.subordinateConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.tier); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.pemCaCertificates != null && message.pemCaCertificates.length) + for (var i = 0; i < message.pemCaCertificates.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.pemCaCertificates[i]); + if (message.caCertificateDescriptions != null && message.caCertificateDescriptions.length) + for (var i = 0; i < message.caCertificateDescriptions.length; ++i) + $root.google.cloud.security.privateca.v1.CertificateDescription.encode(message.caCertificateDescriptions[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.gcsBucket); + if (message.accessUrls != null && Object.hasOwnProperty.call(message, "accessUrls")) + $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.encode(message.accessUrls, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.userDefinedAccessUrls != null && Object.hasOwnProperty.call(message, "userDefinedAccessUrls")) + $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.encode(message.userDefinedAccessUrls, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.satisfiesPzi); + return writer; + }; + + /** + * Encodes the specified CertificateAuthority message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @static + * @param {google.cloud.security.privateca.v1.ICertificateAuthority} message CertificateAuthority message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateAuthority.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateAuthority message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateAuthority} CertificateAuthority + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateAuthority.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateAuthority(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.config = $root.google.cloud.security.privateca.v1.CertificateConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.keySpec = $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.decode(reader, reader.uint32()); + break; + } + case 6: { + message.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.tier = reader.int32(); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + if (!(message.pemCaCertificates && message.pemCaCertificates.length)) + message.pemCaCertificates = []; + message.pemCaCertificates.push(reader.string()); + break; + } + case 10: { + if (!(message.caCertificateDescriptions && message.caCertificateDescriptions.length)) + message.caCertificateDescriptions = []; + message.caCertificateDescriptions.push($root.google.cloud.security.privateca.v1.CertificateDescription.decode(reader, reader.uint32())); + break; + } + case 11: { + message.gcsBucket = reader.string(); + break; + } + case 12: { + message.accessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.decode(reader, reader.uint32()); + break; + } + case 13: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 16: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 18: { + message.userDefinedAccessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.decode(reader, reader.uint32()); + break; + } + case 19: { + message.satisfiesPzs = reader.bool(); + break; + } + case 20: { + message.satisfiesPzi = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateAuthority message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateAuthority} CertificateAuthority + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateAuthority.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateAuthority message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateAuthority.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.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.security.privateca.v1.CertificateConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.lifetime != null && message.hasOwnProperty("lifetime")) { + var error = $root.google.protobuf.Duration.verify(message.lifetime); + if (error) + return "lifetime." + error; + } + if (message.keySpec != null && message.hasOwnProperty("keySpec")) { + var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.verify(message.keySpec); + if (error) + return "keySpec." + error; + } + if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) { + var error = $root.google.cloud.security.privateca.v1.SubordinateConfig.verify(message.subordinateConfig); + if (error) + return "subordinateConfig." + error; + } + if (message.tier != null && message.hasOwnProperty("tier")) + switch (message.tier) { + default: + return "tier: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.pemCaCertificates != null && message.hasOwnProperty("pemCaCertificates")) { + if (!Array.isArray(message.pemCaCertificates)) + return "pemCaCertificates: array expected"; + for (var i = 0; i < message.pemCaCertificates.length; ++i) + if (!$util.isString(message.pemCaCertificates[i])) + return "pemCaCertificates: string[] expected"; + } + if (message.caCertificateDescriptions != null && message.hasOwnProperty("caCertificateDescriptions")) { + if (!Array.isArray(message.caCertificateDescriptions)) + return "caCertificateDescriptions: array expected"; + for (var i = 0; i < message.caCertificateDescriptions.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.CertificateDescription.verify(message.caCertificateDescriptions[i]); + if (error) + return "caCertificateDescriptions." + error; + } + } + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + if (!$util.isString(message.gcsBucket)) + return "gcsBucket: string expected"; + if (message.accessUrls != null && message.hasOwnProperty("accessUrls")) { + var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.verify(message.accessUrls); + if (error) + return "accessUrls." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.userDefinedAccessUrls != null && message.hasOwnProperty("userDefinedAccessUrls")) { + var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.verify(message.userDefinedAccessUrls); + if (error) + return "userDefinedAccessUrls." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + return null; + }; + + /** + * Creates a CertificateAuthority message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateAuthority} CertificateAuthority + */ + CertificateAuthority.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateAuthority) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateAuthority(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SELF_SIGNED": + case 1: + message.type = 1; + break; + case "SUBORDINATE": + case 2: + message.type = 2; + break; + } + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.config: object expected"); + message.config = $root.google.cloud.security.privateca.v1.CertificateConfig.fromObject(object.config); + } + if (object.lifetime != null) { + if (typeof object.lifetime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.lifetime: object expected"); + message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); + } + if (object.keySpec != null) { + if (typeof object.keySpec !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.keySpec: object expected"); + message.keySpec = $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.fromObject(object.keySpec); + } + if (object.subordinateConfig != null) { + if (typeof object.subordinateConfig !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.subordinateConfig: object expected"); + message.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.fromObject(object.subordinateConfig); + } + switch (object.tier) { + default: + if (typeof object.tier === "number") { + message.tier = object.tier; + break; + } + break; + case "TIER_UNSPECIFIED": + case 0: + message.tier = 0; + break; + case "ENTERPRISE": + case 1: + message.tier = 1; + break; + case "DEVOPS": + case 2: + message.tier = 2; + break; + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ENABLED": + case 1: + message.state = 1; + break; + case "DISABLED": + case 2: + message.state = 2; + break; + case "STAGED": + case 3: + message.state = 3; + break; + case "AWAITING_USER_ACTIVATION": + case 4: + message.state = 4; + break; + case "DELETED": + case 5: + message.state = 5; + break; + } + if (object.pemCaCertificates) { + if (!Array.isArray(object.pemCaCertificates)) + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.pemCaCertificates: array expected"); + message.pemCaCertificates = []; + for (var i = 0; i < object.pemCaCertificates.length; ++i) + message.pemCaCertificates[i] = String(object.pemCaCertificates[i]); + } + if (object.caCertificateDescriptions) { + if (!Array.isArray(object.caCertificateDescriptions)) + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.caCertificateDescriptions: array expected"); + message.caCertificateDescriptions = []; + for (var i = 0; i < object.caCertificateDescriptions.length; ++i) { + if (typeof object.caCertificateDescriptions[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.caCertificateDescriptions: object expected"); + message.caCertificateDescriptions[i] = $root.google.cloud.security.privateca.v1.CertificateDescription.fromObject(object.caCertificateDescriptions[i]); + } + } + if (object.gcsBucket != null) + message.gcsBucket = String(object.gcsBucket); + if (object.accessUrls != null) { + if (typeof object.accessUrls !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.accessUrls: object expected"); + message.accessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.fromObject(object.accessUrls); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.userDefinedAccessUrls != null) { + if (typeof object.userDefinedAccessUrls !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.userDefinedAccessUrls: object expected"); + message.userDefinedAccessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.fromObject(object.userDefinedAccessUrls); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + return message; + }; + + /** + * Creates a plain object from a CertificateAuthority message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority} message CertificateAuthority + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateAuthority.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pemCaCertificates = []; + object.caCertificateDescriptions = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.config = null; + object.lifetime = null; + object.keySpec = null; + object.subordinateConfig = null; + object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.gcsBucket = ""; + object.accessUrls = null; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.userDefinedAccessUrls = null; + object.satisfiesPzs = false; + object.satisfiesPzi = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.security.privateca.v1.CertificateAuthority.Type[message.type] === undefined ? message.type : $root.google.cloud.security.privateca.v1.CertificateAuthority.Type[message.type] : message.type; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.security.privateca.v1.CertificateConfig.toObject(message.config, options); + if (message.lifetime != null && message.hasOwnProperty("lifetime")) + object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); + if (message.keySpec != null && message.hasOwnProperty("keySpec")) + object.keySpec = $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.toObject(message.keySpec, options); + if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) + object.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.toObject(message.subordinateConfig, options); + if (message.tier != null && message.hasOwnProperty("tier")) + object.tier = options.enums === String ? $root.google.cloud.security.privateca.v1.CaPool.Tier[message.tier] === undefined ? message.tier : $root.google.cloud.security.privateca.v1.CaPool.Tier[message.tier] : message.tier; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.security.privateca.v1.CertificateAuthority.State[message.state] === undefined ? message.state : $root.google.cloud.security.privateca.v1.CertificateAuthority.State[message.state] : message.state; + if (message.pemCaCertificates && message.pemCaCertificates.length) { + object.pemCaCertificates = []; + for (var j = 0; j < message.pemCaCertificates.length; ++j) + object.pemCaCertificates[j] = message.pemCaCertificates[j]; + } + if (message.caCertificateDescriptions && message.caCertificateDescriptions.length) { + object.caCertificateDescriptions = []; + for (var j = 0; j < message.caCertificateDescriptions.length; ++j) + object.caCertificateDescriptions[j] = $root.google.cloud.security.privateca.v1.CertificateDescription.toObject(message.caCertificateDescriptions[j], options); + } + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + object.gcsBucket = message.gcsBucket; + if (message.accessUrls != null && message.hasOwnProperty("accessUrls")) + object.accessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.toObject(message.accessUrls, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.userDefinedAccessUrls != null && message.hasOwnProperty("userDefinedAccessUrls")) + object.userDefinedAccessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.toObject(message.userDefinedAccessUrls, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + return object; + }; + + /** + * Converts this CertificateAuthority to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @instance + * @returns {Object.} JSON object + */ + CertificateAuthority.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateAuthority + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateAuthority.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateAuthority"; + }; + + /** + * Type enum. + * @name google.cloud.security.privateca.v1.CertificateAuthority.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} SELF_SIGNED=1 SELF_SIGNED value + * @property {number} SUBORDINATE=2 SUBORDINATE value + */ + CertificateAuthority.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SELF_SIGNED"] = 1; + values[valuesById[2] = "SUBORDINATE"] = 2; + return values; + })(); + + /** + * State enum. + * @name google.cloud.security.privateca.v1.CertificateAuthority.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + * @property {number} STAGED=3 STAGED value + * @property {number} AWAITING_USER_ACTIVATION=4 AWAITING_USER_ACTIVATION value + * @property {number} DELETED=5 DELETED value + */ + CertificateAuthority.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "STAGED"] = 3; + values[valuesById[4] = "AWAITING_USER_ACTIVATION"] = 4; + values[valuesById[5] = "DELETED"] = 5; + return values; + })(); + + CertificateAuthority.AccessUrls = (function() { + + /** + * Properties of an AccessUrls. + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @interface IAccessUrls + * @property {string|null} [caCertificateAccessUrl] AccessUrls caCertificateAccessUrl + * @property {Array.|null} [crlAccessUrls] AccessUrls crlAccessUrls + */ + + /** + * Constructs a new AccessUrls. + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @classdesc Represents an AccessUrls. + * @implements IAccessUrls + * @constructor + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls=} [properties] Properties to set + */ + function AccessUrls(properties) { + this.crlAccessUrls = []; + 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]]; + } + + /** + * AccessUrls caCertificateAccessUrl. + * @member {string} caCertificateAccessUrl + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @instance + */ + AccessUrls.prototype.caCertificateAccessUrl = ""; + + /** + * AccessUrls crlAccessUrls. + * @member {Array.} crlAccessUrls + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @instance + */ + AccessUrls.prototype.crlAccessUrls = $util.emptyArray; + + /** + * Creates a new AccessUrls instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls} AccessUrls instance + */ + AccessUrls.create = function create(properties) { + return new AccessUrls(properties); + }; + + /** + * Encodes the specified AccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls} message AccessUrls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessUrls.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caCertificateAccessUrl != null && Object.hasOwnProperty.call(message, "caCertificateAccessUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.caCertificateAccessUrl); + if (message.crlAccessUrls != null && message.crlAccessUrls.length) + for (var i = 0; i < message.crlAccessUrls.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.crlAccessUrls[i]); + return writer; + }; + + /** + * Encodes the specified AccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls} message AccessUrls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessUrls.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessUrls message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls} AccessUrls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessUrls.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.caCertificateAccessUrl = reader.string(); + break; + } + case 2: { + if (!(message.crlAccessUrls && message.crlAccessUrls.length)) + message.crlAccessUrls = []; + message.crlAccessUrls.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessUrls message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls} AccessUrls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessUrls.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessUrls message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessUrls.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caCertificateAccessUrl != null && message.hasOwnProperty("caCertificateAccessUrl")) + if (!$util.isString(message.caCertificateAccessUrl)) + return "caCertificateAccessUrl: string expected"; + if (message.crlAccessUrls != null && message.hasOwnProperty("crlAccessUrls")) { + if (!Array.isArray(message.crlAccessUrls)) + return "crlAccessUrls: array expected"; + for (var i = 0; i < message.crlAccessUrls.length; ++i) + if (!$util.isString(message.crlAccessUrls[i])) + return "crlAccessUrls: string[] expected"; + } + return null; + }; + + /** + * Creates an AccessUrls message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls} AccessUrls + */ + AccessUrls.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls(); + if (object.caCertificateAccessUrl != null) + message.caCertificateAccessUrl = String(object.caCertificateAccessUrl); + if (object.crlAccessUrls) { + if (!Array.isArray(object.crlAccessUrls)) + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.crlAccessUrls: array expected"); + message.crlAccessUrls = []; + for (var i = 0; i < object.crlAccessUrls.length; ++i) + message.crlAccessUrls[i] = String(object.crlAccessUrls[i]); + } + return message; + }; + + /** + * Creates a plain object from an AccessUrls message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls} message AccessUrls + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessUrls.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.crlAccessUrls = []; + if (options.defaults) + object.caCertificateAccessUrl = ""; + if (message.caCertificateAccessUrl != null && message.hasOwnProperty("caCertificateAccessUrl")) + object.caCertificateAccessUrl = message.caCertificateAccessUrl; + if (message.crlAccessUrls && message.crlAccessUrls.length) { + object.crlAccessUrls = []; + for (var j = 0; j < message.crlAccessUrls.length; ++j) + object.crlAccessUrls[j] = message.crlAccessUrls[j]; + } + return object; + }; + + /** + * Converts this AccessUrls to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @instance + * @returns {Object.} JSON object + */ + AccessUrls.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessUrls + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessUrls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls"; + }; + + return AccessUrls; + })(); + + CertificateAuthority.KeyVersionSpec = (function() { + + /** + * Properties of a KeyVersionSpec. + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @interface IKeyVersionSpec + * @property {string|null} [cloudKmsKeyVersion] KeyVersionSpec cloudKmsKeyVersion + * @property {google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|null} [algorithm] KeyVersionSpec algorithm + */ + + /** + * Constructs a new KeyVersionSpec. + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @classdesc Represents a KeyVersionSpec. + * @implements IKeyVersionSpec + * @constructor + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec=} [properties] Properties to set + */ + function KeyVersionSpec(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]]; + } + + /** + * KeyVersionSpec cloudKmsKeyVersion. + * @member {string|null|undefined} cloudKmsKeyVersion + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @instance + */ + KeyVersionSpec.prototype.cloudKmsKeyVersion = null; + + /** + * KeyVersionSpec algorithm. + * @member {google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|null|undefined} algorithm + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @instance + */ + KeyVersionSpec.prototype.algorithm = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KeyVersionSpec KeyVersion. + * @member {"cloudKmsKeyVersion"|"algorithm"|undefined} KeyVersion + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @instance + */ + Object.defineProperty(KeyVersionSpec.prototype, "KeyVersion", { + get: $util.oneOfGetter($oneOfFields = ["cloudKmsKeyVersion", "algorithm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyVersionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec instance + */ + KeyVersionSpec.create = function create(properties) { + return new KeyVersionSpec(properties); + }; + + /** + * Encodes the specified KeyVersionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec} message KeyVersionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyVersionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudKmsKeyVersion != null && Object.hasOwnProperty.call(message, "cloudKmsKeyVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudKmsKeyVersion); + if (message.algorithm != null && Object.hasOwnProperty.call(message, "algorithm")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.algorithm); + return writer; + }; + + /** + * Encodes the specified KeyVersionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec} message KeyVersionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyVersionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyVersionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyVersionSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cloudKmsKeyVersion = reader.string(); + break; + } + case 2: { + message.algorithm = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyVersionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyVersionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyVersionSpec message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyVersionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cloudKmsKeyVersion != null && message.hasOwnProperty("cloudKmsKeyVersion")) { + properties.KeyVersion = 1; + if (!$util.isString(message.cloudKmsKeyVersion)) + return "cloudKmsKeyVersion: string expected"; + } + if (message.algorithm != null && message.hasOwnProperty("algorithm")) { + if (properties.KeyVersion === 1) + return "KeyVersion: multiple values"; + properties.KeyVersion = 1; + switch (message.algorithm) { + default: + return "algorithm: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 6: + case 7: + case 8: + case 4: + case 5: + break; + } + } + return null; + }; + + /** + * Creates a KeyVersionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec + */ + KeyVersionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec(); + if (object.cloudKmsKeyVersion != null) + message.cloudKmsKeyVersion = String(object.cloudKmsKeyVersion); + switch (object.algorithm) { + default: + if (typeof object.algorithm === "number") { + message.algorithm = object.algorithm; + break; + } + break; + case "SIGN_HASH_ALGORITHM_UNSPECIFIED": + case 0: + message.algorithm = 0; + break; + case "RSA_PSS_2048_SHA256": + case 1: + message.algorithm = 1; + break; + case "RSA_PSS_3072_SHA256": + case 2: + message.algorithm = 2; + break; + case "RSA_PSS_4096_SHA256": + case 3: + message.algorithm = 3; + break; + case "RSA_PKCS1_2048_SHA256": + case 6: + message.algorithm = 6; + break; + case "RSA_PKCS1_3072_SHA256": + case 7: + message.algorithm = 7; + break; + case "RSA_PKCS1_4096_SHA256": + case 8: + message.algorithm = 8; + break; + case "EC_P256_SHA256": + case 4: + message.algorithm = 4; + break; + case "EC_P384_SHA384": + case 5: + message.algorithm = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a KeyVersionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec} message KeyVersionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyVersionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.cloudKmsKeyVersion != null && message.hasOwnProperty("cloudKmsKeyVersion")) { + object.cloudKmsKeyVersion = message.cloudKmsKeyVersion; + if (options.oneofs) + object.KeyVersion = "cloudKmsKeyVersion"; + } + if (message.algorithm != null && message.hasOwnProperty("algorithm")) { + object.algorithm = options.enums === String ? $root.google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm[message.algorithm] === undefined ? message.algorithm : $root.google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm[message.algorithm] : message.algorithm; + if (options.oneofs) + object.KeyVersion = "algorithm"; + } + return object; + }; + + /** + * Converts this KeyVersionSpec to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @instance + * @returns {Object.} JSON object + */ + KeyVersionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyVersionSpec + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyVersionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec"; + }; + + return KeyVersionSpec; + })(); + + /** + * SignHashAlgorithm enum. + * @name google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm + * @enum {number} + * @property {number} SIGN_HASH_ALGORITHM_UNSPECIFIED=0 SIGN_HASH_ALGORITHM_UNSPECIFIED value + * @property {number} RSA_PSS_2048_SHA256=1 RSA_PSS_2048_SHA256 value + * @property {number} RSA_PSS_3072_SHA256=2 RSA_PSS_3072_SHA256 value + * @property {number} RSA_PSS_4096_SHA256=3 RSA_PSS_4096_SHA256 value + * @property {number} RSA_PKCS1_2048_SHA256=6 RSA_PKCS1_2048_SHA256 value + * @property {number} RSA_PKCS1_3072_SHA256=7 RSA_PKCS1_3072_SHA256 value + * @property {number} RSA_PKCS1_4096_SHA256=8 RSA_PKCS1_4096_SHA256 value + * @property {number} EC_P256_SHA256=4 EC_P256_SHA256 value + * @property {number} EC_P384_SHA384=5 EC_P384_SHA384 value + */ + CertificateAuthority.SignHashAlgorithm = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SIGN_HASH_ALGORITHM_UNSPECIFIED"] = 0; + values[valuesById[1] = "RSA_PSS_2048_SHA256"] = 1; + values[valuesById[2] = "RSA_PSS_3072_SHA256"] = 2; + values[valuesById[3] = "RSA_PSS_4096_SHA256"] = 3; + values[valuesById[6] = "RSA_PKCS1_2048_SHA256"] = 6; + values[valuesById[7] = "RSA_PKCS1_3072_SHA256"] = 7; + values[valuesById[8] = "RSA_PKCS1_4096_SHA256"] = 8; + values[valuesById[4] = "EC_P256_SHA256"] = 4; + values[valuesById[5] = "EC_P384_SHA384"] = 5; + return values; + })(); + + CertificateAuthority.UserDefinedAccessUrls = (function() { + + /** + * Properties of a UserDefinedAccessUrls. + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @interface IUserDefinedAccessUrls + * @property {Array.|null} [aiaIssuingCertificateUrls] UserDefinedAccessUrls aiaIssuingCertificateUrls + * @property {Array.|null} [crlAccessUrls] UserDefinedAccessUrls crlAccessUrls + */ + + /** + * Constructs a new UserDefinedAccessUrls. + * @memberof google.cloud.security.privateca.v1.CertificateAuthority + * @classdesc Represents a UserDefinedAccessUrls. + * @implements IUserDefinedAccessUrls + * @constructor + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls=} [properties] Properties to set + */ + function UserDefinedAccessUrls(properties) { + this.aiaIssuingCertificateUrls = []; + this.crlAccessUrls = []; + 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]]; + } + + /** + * UserDefinedAccessUrls aiaIssuingCertificateUrls. + * @member {Array.} aiaIssuingCertificateUrls + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @instance + */ + UserDefinedAccessUrls.prototype.aiaIssuingCertificateUrls = $util.emptyArray; + + /** + * UserDefinedAccessUrls crlAccessUrls. + * @member {Array.} crlAccessUrls + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @instance + */ + UserDefinedAccessUrls.prototype.crlAccessUrls = $util.emptyArray; + + /** + * Creates a new UserDefinedAccessUrls instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls} UserDefinedAccessUrls instance + */ + UserDefinedAccessUrls.create = function create(properties) { + return new UserDefinedAccessUrls(properties); + }; + + /** + * Encodes the specified UserDefinedAccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls} message UserDefinedAccessUrls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserDefinedAccessUrls.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aiaIssuingCertificateUrls != null && message.aiaIssuingCertificateUrls.length) + for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.aiaIssuingCertificateUrls[i]); + if (message.crlAccessUrls != null && message.crlAccessUrls.length) + for (var i = 0; i < message.crlAccessUrls.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.crlAccessUrls[i]); + return writer; + }; + + /** + * Encodes the specified UserDefinedAccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls} message UserDefinedAccessUrls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserDefinedAccessUrls.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserDefinedAccessUrls message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls} UserDefinedAccessUrls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserDefinedAccessUrls.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length)) + message.aiaIssuingCertificateUrls = []; + message.aiaIssuingCertificateUrls.push(reader.string()); + break; + } + case 2: { + if (!(message.crlAccessUrls && message.crlAccessUrls.length)) + message.crlAccessUrls = []; + message.crlAccessUrls.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserDefinedAccessUrls message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls} UserDefinedAccessUrls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserDefinedAccessUrls.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserDefinedAccessUrls message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserDefinedAccessUrls.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aiaIssuingCertificateUrls != null && message.hasOwnProperty("aiaIssuingCertificateUrls")) { + if (!Array.isArray(message.aiaIssuingCertificateUrls)) + return "aiaIssuingCertificateUrls: array expected"; + for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) + if (!$util.isString(message.aiaIssuingCertificateUrls[i])) + return "aiaIssuingCertificateUrls: string[] expected"; + } + if (message.crlAccessUrls != null && message.hasOwnProperty("crlAccessUrls")) { + if (!Array.isArray(message.crlAccessUrls)) + return "crlAccessUrls: array expected"; + for (var i = 0; i < message.crlAccessUrls.length; ++i) + if (!$util.isString(message.crlAccessUrls[i])) + return "crlAccessUrls: string[] expected"; + } + return null; + }; + + /** + * Creates a UserDefinedAccessUrls message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls} UserDefinedAccessUrls + */ + UserDefinedAccessUrls.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls(); + if (object.aiaIssuingCertificateUrls) { + if (!Array.isArray(object.aiaIssuingCertificateUrls)) + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.aiaIssuingCertificateUrls: array expected"); + message.aiaIssuingCertificateUrls = []; + for (var i = 0; i < object.aiaIssuingCertificateUrls.length; ++i) + message.aiaIssuingCertificateUrls[i] = String(object.aiaIssuingCertificateUrls[i]); + } + if (object.crlAccessUrls) { + if (!Array.isArray(object.crlAccessUrls)) + throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.crlAccessUrls: array expected"); + message.crlAccessUrls = []; + for (var i = 0; i < object.crlAccessUrls.length; ++i) + message.crlAccessUrls[i] = String(object.crlAccessUrls[i]); + } + return message; + }; + + /** + * Creates a plain object from a UserDefinedAccessUrls message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @static + * @param {google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls} message UserDefinedAccessUrls + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserDefinedAccessUrls.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.aiaIssuingCertificateUrls = []; + object.crlAccessUrls = []; + } + if (message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length) { + object.aiaIssuingCertificateUrls = []; + for (var j = 0; j < message.aiaIssuingCertificateUrls.length; ++j) + object.aiaIssuingCertificateUrls[j] = message.aiaIssuingCertificateUrls[j]; + } + if (message.crlAccessUrls && message.crlAccessUrls.length) { + object.crlAccessUrls = []; + for (var j = 0; j < message.crlAccessUrls.length; ++j) + object.crlAccessUrls[j] = message.crlAccessUrls[j]; + } + return object; + }; + + /** + * Converts this UserDefinedAccessUrls to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @instance + * @returns {Object.} JSON object + */ + UserDefinedAccessUrls.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserDefinedAccessUrls + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserDefinedAccessUrls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls"; + }; + + return UserDefinedAccessUrls; + })(); + + return CertificateAuthority; + })(); + + v1.CaPool = (function() { + + /** + * Properties of a CaPool. + * @memberof google.cloud.security.privateca.v1 + * @interface ICaPool + * @property {string|null} [name] CaPool name + * @property {google.cloud.security.privateca.v1.CaPool.Tier|null} [tier] CaPool tier + * @property {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy|null} [issuancePolicy] CaPool issuancePolicy + * @property {google.cloud.security.privateca.v1.CaPool.IPublishingOptions|null} [publishingOptions] CaPool publishingOptions + * @property {google.cloud.security.privateca.v1.IEncryptionSpec|null} [encryptionSpec] CaPool encryptionSpec + * @property {Object.|null} [labels] CaPool labels + */ + + /** + * Constructs a new CaPool. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CaPool. + * @implements ICaPool + * @constructor + * @param {google.cloud.security.privateca.v1.ICaPool=} [properties] Properties to set + */ + function CaPool(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]]; + } + + /** + * CaPool name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.CaPool + * @instance + */ + CaPool.prototype.name = ""; + + /** + * CaPool tier. + * @member {google.cloud.security.privateca.v1.CaPool.Tier} tier + * @memberof google.cloud.security.privateca.v1.CaPool + * @instance + */ + CaPool.prototype.tier = 0; + + /** + * CaPool issuancePolicy. + * @member {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy|null|undefined} issuancePolicy + * @memberof google.cloud.security.privateca.v1.CaPool + * @instance + */ + CaPool.prototype.issuancePolicy = null; + + /** + * CaPool publishingOptions. + * @member {google.cloud.security.privateca.v1.CaPool.IPublishingOptions|null|undefined} publishingOptions + * @memberof google.cloud.security.privateca.v1.CaPool + * @instance + */ + CaPool.prototype.publishingOptions = null; + + /** + * CaPool encryptionSpec. + * @member {google.cloud.security.privateca.v1.IEncryptionSpec|null|undefined} encryptionSpec + * @memberof google.cloud.security.privateca.v1.CaPool + * @instance + */ + CaPool.prototype.encryptionSpec = null; + + /** + * CaPool labels. + * @member {Object.} labels + * @memberof google.cloud.security.privateca.v1.CaPool + * @instance + */ + CaPool.prototype.labels = $util.emptyObject; + + /** + * Creates a new CaPool instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CaPool + * @static + * @param {google.cloud.security.privateca.v1.ICaPool=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CaPool} CaPool instance + */ + CaPool.create = function create(properties) { + return new CaPool(properties); + }; + + /** + * Encodes the specified CaPool message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CaPool + * @static + * @param {google.cloud.security.privateca.v1.ICaPool} message CaPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaPool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.tier); + if (message.issuancePolicy != null && Object.hasOwnProperty.call(message, "issuancePolicy")) + $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.encode(message.issuancePolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.publishingOptions != null && Object.hasOwnProperty.call(message, "publishingOptions")) + $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.encode(message.publishingOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) + $root.google.cloud.security.privateca.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CaPool message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool + * @static + * @param {google.cloud.security.privateca.v1.ICaPool} message CaPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaPool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CaPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CaPool} CaPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaPool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.tier = reader.int32(); + break; + } + case 3: { + message.issuancePolicy = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.decode(reader, reader.uint32()); + break; + } + case 4: { + message.publishingOptions = $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.decode(reader, reader.uint32()); + break; + } + case 8: { + message.encryptionSpec = $root.google.cloud.security.privateca.v1.EncryptionSpec.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CaPool} CaPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaPool message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CaPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaPool.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.tier != null && message.hasOwnProperty("tier")) + switch (message.tier) { + default: + return "tier: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.issuancePolicy != null && message.hasOwnProperty("issuancePolicy")) { + var error = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.verify(message.issuancePolicy); + if (error) + return "issuancePolicy." + error; + } + if (message.publishingOptions != null && message.hasOwnProperty("publishingOptions")) { + var error = $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.verify(message.publishingOptions); + if (error) + return "publishingOptions." + error; + } + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { + var error = $root.google.cloud.security.privateca.v1.EncryptionSpec.verify(message.encryptionSpec); + if (error) + return "encryptionSpec." + 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 CaPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CaPool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CaPool} CaPool + */ + CaPool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CaPool) + return object; + var message = new $root.google.cloud.security.privateca.v1.CaPool(); + if (object.name != null) + message.name = String(object.name); + switch (object.tier) { + default: + if (typeof object.tier === "number") { + message.tier = object.tier; + break; + } + break; + case "TIER_UNSPECIFIED": + case 0: + message.tier = 0; + break; + case "ENTERPRISE": + case 1: + message.tier = 1; + break; + case "DEVOPS": + case 2: + message.tier = 2; + break; + } + if (object.issuancePolicy != null) { + if (typeof object.issuancePolicy !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.issuancePolicy: object expected"); + message.issuancePolicy = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.fromObject(object.issuancePolicy); + } + if (object.publishingOptions != null) { + if (typeof object.publishingOptions !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.publishingOptions: object expected"); + message.publishingOptions = $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.fromObject(object.publishingOptions); + } + if (object.encryptionSpec != null) { + if (typeof object.encryptionSpec !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.encryptionSpec: object expected"); + message.encryptionSpec = $root.google.cloud.security.privateca.v1.EncryptionSpec.fromObject(object.encryptionSpec); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.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 CaPool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CaPool + * @static + * @param {google.cloud.security.privateca.v1.CaPool} message CaPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; + object.issuancePolicy = null; + object.publishingOptions = null; + object.encryptionSpec = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tier != null && message.hasOwnProperty("tier")) + object.tier = options.enums === String ? $root.google.cloud.security.privateca.v1.CaPool.Tier[message.tier] === undefined ? message.tier : $root.google.cloud.security.privateca.v1.CaPool.Tier[message.tier] : message.tier; + if (message.issuancePolicy != null && message.hasOwnProperty("issuancePolicy")) + object.issuancePolicy = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.toObject(message.issuancePolicy, options); + if (message.publishingOptions != null && message.hasOwnProperty("publishingOptions")) + object.publishingOptions = $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.toObject(message.publishingOptions, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) + object.encryptionSpec = $root.google.cloud.security.privateca.v1.EncryptionSpec.toObject(message.encryptionSpec, options); + return object; + }; + + /** + * Converts this CaPool to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CaPool + * @instance + * @returns {Object.} JSON object + */ + CaPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaPool + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CaPool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool"; + }; + + /** + * Tier enum. + * @name google.cloud.security.privateca.v1.CaPool.Tier + * @enum {number} + * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value + * @property {number} ENTERPRISE=1 ENTERPRISE value + * @property {number} DEVOPS=2 DEVOPS value + */ + CaPool.Tier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENTERPRISE"] = 1; + values[valuesById[2] = "DEVOPS"] = 2; + return values; + })(); + + CaPool.PublishingOptions = (function() { + + /** + * Properties of a PublishingOptions. + * @memberof google.cloud.security.privateca.v1.CaPool + * @interface IPublishingOptions + * @property {boolean|null} [publishCaCert] PublishingOptions publishCaCert + * @property {boolean|null} [publishCrl] PublishingOptions publishCrl + * @property {google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat|null} [encodingFormat] PublishingOptions encodingFormat + */ + + /** + * Constructs a new PublishingOptions. + * @memberof google.cloud.security.privateca.v1.CaPool + * @classdesc Represents a PublishingOptions. + * @implements IPublishingOptions + * @constructor + * @param {google.cloud.security.privateca.v1.CaPool.IPublishingOptions=} [properties] Properties to set + */ + function PublishingOptions(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]]; + } + + /** + * PublishingOptions publishCaCert. + * @member {boolean} publishCaCert + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @instance + */ + PublishingOptions.prototype.publishCaCert = false; + + /** + * PublishingOptions publishCrl. + * @member {boolean} publishCrl + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @instance + */ + PublishingOptions.prototype.publishCrl = false; + + /** + * PublishingOptions encodingFormat. + * @member {google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat} encodingFormat + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @instance + */ + PublishingOptions.prototype.encodingFormat = 0; + + /** + * Creates a new PublishingOptions instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IPublishingOptions=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CaPool.PublishingOptions} PublishingOptions instance + */ + PublishingOptions.create = function create(properties) { + return new PublishingOptions(properties); + }; + + /** + * Encodes the specified PublishingOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.PublishingOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IPublishingOptions} message PublishingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishingOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publishCaCert != null && Object.hasOwnProperty.call(message, "publishCaCert")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.publishCaCert); + if (message.publishCrl != null && Object.hasOwnProperty.call(message, "publishCrl")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.publishCrl); + if (message.encodingFormat != null && Object.hasOwnProperty.call(message, "encodingFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encodingFormat); + return writer; + }; + + /** + * Encodes the specified PublishingOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.PublishingOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IPublishingOptions} message PublishingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishingOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishingOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CaPool.PublishingOptions} PublishingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishingOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.publishCaCert = reader.bool(); + break; + } + case 2: { + message.publishCrl = reader.bool(); + break; + } + case 3: { + message.encodingFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishingOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CaPool.PublishingOptions} PublishingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishingOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishingOptions message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishingOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publishCaCert != null && message.hasOwnProperty("publishCaCert")) + if (typeof message.publishCaCert !== "boolean") + return "publishCaCert: boolean expected"; + if (message.publishCrl != null && message.hasOwnProperty("publishCrl")) + if (typeof message.publishCrl !== "boolean") + return "publishCrl: boolean expected"; + if (message.encodingFormat != null && message.hasOwnProperty("encodingFormat")) + switch (message.encodingFormat) { + default: + return "encodingFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PublishingOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CaPool.PublishingOptions} PublishingOptions + */ + PublishingOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions) + return object; + var message = new $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions(); + if (object.publishCaCert != null) + message.publishCaCert = Boolean(object.publishCaCert); + if (object.publishCrl != null) + message.publishCrl = Boolean(object.publishCrl); + switch (object.encodingFormat) { + default: + if (typeof object.encodingFormat === "number") { + message.encodingFormat = object.encodingFormat; + break; + } + break; + case "ENCODING_FORMAT_UNSPECIFIED": + case 0: + message.encodingFormat = 0; + break; + case "PEM": + case 1: + message.encodingFormat = 1; + break; + case "DER": + case 2: + message.encodingFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PublishingOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @static + * @param {google.cloud.security.privateca.v1.CaPool.PublishingOptions} message PublishingOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishingOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publishCaCert = false; + object.publishCrl = false; + object.encodingFormat = options.enums === String ? "ENCODING_FORMAT_UNSPECIFIED" : 0; + } + if (message.publishCaCert != null && message.hasOwnProperty("publishCaCert")) + object.publishCaCert = message.publishCaCert; + if (message.publishCrl != null && message.hasOwnProperty("publishCrl")) + object.publishCrl = message.publishCrl; + if (message.encodingFormat != null && message.hasOwnProperty("encodingFormat")) + object.encodingFormat = options.enums === String ? $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat[message.encodingFormat] === undefined ? message.encodingFormat : $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat[message.encodingFormat] : message.encodingFormat; + return object; + }; + + /** + * Converts this PublishingOptions to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @instance + * @returns {Object.} JSON object + */ + PublishingOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PublishingOptions + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PublishingOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.PublishingOptions"; + }; + + /** + * EncodingFormat enum. + * @name google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat + * @enum {number} + * @property {number} ENCODING_FORMAT_UNSPECIFIED=0 ENCODING_FORMAT_UNSPECIFIED value + * @property {number} PEM=1 PEM value + * @property {number} DER=2 DER value + */ + PublishingOptions.EncodingFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCODING_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PEM"] = 1; + values[valuesById[2] = "DER"] = 2; + return values; + })(); + + return PublishingOptions; + })(); + + CaPool.IssuancePolicy = (function() { + + /** + * Properties of an IssuancePolicy. + * @memberof google.cloud.security.privateca.v1.CaPool + * @interface IIssuancePolicy + * @property {Array.|null} [allowedKeyTypes] IssuancePolicy allowedKeyTypes + * @property {google.protobuf.IDuration|null} [backdateDuration] IssuancePolicy backdateDuration + * @property {boolean|null} [allowRequesterSpecifiedNotBeforeTime] IssuancePolicy allowRequesterSpecifiedNotBeforeTime + * @property {google.protobuf.IDuration|null} [maximumLifetime] IssuancePolicy maximumLifetime + * @property {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes|null} [allowedIssuanceModes] IssuancePolicy allowedIssuanceModes + * @property {google.cloud.security.privateca.v1.IX509Parameters|null} [baselineValues] IssuancePolicy baselineValues + * @property {google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null} [identityConstraints] IssuancePolicy identityConstraints + * @property {google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null} [passthroughExtensions] IssuancePolicy passthroughExtensions + */ + + /** + * Constructs a new IssuancePolicy. + * @memberof google.cloud.security.privateca.v1.CaPool + * @classdesc Represents an IssuancePolicy. + * @implements IIssuancePolicy + * @constructor + * @param {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy=} [properties] Properties to set + */ + function IssuancePolicy(properties) { + this.allowedKeyTypes = []; + 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]]; + } + + /** + * IssuancePolicy allowedKeyTypes. + * @member {Array.} allowedKeyTypes + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @instance + */ + IssuancePolicy.prototype.allowedKeyTypes = $util.emptyArray; + + /** + * IssuancePolicy backdateDuration. + * @member {google.protobuf.IDuration|null|undefined} backdateDuration + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @instance + */ + IssuancePolicy.prototype.backdateDuration = null; + + /** + * IssuancePolicy allowRequesterSpecifiedNotBeforeTime. + * @member {boolean} allowRequesterSpecifiedNotBeforeTime + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @instance + */ + IssuancePolicy.prototype.allowRequesterSpecifiedNotBeforeTime = false; + + /** + * IssuancePolicy maximumLifetime. + * @member {google.protobuf.IDuration|null|undefined} maximumLifetime + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @instance + */ + IssuancePolicy.prototype.maximumLifetime = null; + + /** + * IssuancePolicy allowedIssuanceModes. + * @member {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes|null|undefined} allowedIssuanceModes + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @instance + */ + IssuancePolicy.prototype.allowedIssuanceModes = null; + + /** + * IssuancePolicy baselineValues. + * @member {google.cloud.security.privateca.v1.IX509Parameters|null|undefined} baselineValues + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @instance + */ + IssuancePolicy.prototype.baselineValues = null; + + /** + * IssuancePolicy identityConstraints. + * @member {google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null|undefined} identityConstraints + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @instance + */ + IssuancePolicy.prototype.identityConstraints = null; + + /** + * IssuancePolicy passthroughExtensions. + * @member {google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null|undefined} passthroughExtensions + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @instance + */ + IssuancePolicy.prototype.passthroughExtensions = null; + + /** + * Creates a new IssuancePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy} IssuancePolicy instance + */ + IssuancePolicy.create = function create(properties) { + return new IssuancePolicy(properties); + }; + + /** + * Encodes the specified IssuancePolicy message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy} message IssuancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IssuancePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedKeyTypes != null && message.allowedKeyTypes.length) + for (var i = 0; i < message.allowedKeyTypes.length; ++i) + $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.encode(message.allowedKeyTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maximumLifetime != null && Object.hasOwnProperty.call(message, "maximumLifetime")) + $root.google.protobuf.Duration.encode(message.maximumLifetime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allowedIssuanceModes != null && Object.hasOwnProperty.call(message, "allowedIssuanceModes")) + $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.encode(message.allowedIssuanceModes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.baselineValues != null && Object.hasOwnProperty.call(message, "baselineValues")) + $root.google.cloud.security.privateca.v1.X509Parameters.encode(message.baselineValues, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.identityConstraints != null && Object.hasOwnProperty.call(message, "identityConstraints")) + $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.encode(message.identityConstraints, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.passthroughExtensions != null && Object.hasOwnProperty.call(message, "passthroughExtensions")) + $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.encode(message.passthroughExtensions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.backdateDuration != null && Object.hasOwnProperty.call(message, "backdateDuration")) + $root.google.protobuf.Duration.encode(message.backdateDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.allowRequesterSpecifiedNotBeforeTime != null && Object.hasOwnProperty.call(message, "allowRequesterSpecifiedNotBeforeTime")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.allowRequesterSpecifiedNotBeforeTime); + return writer; + }; + + /** + * Encodes the specified IssuancePolicy message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy} message IssuancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IssuancePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IssuancePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy} IssuancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IssuancePolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.allowedKeyTypes && message.allowedKeyTypes.length)) + message.allowedKeyTypes = []; + message.allowedKeyTypes.push($root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.decode(reader, reader.uint32())); + break; + } + case 7: { + message.backdateDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.allowRequesterSpecifiedNotBeforeTime = reader.bool(); + break; + } + case 2: { + message.maximumLifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowedIssuanceModes = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.decode(reader, reader.uint32()); + break; + } + case 4: { + message.baselineValues = $root.google.cloud.security.privateca.v1.X509Parameters.decode(reader, reader.uint32()); + break; + } + case 5: { + message.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.decode(reader, reader.uint32()); + break; + } + case 6: { + message.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IssuancePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy} IssuancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IssuancePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IssuancePolicy message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IssuancePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedKeyTypes != null && message.hasOwnProperty("allowedKeyTypes")) { + if (!Array.isArray(message.allowedKeyTypes)) + return "allowedKeyTypes: array expected"; + for (var i = 0; i < message.allowedKeyTypes.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.verify(message.allowedKeyTypes[i]); + if (error) + return "allowedKeyTypes." + error; + } + } + if (message.backdateDuration != null && message.hasOwnProperty("backdateDuration")) { + var error = $root.google.protobuf.Duration.verify(message.backdateDuration); + if (error) + return "backdateDuration." + error; + } + if (message.allowRequesterSpecifiedNotBeforeTime != null && message.hasOwnProperty("allowRequesterSpecifiedNotBeforeTime")) + if (typeof message.allowRequesterSpecifiedNotBeforeTime !== "boolean") + return "allowRequesterSpecifiedNotBeforeTime: boolean expected"; + if (message.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) { + var error = $root.google.protobuf.Duration.verify(message.maximumLifetime); + if (error) + return "maximumLifetime." + error; + } + if (message.allowedIssuanceModes != null && message.hasOwnProperty("allowedIssuanceModes")) { + var error = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.verify(message.allowedIssuanceModes); + if (error) + return "allowedIssuanceModes." + error; + } + if (message.baselineValues != null && message.hasOwnProperty("baselineValues")) { + var error = $root.google.cloud.security.privateca.v1.X509Parameters.verify(message.baselineValues); + if (error) + return "baselineValues." + error; + } + if (message.identityConstraints != null && message.hasOwnProperty("identityConstraints")) { + var error = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify(message.identityConstraints); + if (error) + return "identityConstraints." + error; + } + if (message.passthroughExtensions != null && message.hasOwnProperty("passthroughExtensions")) { + var error = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify(message.passthroughExtensions); + if (error) + return "passthroughExtensions." + error; + } + return null; + }; + + /** + * Creates an IssuancePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy} IssuancePolicy + */ + IssuancePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy) + return object; + var message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy(); + if (object.allowedKeyTypes) { + if (!Array.isArray(object.allowedKeyTypes)) + throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allowedKeyTypes: array expected"); + message.allowedKeyTypes = []; + for (var i = 0; i < object.allowedKeyTypes.length; ++i) { + if (typeof object.allowedKeyTypes[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allowedKeyTypes: object expected"); + message.allowedKeyTypes[i] = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.fromObject(object.allowedKeyTypes[i]); + } + } + if (object.backdateDuration != null) { + if (typeof object.backdateDuration !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdateDuration: object expected"); + message.backdateDuration = $root.google.protobuf.Duration.fromObject(object.backdateDuration); + } + if (object.allowRequesterSpecifiedNotBeforeTime != null) + message.allowRequesterSpecifiedNotBeforeTime = Boolean(object.allowRequesterSpecifiedNotBeforeTime); + if (object.maximumLifetime != null) { + if (typeof object.maximumLifetime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.maximumLifetime: object expected"); + message.maximumLifetime = $root.google.protobuf.Duration.fromObject(object.maximumLifetime); + } + if (object.allowedIssuanceModes != null) { + if (typeof object.allowedIssuanceModes !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allowedIssuanceModes: object expected"); + message.allowedIssuanceModes = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.fromObject(object.allowedIssuanceModes); + } + if (object.baselineValues != null) { + if (typeof object.baselineValues !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baselineValues: object expected"); + message.baselineValues = $root.google.cloud.security.privateca.v1.X509Parameters.fromObject(object.baselineValues); + } + if (object.identityConstraints != null) { + if (typeof object.identityConstraints !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.identityConstraints: object expected"); + message.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.fromObject(object.identityConstraints); + } + if (object.passthroughExtensions != null) { + if (typeof object.passthroughExtensions !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.passthroughExtensions: object expected"); + message.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.fromObject(object.passthroughExtensions); + } + return message; + }; + + /** + * Creates a plain object from an IssuancePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy} message IssuancePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IssuancePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedKeyTypes = []; + if (options.defaults) { + object.maximumLifetime = null; + object.allowedIssuanceModes = null; + object.baselineValues = null; + object.identityConstraints = null; + object.passthroughExtensions = null; + object.backdateDuration = null; + object.allowRequesterSpecifiedNotBeforeTime = false; + } + if (message.allowedKeyTypes && message.allowedKeyTypes.length) { + object.allowedKeyTypes = []; + for (var j = 0; j < message.allowedKeyTypes.length; ++j) + object.allowedKeyTypes[j] = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.toObject(message.allowedKeyTypes[j], options); + } + if (message.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) + object.maximumLifetime = $root.google.protobuf.Duration.toObject(message.maximumLifetime, options); + if (message.allowedIssuanceModes != null && message.hasOwnProperty("allowedIssuanceModes")) + object.allowedIssuanceModes = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.toObject(message.allowedIssuanceModes, options); + if (message.baselineValues != null && message.hasOwnProperty("baselineValues")) + object.baselineValues = $root.google.cloud.security.privateca.v1.X509Parameters.toObject(message.baselineValues, options); + if (message.identityConstraints != null && message.hasOwnProperty("identityConstraints")) + object.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.toObject(message.identityConstraints, options); + if (message.passthroughExtensions != null && message.hasOwnProperty("passthroughExtensions")) + object.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.toObject(message.passthroughExtensions, options); + if (message.backdateDuration != null && message.hasOwnProperty("backdateDuration")) + object.backdateDuration = $root.google.protobuf.Duration.toObject(message.backdateDuration, options); + if (message.allowRequesterSpecifiedNotBeforeTime != null && message.hasOwnProperty("allowRequesterSpecifiedNotBeforeTime")) + object.allowRequesterSpecifiedNotBeforeTime = message.allowRequesterSpecifiedNotBeforeTime; + return object; + }; + + /** + * Converts this IssuancePolicy to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @instance + * @returns {Object.} JSON object + */ + IssuancePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IssuancePolicy + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IssuancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.IssuancePolicy"; + }; + + IssuancePolicy.AllowedKeyType = (function() { + + /** + * Properties of an AllowedKeyType. + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @interface IAllowedKeyType + * @property {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType|null} [rsa] AllowedKeyType rsa + * @property {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType|null} [ellipticCurve] AllowedKeyType ellipticCurve + */ + + /** + * Constructs a new AllowedKeyType. + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @classdesc Represents an AllowedKeyType. + * @implements IAllowedKeyType + * @constructor + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType=} [properties] Properties to set + */ + function AllowedKeyType(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]]; + } + + /** + * AllowedKeyType rsa. + * @member {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType|null|undefined} rsa + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @instance + */ + AllowedKeyType.prototype.rsa = null; + + /** + * AllowedKeyType ellipticCurve. + * @member {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType|null|undefined} ellipticCurve + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @instance + */ + AllowedKeyType.prototype.ellipticCurve = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AllowedKeyType keyType. + * @member {"rsa"|"ellipticCurve"|undefined} keyType + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @instance + */ + Object.defineProperty(AllowedKeyType.prototype, "keyType", { + get: $util.oneOfGetter($oneOfFields = ["rsa", "ellipticCurve"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AllowedKeyType instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType} AllowedKeyType instance + */ + AllowedKeyType.create = function create(properties) { + return new AllowedKeyType(properties); + }; + + /** + * Encodes the specified AllowedKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType} message AllowedKeyType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedKeyType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rsa != null && Object.hasOwnProperty.call(message, "rsa")) + $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.encode(message.rsa, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ellipticCurve != null && Object.hasOwnProperty.call(message, "ellipticCurve")) + $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.encode(message.ellipticCurve, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AllowedKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType} message AllowedKeyType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedKeyType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllowedKeyType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType} AllowedKeyType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedKeyType.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rsa = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.decode(reader, reader.uint32()); + break; + } + case 2: { + message.ellipticCurve = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllowedKeyType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType} AllowedKeyType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedKeyType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllowedKeyType message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllowedKeyType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rsa != null && message.hasOwnProperty("rsa")) { + properties.keyType = 1; + { + var error = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.verify(message.rsa); + if (error) + return "rsa." + error; + } + } + if (message.ellipticCurve != null && message.hasOwnProperty("ellipticCurve")) { + if (properties.keyType === 1) + return "keyType: multiple values"; + properties.keyType = 1; + { + var error = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.verify(message.ellipticCurve); + if (error) + return "ellipticCurve." + error; + } + } + return null; + }; + + /** + * Creates an AllowedKeyType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType} AllowedKeyType + */ + AllowedKeyType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType) + return object; + var message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType(); + if (object.rsa != null) { + if (typeof object.rsa !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.rsa: object expected"); + message.rsa = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.fromObject(object.rsa); + } + if (object.ellipticCurve != null) { + if (typeof object.ellipticCurve !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.ellipticCurve: object expected"); + message.ellipticCurve = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.fromObject(object.ellipticCurve); + } + return message; + }; + + /** + * Creates a plain object from an AllowedKeyType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType} message AllowedKeyType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllowedKeyType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.rsa != null && message.hasOwnProperty("rsa")) { + object.rsa = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.toObject(message.rsa, options); + if (options.oneofs) + object.keyType = "rsa"; + } + if (message.ellipticCurve != null && message.hasOwnProperty("ellipticCurve")) { + object.ellipticCurve = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.toObject(message.ellipticCurve, options); + if (options.oneofs) + object.keyType = "ellipticCurve"; + } + return object; + }; + + /** + * Converts this AllowedKeyType to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @instance + * @returns {Object.} JSON object + */ + AllowedKeyType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllowedKeyType + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllowedKeyType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType"; + }; + + AllowedKeyType.RsaKeyType = (function() { + + /** + * Properties of a RsaKeyType. + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @interface IRsaKeyType + * @property {number|Long|null} [minModulusSize] RsaKeyType minModulusSize + * @property {number|Long|null} [maxModulusSize] RsaKeyType maxModulusSize + */ + + /** + * Constructs a new RsaKeyType. + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @classdesc Represents a RsaKeyType. + * @implements IRsaKeyType + * @constructor + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType=} [properties] Properties to set + */ + function RsaKeyType(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]]; + } + + /** + * RsaKeyType minModulusSize. + * @member {number|Long} minModulusSize + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @instance + */ + RsaKeyType.prototype.minModulusSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RsaKeyType maxModulusSize. + * @member {number|Long} maxModulusSize + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @instance + */ + RsaKeyType.prototype.maxModulusSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RsaKeyType instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType} RsaKeyType instance + */ + RsaKeyType.create = function create(properties) { + return new RsaKeyType(properties); + }; + + /** + * Encodes the specified RsaKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType} message RsaKeyType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RsaKeyType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minModulusSize != null && Object.hasOwnProperty.call(message, "minModulusSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.minModulusSize); + if (message.maxModulusSize != null && Object.hasOwnProperty.call(message, "maxModulusSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxModulusSize); + return writer; + }; + + /** + * Encodes the specified RsaKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType} message RsaKeyType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RsaKeyType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RsaKeyType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType} RsaKeyType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RsaKeyType.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minModulusSize = reader.int64(); + break; + } + case 2: { + message.maxModulusSize = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RsaKeyType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType} RsaKeyType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RsaKeyType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RsaKeyType message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RsaKeyType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minModulusSize != null && message.hasOwnProperty("minModulusSize")) + if (!$util.isInteger(message.minModulusSize) && !(message.minModulusSize && $util.isInteger(message.minModulusSize.low) && $util.isInteger(message.minModulusSize.high))) + return "minModulusSize: integer|Long expected"; + if (message.maxModulusSize != null && message.hasOwnProperty("maxModulusSize")) + if (!$util.isInteger(message.maxModulusSize) && !(message.maxModulusSize && $util.isInteger(message.maxModulusSize.low) && $util.isInteger(message.maxModulusSize.high))) + return "maxModulusSize: integer|Long expected"; + return null; + }; + + /** + * Creates a RsaKeyType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType} RsaKeyType + */ + RsaKeyType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType) + return object; + var message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType(); + if (object.minModulusSize != null) + if ($util.Long) + (message.minModulusSize = $util.Long.fromValue(object.minModulusSize)).unsigned = false; + else if (typeof object.minModulusSize === "string") + message.minModulusSize = parseInt(object.minModulusSize, 10); + else if (typeof object.minModulusSize === "number") + message.minModulusSize = object.minModulusSize; + else if (typeof object.minModulusSize === "object") + message.minModulusSize = new $util.LongBits(object.minModulusSize.low >>> 0, object.minModulusSize.high >>> 0).toNumber(); + if (object.maxModulusSize != null) + if ($util.Long) + (message.maxModulusSize = $util.Long.fromValue(object.maxModulusSize)).unsigned = false; + else if (typeof object.maxModulusSize === "string") + message.maxModulusSize = parseInt(object.maxModulusSize, 10); + else if (typeof object.maxModulusSize === "number") + message.maxModulusSize = object.maxModulusSize; + else if (typeof object.maxModulusSize === "object") + message.maxModulusSize = new $util.LongBits(object.maxModulusSize.low >>> 0, object.maxModulusSize.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RsaKeyType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType} message RsaKeyType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RsaKeyType.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.minModulusSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.minModulusSize = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxModulusSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxModulusSize = options.longs === String ? "0" : 0; + } + if (message.minModulusSize != null && message.hasOwnProperty("minModulusSize")) + if (typeof message.minModulusSize === "number") + object.minModulusSize = options.longs === String ? String(message.minModulusSize) : message.minModulusSize; + else + object.minModulusSize = options.longs === String ? $util.Long.prototype.toString.call(message.minModulusSize) : options.longs === Number ? new $util.LongBits(message.minModulusSize.low >>> 0, message.minModulusSize.high >>> 0).toNumber() : message.minModulusSize; + if (message.maxModulusSize != null && message.hasOwnProperty("maxModulusSize")) + if (typeof message.maxModulusSize === "number") + object.maxModulusSize = options.longs === String ? String(message.maxModulusSize) : message.maxModulusSize; + else + object.maxModulusSize = options.longs === String ? $util.Long.prototype.toString.call(message.maxModulusSize) : options.longs === Number ? new $util.LongBits(message.maxModulusSize.low >>> 0, message.maxModulusSize.high >>> 0).toNumber() : message.maxModulusSize; + return object; + }; + + /** + * Converts this RsaKeyType to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @instance + * @returns {Object.} JSON object + */ + RsaKeyType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RsaKeyType + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RsaKeyType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType"; + }; + + return RsaKeyType; + })(); + + AllowedKeyType.EcKeyType = (function() { + + /** + * Properties of an EcKeyType. + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @interface IEcKeyType + * @property {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm|null} [signatureAlgorithm] EcKeyType signatureAlgorithm + */ + + /** + * Constructs a new EcKeyType. + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType + * @classdesc Represents an EcKeyType. + * @implements IEcKeyType + * @constructor + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType=} [properties] Properties to set + */ + function EcKeyType(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]]; + } + + /** + * EcKeyType signatureAlgorithm. + * @member {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm} signatureAlgorithm + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType + * @instance + */ + EcKeyType.prototype.signatureAlgorithm = 0; + + /** + * Creates a new EcKeyType instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType} EcKeyType instance + */ + EcKeyType.create = function create(properties) { + return new EcKeyType(properties); + }; + + /** + * Encodes the specified EcKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType} message EcKeyType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EcKeyType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signatureAlgorithm != null && Object.hasOwnProperty.call(message, "signatureAlgorithm")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.signatureAlgorithm); + return writer; + }; + + /** + * Encodes the specified EcKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType} message EcKeyType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EcKeyType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EcKeyType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType} EcKeyType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EcKeyType.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.signatureAlgorithm = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EcKeyType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType} EcKeyType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EcKeyType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EcKeyType message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EcKeyType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signatureAlgorithm != null && message.hasOwnProperty("signatureAlgorithm")) + switch (message.signatureAlgorithm) { + default: + return "signatureAlgorithm: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an EcKeyType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType} EcKeyType + */ + EcKeyType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType) + return object; + var message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType(); + switch (object.signatureAlgorithm) { + default: + if (typeof object.signatureAlgorithm === "number") { + message.signatureAlgorithm = object.signatureAlgorithm; + break; + } + break; + case "EC_SIGNATURE_ALGORITHM_UNSPECIFIED": + case 0: + message.signatureAlgorithm = 0; + break; + case "ECDSA_P256": + case 1: + message.signatureAlgorithm = 1; + break; + case "ECDSA_P384": + case 2: + message.signatureAlgorithm = 2; + break; + case "EDDSA_25519": + case 3: + message.signatureAlgorithm = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an EcKeyType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType} message EcKeyType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EcKeyType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.signatureAlgorithm = options.enums === String ? "EC_SIGNATURE_ALGORITHM_UNSPECIFIED" : 0; + if (message.signatureAlgorithm != null && message.hasOwnProperty("signatureAlgorithm")) + object.signatureAlgorithm = options.enums === String ? $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm[message.signatureAlgorithm] === undefined ? message.signatureAlgorithm : $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm[message.signatureAlgorithm] : message.signatureAlgorithm; + return object; + }; + + /** + * Converts this EcKeyType to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType + * @instance + * @returns {Object.} JSON object + */ + EcKeyType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EcKeyType + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EcKeyType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType"; + }; + + /** + * EcSignatureAlgorithm enum. + * @name google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm + * @enum {number} + * @property {number} EC_SIGNATURE_ALGORITHM_UNSPECIFIED=0 EC_SIGNATURE_ALGORITHM_UNSPECIFIED value + * @property {number} ECDSA_P256=1 ECDSA_P256 value + * @property {number} ECDSA_P384=2 ECDSA_P384 value + * @property {number} EDDSA_25519=3 EDDSA_25519 value + */ + EcKeyType.EcSignatureAlgorithm = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EC_SIGNATURE_ALGORITHM_UNSPECIFIED"] = 0; + values[valuesById[1] = "ECDSA_P256"] = 1; + values[valuesById[2] = "ECDSA_P384"] = 2; + values[valuesById[3] = "EDDSA_25519"] = 3; + return values; + })(); + + return EcKeyType; + })(); + + return AllowedKeyType; + })(); + + IssuancePolicy.IssuanceModes = (function() { + + /** + * Properties of an IssuanceModes. + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @interface IIssuanceModes + * @property {boolean|null} [allowCsrBasedIssuance] IssuanceModes allowCsrBasedIssuance + * @property {boolean|null} [allowConfigBasedIssuance] IssuanceModes allowConfigBasedIssuance + */ + + /** + * Constructs a new IssuanceModes. + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @classdesc Represents an IssuanceModes. + * @implements IIssuanceModes + * @constructor + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes=} [properties] Properties to set + */ + function IssuanceModes(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]]; + } + + /** + * IssuanceModes allowCsrBasedIssuance. + * @member {boolean} allowCsrBasedIssuance + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @instance + */ + IssuanceModes.prototype.allowCsrBasedIssuance = false; + + /** + * IssuanceModes allowConfigBasedIssuance. + * @member {boolean} allowConfigBasedIssuance + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @instance + */ + IssuanceModes.prototype.allowConfigBasedIssuance = false; + + /** + * Creates a new IssuanceModes instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes} IssuanceModes instance + */ + IssuanceModes.create = function create(properties) { + return new IssuanceModes(properties); + }; + + /** + * Encodes the specified IssuanceModes message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes} message IssuanceModes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IssuanceModes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowCsrBasedIssuance != null && Object.hasOwnProperty.call(message, "allowCsrBasedIssuance")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowCsrBasedIssuance); + if (message.allowConfigBasedIssuance != null && Object.hasOwnProperty.call(message, "allowConfigBasedIssuance")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowConfigBasedIssuance); + return writer; + }; + + /** + * Encodes the specified IssuanceModes message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes} message IssuanceModes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IssuanceModes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IssuanceModes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes} IssuanceModes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IssuanceModes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.allowCsrBasedIssuance = reader.bool(); + break; + } + case 2: { + message.allowConfigBasedIssuance = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IssuanceModes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes} IssuanceModes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IssuanceModes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IssuanceModes message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IssuanceModes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowCsrBasedIssuance != null && message.hasOwnProperty("allowCsrBasedIssuance")) + if (typeof message.allowCsrBasedIssuance !== "boolean") + return "allowCsrBasedIssuance: boolean expected"; + if (message.allowConfigBasedIssuance != null && message.hasOwnProperty("allowConfigBasedIssuance")) + if (typeof message.allowConfigBasedIssuance !== "boolean") + return "allowConfigBasedIssuance: boolean expected"; + return null; + }; + + /** + * Creates an IssuanceModes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes} IssuanceModes + */ + IssuanceModes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes) + return object; + var message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes(); + if (object.allowCsrBasedIssuance != null) + message.allowCsrBasedIssuance = Boolean(object.allowCsrBasedIssuance); + if (object.allowConfigBasedIssuance != null) + message.allowConfigBasedIssuance = Boolean(object.allowConfigBasedIssuance); + return message; + }; + + /** + * Creates a plain object from an IssuanceModes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @static + * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes} message IssuanceModes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IssuanceModes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.allowCsrBasedIssuance = false; + object.allowConfigBasedIssuance = false; + } + if (message.allowCsrBasedIssuance != null && message.hasOwnProperty("allowCsrBasedIssuance")) + object.allowCsrBasedIssuance = message.allowCsrBasedIssuance; + if (message.allowConfigBasedIssuance != null && message.hasOwnProperty("allowConfigBasedIssuance")) + object.allowConfigBasedIssuance = message.allowConfigBasedIssuance; + return object; + }; + + /** + * Converts this IssuanceModes to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @instance + * @returns {Object.} JSON object + */ + IssuanceModes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IssuanceModes + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IssuanceModes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes"; + }; + + return IssuanceModes; + })(); + + return IssuancePolicy; + })(); + + return CaPool; + })(); + + v1.EncryptionSpec = (function() { + + /** + * Properties of an EncryptionSpec. + * @memberof google.cloud.security.privateca.v1 + * @interface IEncryptionSpec + * @property {string|null} [cloudKmsKey] EncryptionSpec cloudKmsKey + */ + + /** + * Constructs a new EncryptionSpec. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an EncryptionSpec. + * @implements IEncryptionSpec + * @constructor + * @param {google.cloud.security.privateca.v1.IEncryptionSpec=} [properties] Properties to set + */ + function EncryptionSpec(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]]; + } + + /** + * EncryptionSpec cloudKmsKey. + * @member {string} cloudKmsKey + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @instance + */ + EncryptionSpec.prototype.cloudKmsKey = ""; + + /** + * Creates a new EncryptionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {google.cloud.security.privateca.v1.IEncryptionSpec=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec instance + */ + EncryptionSpec.create = function create(properties) { + return new EncryptionSpec(properties); + }; + + /** + * Encodes the specified EncryptionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {google.cloud.security.privateca.v1.IEncryptionSpec} message EncryptionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudKmsKey != null && Object.hasOwnProperty.call(message, "cloudKmsKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudKmsKey); + return writer; + }; + + /** + * Encodes the specified EncryptionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {google.cloud.security.privateca.v1.IEncryptionSpec} message EncryptionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.EncryptionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cloudKmsKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionSpec message. + * @function verify + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudKmsKey != null && message.hasOwnProperty("cloudKmsKey")) + if (!$util.isString(message.cloudKmsKey)) + return "cloudKmsKey: string expected"; + return null; + }; + + /** + * Creates an EncryptionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec + */ + EncryptionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.EncryptionSpec) + return object; + var message = new $root.google.cloud.security.privateca.v1.EncryptionSpec(); + if (object.cloudKmsKey != null) + message.cloudKmsKey = String(object.cloudKmsKey); + return message; + }; + + /** + * Creates a plain object from an EncryptionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {google.cloud.security.privateca.v1.EncryptionSpec} message EncryptionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cloudKmsKey = ""; + if (message.cloudKmsKey != null && message.hasOwnProperty("cloudKmsKey")) + object.cloudKmsKey = message.cloudKmsKey; + return object; + }; + + /** + * Converts this EncryptionSpec to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @instance + * @returns {Object.} JSON object + */ + EncryptionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionSpec + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.EncryptionSpec"; + }; + + return EncryptionSpec; + })(); + + v1.CertificateRevocationList = (function() { + + /** + * Properties of a CertificateRevocationList. + * @memberof google.cloud.security.privateca.v1 + * @interface ICertificateRevocationList + * @property {string|null} [name] CertificateRevocationList name + * @property {number|Long|null} [sequenceNumber] CertificateRevocationList sequenceNumber + * @property {Array.|null} [revokedCertificates] CertificateRevocationList revokedCertificates + * @property {string|null} [pemCrl] CertificateRevocationList pemCrl + * @property {string|null} [accessUrl] CertificateRevocationList accessUrl + * @property {google.cloud.security.privateca.v1.CertificateRevocationList.State|null} [state] CertificateRevocationList state + * @property {google.protobuf.ITimestamp|null} [createTime] CertificateRevocationList createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateRevocationList updateTime + * @property {string|null} [revisionId] CertificateRevocationList revisionId + * @property {Object.|null} [labels] CertificateRevocationList labels + */ + + /** + * Constructs a new CertificateRevocationList. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CertificateRevocationList. + * @implements ICertificateRevocationList + * @constructor + * @param {google.cloud.security.privateca.v1.ICertificateRevocationList=} [properties] Properties to set + */ + function CertificateRevocationList(properties) { + this.revokedCertificates = []; + 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]]; + } + + /** + * CertificateRevocationList name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.name = ""; + + /** + * CertificateRevocationList sequenceNumber. + * @member {number|Long} sequenceNumber + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CertificateRevocationList revokedCertificates. + * @member {Array.} revokedCertificates + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.revokedCertificates = $util.emptyArray; + + /** + * CertificateRevocationList pemCrl. + * @member {string} pemCrl + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.pemCrl = ""; + + /** + * CertificateRevocationList accessUrl. + * @member {string} accessUrl + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.accessUrl = ""; + + /** + * CertificateRevocationList state. + * @member {google.cloud.security.privateca.v1.CertificateRevocationList.State} state + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.state = 0; + + /** + * CertificateRevocationList createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.createTime = null; + + /** + * CertificateRevocationList updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.updateTime = null; + + /** + * CertificateRevocationList revisionId. + * @member {string} revisionId + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.revisionId = ""; + + /** + * CertificateRevocationList labels. + * @member {Object.} labels + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.labels = $util.emptyObject; + + /** + * Creates a new CertificateRevocationList instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @static + * @param {google.cloud.security.privateca.v1.ICertificateRevocationList=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateRevocationList} CertificateRevocationList instance + */ + CertificateRevocationList.create = function create(properties) { + return new CertificateRevocationList(properties); + }; + + /** + * Encodes the specified CertificateRevocationList message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @static + * @param {google.cloud.security.privateca.v1.ICertificateRevocationList} message CertificateRevocationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateRevocationList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sequenceNumber); + if (message.revokedCertificates != null && message.revokedCertificates.length) + for (var i = 0; i < message.revokedCertificates.length; ++i) + $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.encode(message.revokedCertificates[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pemCrl != null && Object.hasOwnProperty.call(message, "pemCrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pemCrl); + if (message.accessUrl != null && Object.hasOwnProperty.call(message, "accessUrl")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.accessUrl); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.revisionId); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 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(); + return writer; + }; + + /** + * Encodes the specified CertificateRevocationList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @static + * @param {google.cloud.security.privateca.v1.ICertificateRevocationList} message CertificateRevocationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateRevocationList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateRevocationList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateRevocationList} CertificateRevocationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateRevocationList.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateRevocationList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sequenceNumber = reader.int64(); + break; + } + case 3: { + if (!(message.revokedCertificates && message.revokedCertificates.length)) + message.revokedCertificates = []; + message.revokedCertificates.push($root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.decode(reader, reader.uint32())); + break; + } + case 4: { + message.pemCrl = reader.string(); + break; + } + case 5: { + message.accessUrl = reader.string(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.revisionId = reader.string(); + break; + } + case 10: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateRevocationList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateRevocationList} CertificateRevocationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateRevocationList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateRevocationList message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateRevocationList.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.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) + return "sequenceNumber: integer|Long expected"; + if (message.revokedCertificates != null && message.hasOwnProperty("revokedCertificates")) { + if (!Array.isArray(message.revokedCertificates)) + return "revokedCertificates: array expected"; + for (var i = 0; i < message.revokedCertificates.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.verify(message.revokedCertificates[i]); + if (error) + return "revokedCertificates." + error; + } + } + if (message.pemCrl != null && message.hasOwnProperty("pemCrl")) + if (!$util.isString(message.pemCrl)) + return "pemCrl: string expected"; + if (message.accessUrl != null && message.hasOwnProperty("accessUrl")) + if (!$util.isString(message.accessUrl)) + return "accessUrl: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a CertificateRevocationList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateRevocationList} CertificateRevocationList + */ + CertificateRevocationList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateRevocationList) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateRevocationList(); + if (object.name != null) + message.name = String(object.name); + if (object.sequenceNumber != null) + if ($util.Long) + (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; + else if (typeof object.sequenceNumber === "string") + message.sequenceNumber = parseInt(object.sequenceNumber, 10); + else if (typeof object.sequenceNumber === "number") + message.sequenceNumber = object.sequenceNumber; + else if (typeof object.sequenceNumber === "object") + message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); + if (object.revokedCertificates) { + if (!Array.isArray(object.revokedCertificates)) + throw TypeError(".google.cloud.security.privateca.v1.CertificateRevocationList.revokedCertificates: array expected"); + message.revokedCertificates = []; + for (var i = 0; i < object.revokedCertificates.length; ++i) { + if (typeof object.revokedCertificates[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateRevocationList.revokedCertificates: object expected"); + message.revokedCertificates[i] = $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.fromObject(object.revokedCertificates[i]); + } + } + if (object.pemCrl != null) + message.pemCrl = String(object.pemCrl); + if (object.accessUrl != null) + message.accessUrl = String(object.accessUrl); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateRevocationList.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateRevocationList.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateRevocationList.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 CertificateRevocationList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @static + * @param {google.cloud.security.privateca.v1.CertificateRevocationList} message CertificateRevocationList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateRevocationList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.revokedCertificates = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequenceNumber = options.longs === String ? "0" : 0; + object.pemCrl = ""; + object.accessUrl = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.revisionId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (typeof message.sequenceNumber === "number") + object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; + else + object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; + if (message.revokedCertificates && message.revokedCertificates.length) { + object.revokedCertificates = []; + for (var j = 0; j < message.revokedCertificates.length; ++j) + object.revokedCertificates[j] = $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.toObject(message.revokedCertificates[j], options); + } + if (message.pemCrl != null && message.hasOwnProperty("pemCrl")) + object.pemCrl = message.pemCrl; + if (message.accessUrl != null && message.hasOwnProperty("accessUrl")) + object.accessUrl = message.accessUrl; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.security.privateca.v1.CertificateRevocationList.State[message.state] === undefined ? message.state : $root.google.cloud.security.privateca.v1.CertificateRevocationList.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + 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]]; + } + return object; + }; + + /** + * Converts this CertificateRevocationList to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @instance + * @returns {Object.} JSON object + */ + CertificateRevocationList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateRevocationList + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateRevocationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateRevocationList"; + }; + + CertificateRevocationList.RevokedCertificate = (function() { + + /** + * Properties of a RevokedCertificate. + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @interface IRevokedCertificate + * @property {string|null} [certificate] RevokedCertificate certificate + * @property {string|null} [hexSerialNumber] RevokedCertificate hexSerialNumber + * @property {google.cloud.security.privateca.v1.RevocationReason|null} [revocationReason] RevokedCertificate revocationReason + */ + + /** + * Constructs a new RevokedCertificate. + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList + * @classdesc Represents a RevokedCertificate. + * @implements IRevokedCertificate + * @constructor + * @param {google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate=} [properties] Properties to set + */ + function RevokedCertificate(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]]; + } + + /** + * RevokedCertificate certificate. + * @member {string} certificate + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @instance + */ + RevokedCertificate.prototype.certificate = ""; + + /** + * RevokedCertificate hexSerialNumber. + * @member {string} hexSerialNumber + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @instance + */ + RevokedCertificate.prototype.hexSerialNumber = ""; + + /** + * RevokedCertificate revocationReason. + * @member {google.cloud.security.privateca.v1.RevocationReason} revocationReason + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @instance + */ + RevokedCertificate.prototype.revocationReason = 0; + + /** + * Creates a new RevokedCertificate instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @static + * @param {google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate} RevokedCertificate instance + */ + RevokedCertificate.create = function create(properties) { + return new RevokedCertificate(properties); + }; + + /** + * Encodes the specified RevokedCertificate message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @static + * @param {google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate} message RevokedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevokedCertificate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificate); + if (message.hexSerialNumber != null && Object.hasOwnProperty.call(message, "hexSerialNumber")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.hexSerialNumber); + if (message.revocationReason != null && Object.hasOwnProperty.call(message, "revocationReason")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.revocationReason); + return writer; + }; + + /** + * Encodes the specified RevokedCertificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @static + * @param {google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate} message RevokedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevokedCertificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RevokedCertificate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate} RevokedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevokedCertificate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.certificate = reader.string(); + break; + } + case 2: { + message.hexSerialNumber = reader.string(); + break; + } + case 3: { + message.revocationReason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RevokedCertificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate} RevokedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevokedCertificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RevokedCertificate message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RevokedCertificate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificate != null && message.hasOwnProperty("certificate")) + if (!$util.isString(message.certificate)) + return "certificate: string expected"; + if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) + if (!$util.isString(message.hexSerialNumber)) + return "hexSerialNumber: string expected"; + if (message.revocationReason != null && message.hasOwnProperty("revocationReason")) + switch (message.revocationReason) { + default: + return "revocationReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + return null; + }; + + /** + * Creates a RevokedCertificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate} RevokedCertificate + */ + RevokedCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate(); + if (object.certificate != null) + message.certificate = String(object.certificate); + if (object.hexSerialNumber != null) + message.hexSerialNumber = String(object.hexSerialNumber); + switch (object.revocationReason) { + default: + if (typeof object.revocationReason === "number") { + message.revocationReason = object.revocationReason; + break; + } + break; + case "REVOCATION_REASON_UNSPECIFIED": + case 0: + message.revocationReason = 0; + break; + case "KEY_COMPROMISE": + case 1: + message.revocationReason = 1; + break; + case "CERTIFICATE_AUTHORITY_COMPROMISE": + case 2: + message.revocationReason = 2; + break; + case "AFFILIATION_CHANGED": + case 3: + message.revocationReason = 3; + break; + case "SUPERSEDED": + case 4: + message.revocationReason = 4; + break; + case "CESSATION_OF_OPERATION": + case 5: + message.revocationReason = 5; + break; + case "CERTIFICATE_HOLD": + case 6: + message.revocationReason = 6; + break; + case "PRIVILEGE_WITHDRAWN": + case 7: + message.revocationReason = 7; + break; + case "ATTRIBUTE_AUTHORITY_COMPROMISE": + case 8: + message.revocationReason = 8; + break; + } + return message; + }; + + /** + * Creates a plain object from a RevokedCertificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @static + * @param {google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate} message RevokedCertificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RevokedCertificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificate = ""; + object.hexSerialNumber = ""; + object.revocationReason = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; + } + if (message.certificate != null && message.hasOwnProperty("certificate")) + object.certificate = message.certificate; + if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) + object.hexSerialNumber = message.hexSerialNumber; + if (message.revocationReason != null && message.hasOwnProperty("revocationReason")) + object.revocationReason = options.enums === String ? $root.google.cloud.security.privateca.v1.RevocationReason[message.revocationReason] === undefined ? message.revocationReason : $root.google.cloud.security.privateca.v1.RevocationReason[message.revocationReason] : message.revocationReason; + return object; + }; + + /** + * Converts this RevokedCertificate to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @instance + * @returns {Object.} JSON object + */ + RevokedCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RevokedCertificate + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RevokedCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate"; + }; + + return RevokedCertificate; + })(); + + /** + * State enum. + * @name google.cloud.security.privateca.v1.CertificateRevocationList.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} SUPERSEDED=2 SUPERSEDED value + */ + CertificateRevocationList.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + return values; + })(); + + return CertificateRevocationList; + })(); + + v1.Certificate = (function() { + + /** + * Properties of a Certificate. + * @memberof google.cloud.security.privateca.v1 + * @interface ICertificate + * @property {string|null} [name] Certificate name + * @property {string|null} [pemCsr] Certificate pemCsr + * @property {google.cloud.security.privateca.v1.ICertificateConfig|null} [config] Certificate config + * @property {string|null} [issuerCertificateAuthority] Certificate issuerCertificateAuthority + * @property {google.protobuf.IDuration|null} [lifetime] Certificate lifetime + * @property {string|null} [certificateTemplate] Certificate certificateTemplate + * @property {google.cloud.security.privateca.v1.SubjectRequestMode|null} [subjectMode] Certificate subjectMode + * @property {google.cloud.security.privateca.v1.Certificate.IRevocationDetails|null} [revocationDetails] Certificate revocationDetails + * @property {string|null} [pemCertificate] Certificate pemCertificate + * @property {google.cloud.security.privateca.v1.ICertificateDescription|null} [certificateDescription] Certificate certificateDescription + * @property {Array.|null} [pemCertificateChain] Certificate pemCertificateChain + * @property {google.protobuf.ITimestamp|null} [createTime] Certificate createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Certificate updateTime + * @property {Object.|null} [labels] Certificate labels + * @property {google.protobuf.ITimestamp|null} [requestedNotBeforeTime] Certificate requestedNotBeforeTime + */ + + /** + * Constructs a new Certificate. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a Certificate. + * @implements ICertificate + * @constructor + * @param {google.cloud.security.privateca.v1.ICertificate=} [properties] Properties to set + */ + function Certificate(properties) { + this.pemCertificateChain = []; + 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]]; + } + + /** + * Certificate name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.name = ""; + + /** + * Certificate pemCsr. + * @member {string|null|undefined} pemCsr + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.pemCsr = null; + + /** + * Certificate config. + * @member {google.cloud.security.privateca.v1.ICertificateConfig|null|undefined} config + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.config = null; + + /** + * Certificate issuerCertificateAuthority. + * @member {string} issuerCertificateAuthority + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.issuerCertificateAuthority = ""; + + /** + * Certificate lifetime. + * @member {google.protobuf.IDuration|null|undefined} lifetime + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.lifetime = null; + + /** + * Certificate certificateTemplate. + * @member {string} certificateTemplate + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.certificateTemplate = ""; + + /** + * Certificate subjectMode. + * @member {google.cloud.security.privateca.v1.SubjectRequestMode} subjectMode + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.subjectMode = 0; + + /** + * Certificate revocationDetails. + * @member {google.cloud.security.privateca.v1.Certificate.IRevocationDetails|null|undefined} revocationDetails + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.revocationDetails = null; + + /** + * Certificate pemCertificate. + * @member {string} pemCertificate + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.pemCertificate = ""; + + /** + * Certificate certificateDescription. + * @member {google.cloud.security.privateca.v1.ICertificateDescription|null|undefined} certificateDescription + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.certificateDescription = null; + + /** + * Certificate pemCertificateChain. + * @member {Array.} pemCertificateChain + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.pemCertificateChain = $util.emptyArray; + + /** + * Certificate createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.createTime = null; + + /** + * Certificate updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.updateTime = null; + + /** + * Certificate labels. + * @member {Object.} labels + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.labels = $util.emptyObject; + + /** + * Certificate requestedNotBeforeTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestedNotBeforeTime + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.requestedNotBeforeTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Certificate certificateConfig. + * @member {"pemCsr"|"config"|undefined} certificateConfig + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Object.defineProperty(Certificate.prototype, "certificateConfig", { + get: $util.oneOfGetter($oneOfFields = ["pemCsr", "config"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Certificate instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.Certificate + * @static + * @param {google.cloud.security.privateca.v1.ICertificate=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.Certificate} Certificate instance + */ + Certificate.create = function create(properties) { + return new Certificate(properties); + }; + + /** + * Encodes the specified Certificate message. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.Certificate + * @static + * @param {google.cloud.security.privateca.v1.ICertificate} message Certificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Certificate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCsr); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.security.privateca.v1.CertificateConfig.encode(message.config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.issuerCertificateAuthority != null && Object.hasOwnProperty.call(message, "issuerCertificateAuthority")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.issuerCertificateAuthority); + if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) + $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.certificateTemplate != null && Object.hasOwnProperty.call(message, "certificateTemplate")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.certificateTemplate); + if (message.subjectMode != null && Object.hasOwnProperty.call(message, "subjectMode")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.subjectMode); + if (message.revocationDetails != null && Object.hasOwnProperty.call(message, "revocationDetails")) + $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails.encode(message.revocationDetails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.pemCertificate); + if (message.certificateDescription != null && Object.hasOwnProperty.call(message, "certificateDescription")) + $root.google.cloud.security.privateca.v1.CertificateDescription.encode(message.certificateDescription, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.pemCertificateChain != null && message.pemCertificateChain.length) + for (var i = 0; i < message.pemCertificateChain.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.pemCertificateChain[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.requestedNotBeforeTime != null && Object.hasOwnProperty.call(message, "requestedNotBeforeTime")) + $root.google.protobuf.Timestamp.encode(message.requestedNotBeforeTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Certificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.Certificate + * @static + * @param {google.cloud.security.privateca.v1.ICertificate} message Certificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Certificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Certificate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.Certificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.Certificate} Certificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Certificate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.Certificate(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pemCsr = reader.string(); + break; + } + case 3: { + message.config = $root.google.cloud.security.privateca.v1.CertificateConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.issuerCertificateAuthority = reader.string(); + break; + } + case 5: { + message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.certificateTemplate = reader.string(); + break; + } + case 7: { + message.subjectMode = reader.int32(); + break; + } + case 8: { + message.revocationDetails = $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails.decode(reader, reader.uint32()); + break; + } + case 9: { + message.pemCertificate = reader.string(); + break; + } + case 10: { + message.certificateDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.pemCertificateChain && message.pemCertificateChain.length)) + message.pemCertificateChain = []; + message.pemCertificateChain.push(reader.string()); + break; + } + case 12: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 15: { + message.requestedNotBeforeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Certificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.Certificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.Certificate} Certificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Certificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Certificate message. + * @function verify + * @memberof google.cloud.security.privateca.v1.Certificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Certificate.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.pemCsr != null && message.hasOwnProperty("pemCsr")) { + properties.certificateConfig = 1; + if (!$util.isString(message.pemCsr)) + return "pemCsr: string expected"; + } + if (message.config != null && message.hasOwnProperty("config")) { + if (properties.certificateConfig === 1) + return "certificateConfig: multiple values"; + properties.certificateConfig = 1; + { + var error = $root.google.cloud.security.privateca.v1.CertificateConfig.verify(message.config); + if (error) + return "config." + error; + } + } + if (message.issuerCertificateAuthority != null && message.hasOwnProperty("issuerCertificateAuthority")) + if (!$util.isString(message.issuerCertificateAuthority)) + return "issuerCertificateAuthority: string expected"; + if (message.lifetime != null && message.hasOwnProperty("lifetime")) { + var error = $root.google.protobuf.Duration.verify(message.lifetime); + if (error) + return "lifetime." + error; + } + if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) + if (!$util.isString(message.certificateTemplate)) + return "certificateTemplate: string expected"; + if (message.subjectMode != null && message.hasOwnProperty("subjectMode")) + switch (message.subjectMode) { + default: + return "subjectMode: enum value expected"; + case 0: + case 1: + case 3: + case 2: + break; + } + if (message.revocationDetails != null && message.hasOwnProperty("revocationDetails")) { + var error = $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails.verify(message.revocationDetails); + if (error) + return "revocationDetails." + error; + } + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + if (!$util.isString(message.pemCertificate)) + return "pemCertificate: string expected"; + if (message.certificateDescription != null && message.hasOwnProperty("certificateDescription")) { + var error = $root.google.cloud.security.privateca.v1.CertificateDescription.verify(message.certificateDescription); + if (error) + return "certificateDescription." + error; + } + if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { + if (!Array.isArray(message.pemCertificateChain)) + return "pemCertificateChain: array expected"; + for (var i = 0; i < message.pemCertificateChain.length; ++i) + if (!$util.isString(message.pemCertificateChain[i])) + return "pemCertificateChain: string[] expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.requestedNotBeforeTime != null && message.hasOwnProperty("requestedNotBeforeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestedNotBeforeTime); + if (error) + return "requestedNotBeforeTime." + error; + } + return null; + }; + + /** + * Creates a Certificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.Certificate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.Certificate} Certificate + */ + Certificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.Certificate) + return object; + var message = new $root.google.cloud.security.privateca.v1.Certificate(); + if (object.name != null) + message.name = String(object.name); + if (object.pemCsr != null) + message.pemCsr = String(object.pemCsr); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.security.privateca.v1.Certificate.config: object expected"); + message.config = $root.google.cloud.security.privateca.v1.CertificateConfig.fromObject(object.config); + } + if (object.issuerCertificateAuthority != null) + message.issuerCertificateAuthority = String(object.issuerCertificateAuthority); + if (object.lifetime != null) { + if (typeof object.lifetime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.Certificate.lifetime: object expected"); + message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); + } + if (object.certificateTemplate != null) + message.certificateTemplate = String(object.certificateTemplate); + switch (object.subjectMode) { + default: + if (typeof object.subjectMode === "number") { + message.subjectMode = object.subjectMode; + break; + } + break; + case "SUBJECT_REQUEST_MODE_UNSPECIFIED": + case 0: + message.subjectMode = 0; + break; + case "DEFAULT": + case 1: + message.subjectMode = 1; + break; + case "RDN_SEQUENCE": + case 3: + message.subjectMode = 3; + break; + case "REFLECTED_SPIFFE": + case 2: + message.subjectMode = 2; + break; + } + if (object.revocationDetails != null) { + if (typeof object.revocationDetails !== "object") + throw TypeError(".google.cloud.security.privateca.v1.Certificate.revocationDetails: object expected"); + message.revocationDetails = $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails.fromObject(object.revocationDetails); + } + if (object.pemCertificate != null) + message.pemCertificate = String(object.pemCertificate); + if (object.certificateDescription != null) { + if (typeof object.certificateDescription !== "object") + throw TypeError(".google.cloud.security.privateca.v1.Certificate.certificateDescription: object expected"); + message.certificateDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.fromObject(object.certificateDescription); + } + if (object.pemCertificateChain) { + if (!Array.isArray(object.pemCertificateChain)) + throw TypeError(".google.cloud.security.privateca.v1.Certificate.pemCertificateChain: array expected"); + message.pemCertificateChain = []; + for (var i = 0; i < object.pemCertificateChain.length; ++i) + message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.Certificate.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.Certificate.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.security.privateca.v1.Certificate.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.requestedNotBeforeTime != null) { + if (typeof object.requestedNotBeforeTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.Certificate.requestedNotBeforeTime: object expected"); + message.requestedNotBeforeTime = $root.google.protobuf.Timestamp.fromObject(object.requestedNotBeforeTime); + } + return message; + }; + + /** + * Creates a plain object from a Certificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.Certificate + * @static + * @param {google.cloud.security.privateca.v1.Certificate} message Certificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Certificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pemCertificateChain = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.issuerCertificateAuthority = ""; + object.lifetime = null; + object.certificateTemplate = ""; + object.subjectMode = options.enums === String ? "SUBJECT_REQUEST_MODE_UNSPECIFIED" : 0; + object.revocationDetails = null; + object.pemCertificate = ""; + object.certificateDescription = null; + object.createTime = null; + object.updateTime = null; + object.requestedNotBeforeTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) { + object.pemCsr = message.pemCsr; + if (options.oneofs) + object.certificateConfig = "pemCsr"; + } + if (message.config != null && message.hasOwnProperty("config")) { + object.config = $root.google.cloud.security.privateca.v1.CertificateConfig.toObject(message.config, options); + if (options.oneofs) + object.certificateConfig = "config"; + } + if (message.issuerCertificateAuthority != null && message.hasOwnProperty("issuerCertificateAuthority")) + object.issuerCertificateAuthority = message.issuerCertificateAuthority; + if (message.lifetime != null && message.hasOwnProperty("lifetime")) + object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); + if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) + object.certificateTemplate = message.certificateTemplate; + if (message.subjectMode != null && message.hasOwnProperty("subjectMode")) + object.subjectMode = options.enums === String ? $root.google.cloud.security.privateca.v1.SubjectRequestMode[message.subjectMode] === undefined ? message.subjectMode : $root.google.cloud.security.privateca.v1.SubjectRequestMode[message.subjectMode] : message.subjectMode; + if (message.revocationDetails != null && message.hasOwnProperty("revocationDetails")) + object.revocationDetails = $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails.toObject(message.revocationDetails, options); + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + object.pemCertificate = message.pemCertificate; + if (message.certificateDescription != null && message.hasOwnProperty("certificateDescription")) + object.certificateDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.toObject(message.certificateDescription, options); + if (message.pemCertificateChain && message.pemCertificateChain.length) { + object.pemCertificateChain = []; + for (var j = 0; j < message.pemCertificateChain.length; ++j) + object.pemCertificateChain[j] = message.pemCertificateChain[j]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.requestedNotBeforeTime != null && message.hasOwnProperty("requestedNotBeforeTime")) + object.requestedNotBeforeTime = $root.google.protobuf.Timestamp.toObject(message.requestedNotBeforeTime, options); + return object; + }; + + /** + * Converts this Certificate to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + * @returns {Object.} JSON object + */ + Certificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Certificate + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.Certificate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Certificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.Certificate"; + }; + + Certificate.RevocationDetails = (function() { + + /** + * Properties of a RevocationDetails. + * @memberof google.cloud.security.privateca.v1.Certificate + * @interface IRevocationDetails + * @property {google.cloud.security.privateca.v1.RevocationReason|null} [revocationState] RevocationDetails revocationState + * @property {google.protobuf.ITimestamp|null} [revocationTime] RevocationDetails revocationTime + */ + + /** + * Constructs a new RevocationDetails. + * @memberof google.cloud.security.privateca.v1.Certificate + * @classdesc Represents a RevocationDetails. + * @implements IRevocationDetails + * @constructor + * @param {google.cloud.security.privateca.v1.Certificate.IRevocationDetails=} [properties] Properties to set + */ + function RevocationDetails(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]]; + } + + /** + * RevocationDetails revocationState. + * @member {google.cloud.security.privateca.v1.RevocationReason} revocationState + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @instance + */ + RevocationDetails.prototype.revocationState = 0; + + /** + * RevocationDetails revocationTime. + * @member {google.protobuf.ITimestamp|null|undefined} revocationTime + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @instance + */ + RevocationDetails.prototype.revocationTime = null; + + /** + * Creates a new RevocationDetails instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @static + * @param {google.cloud.security.privateca.v1.Certificate.IRevocationDetails=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.Certificate.RevocationDetails} RevocationDetails instance + */ + RevocationDetails.create = function create(properties) { + return new RevocationDetails(properties); + }; + + /** + * Encodes the specified RevocationDetails message. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.RevocationDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @static + * @param {google.cloud.security.privateca.v1.Certificate.IRevocationDetails} message RevocationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevocationDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revocationState != null && Object.hasOwnProperty.call(message, "revocationState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revocationState); + if (message.revocationTime != null && Object.hasOwnProperty.call(message, "revocationTime")) + $root.google.protobuf.Timestamp.encode(message.revocationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RevocationDetails message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.RevocationDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @static + * @param {google.cloud.security.privateca.v1.Certificate.IRevocationDetails} message RevocationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevocationDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RevocationDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.Certificate.RevocationDetails} RevocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevocationDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.revocationState = reader.int32(); + break; + } + case 2: { + message.revocationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RevocationDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.Certificate.RevocationDetails} RevocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevocationDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RevocationDetails message. + * @function verify + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RevocationDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revocationState != null && message.hasOwnProperty("revocationState")) + switch (message.revocationState) { + default: + return "revocationState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.revocationTime != null && message.hasOwnProperty("revocationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revocationTime); + if (error) + return "revocationTime." + error; + } + return null; + }; + + /** + * Creates a RevocationDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.Certificate.RevocationDetails} RevocationDetails + */ + RevocationDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails) + return object; + var message = new $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails(); + switch (object.revocationState) { + default: + if (typeof object.revocationState === "number") { + message.revocationState = object.revocationState; + break; + } + break; + case "REVOCATION_REASON_UNSPECIFIED": + case 0: + message.revocationState = 0; + break; + case "KEY_COMPROMISE": + case 1: + message.revocationState = 1; + break; + case "CERTIFICATE_AUTHORITY_COMPROMISE": + case 2: + message.revocationState = 2; + break; + case "AFFILIATION_CHANGED": + case 3: + message.revocationState = 3; + break; + case "SUPERSEDED": + case 4: + message.revocationState = 4; + break; + case "CESSATION_OF_OPERATION": + case 5: + message.revocationState = 5; + break; + case "CERTIFICATE_HOLD": + case 6: + message.revocationState = 6; + break; + case "PRIVILEGE_WITHDRAWN": + case 7: + message.revocationState = 7; + break; + case "ATTRIBUTE_AUTHORITY_COMPROMISE": + case 8: + message.revocationState = 8; + break; + } + if (object.revocationTime != null) { + if (typeof object.revocationTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.Certificate.RevocationDetails.revocationTime: object expected"); + message.revocationTime = $root.google.protobuf.Timestamp.fromObject(object.revocationTime); + } + return message; + }; + + /** + * Creates a plain object from a RevocationDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @static + * @param {google.cloud.security.privateca.v1.Certificate.RevocationDetails} message RevocationDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RevocationDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.revocationState = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; + object.revocationTime = null; + } + if (message.revocationState != null && message.hasOwnProperty("revocationState")) + object.revocationState = options.enums === String ? $root.google.cloud.security.privateca.v1.RevocationReason[message.revocationState] === undefined ? message.revocationState : $root.google.cloud.security.privateca.v1.RevocationReason[message.revocationState] : message.revocationState; + if (message.revocationTime != null && message.hasOwnProperty("revocationTime")) + object.revocationTime = $root.google.protobuf.Timestamp.toObject(message.revocationTime, options); + return object; + }; + + /** + * Converts this RevocationDetails to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @instance + * @returns {Object.} JSON object + */ + RevocationDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RevocationDetails + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RevocationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.Certificate.RevocationDetails"; + }; + + return RevocationDetails; + })(); + + return Certificate; + })(); + + v1.CertificateTemplate = (function() { + + /** + * Properties of a CertificateTemplate. + * @memberof google.cloud.security.privateca.v1 + * @interface ICertificateTemplate + * @property {string|null} [name] CertificateTemplate name + * @property {google.protobuf.IDuration|null} [maximumLifetime] CertificateTemplate maximumLifetime + * @property {google.cloud.security.privateca.v1.IX509Parameters|null} [predefinedValues] CertificateTemplate predefinedValues + * @property {google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null} [identityConstraints] CertificateTemplate identityConstraints + * @property {google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null} [passthroughExtensions] CertificateTemplate passthroughExtensions + * @property {string|null} [description] CertificateTemplate description + * @property {google.protobuf.ITimestamp|null} [createTime] CertificateTemplate createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateTemplate updateTime + * @property {Object.|null} [labels] CertificateTemplate labels + */ + + /** + * Constructs a new CertificateTemplate. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CertificateTemplate. + * @implements ICertificateTemplate + * @constructor + * @param {google.cloud.security.privateca.v1.ICertificateTemplate=} [properties] Properties to set + */ + function CertificateTemplate(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]]; + } + + /** + * CertificateTemplate name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @instance + */ + CertificateTemplate.prototype.name = ""; + + /** + * CertificateTemplate maximumLifetime. + * @member {google.protobuf.IDuration|null|undefined} maximumLifetime + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @instance + */ + CertificateTemplate.prototype.maximumLifetime = null; + + /** + * CertificateTemplate predefinedValues. + * @member {google.cloud.security.privateca.v1.IX509Parameters|null|undefined} predefinedValues + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @instance + */ + CertificateTemplate.prototype.predefinedValues = null; + + /** + * CertificateTemplate identityConstraints. + * @member {google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null|undefined} identityConstraints + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @instance + */ + CertificateTemplate.prototype.identityConstraints = null; + + /** + * CertificateTemplate passthroughExtensions. + * @member {google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null|undefined} passthroughExtensions + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @instance + */ + CertificateTemplate.prototype.passthroughExtensions = null; + + /** + * CertificateTemplate description. + * @member {string} description + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @instance + */ + CertificateTemplate.prototype.description = ""; + + /** + * CertificateTemplate createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @instance + */ + CertificateTemplate.prototype.createTime = null; + + /** + * CertificateTemplate updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @instance + */ + CertificateTemplate.prototype.updateTime = null; + + /** + * CertificateTemplate labels. + * @member {Object.} labels + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @instance + */ + CertificateTemplate.prototype.labels = $util.emptyObject; + + /** + * Creates a new CertificateTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @static + * @param {google.cloud.security.privateca.v1.ICertificateTemplate=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateTemplate} CertificateTemplate instance + */ + CertificateTemplate.create = function create(properties) { + return new CertificateTemplate(properties); + }; + + /** + * Encodes the specified CertificateTemplate message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @static + * @param {google.cloud.security.privateca.v1.ICertificateTemplate} message CertificateTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.predefinedValues != null && Object.hasOwnProperty.call(message, "predefinedValues")) + $root.google.cloud.security.privateca.v1.X509Parameters.encode(message.predefinedValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identityConstraints != null && Object.hasOwnProperty.call(message, "identityConstraints")) + $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.encode(message.identityConstraints, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.passthroughExtensions != null && Object.hasOwnProperty.call(message, "passthroughExtensions")) + $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.encode(message.passthroughExtensions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.maximumLifetime != null && Object.hasOwnProperty.call(message, "maximumLifetime")) + $root.google.protobuf.Duration.encode(message.maximumLifetime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CertificateTemplate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @static + * @param {google.cloud.security.privateca.v1.ICertificateTemplate} message CertificateTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateTemplate} CertificateTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateTemplate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateTemplate(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 9: { + message.maximumLifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.predefinedValues = $root.google.cloud.security.privateca.v1.X509Parameters.decode(reader, reader.uint32()); + break; + } + case 3: { + message.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.decode(reader, reader.uint32()); + break; + } + case 4: { + message.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.decode(reader, reader.uint32()); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateTemplate} CertificateTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateTemplate message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateTemplate.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.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) { + var error = $root.google.protobuf.Duration.verify(message.maximumLifetime); + if (error) + return "maximumLifetime." + error; + } + if (message.predefinedValues != null && message.hasOwnProperty("predefinedValues")) { + var error = $root.google.cloud.security.privateca.v1.X509Parameters.verify(message.predefinedValues); + if (error) + return "predefinedValues." + error; + } + if (message.identityConstraints != null && message.hasOwnProperty("identityConstraints")) { + var error = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify(message.identityConstraints); + if (error) + return "identityConstraints." + error; + } + if (message.passthroughExtensions != null && message.hasOwnProperty("passthroughExtensions")) { + var error = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify(message.passthroughExtensions); + if (error) + return "passthroughExtensions." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.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 CertificateTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateTemplate} CertificateTemplate + */ + CertificateTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateTemplate) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateTemplate(); + if (object.name != null) + message.name = String(object.name); + if (object.maximumLifetime != null) { + if (typeof object.maximumLifetime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.maximumLifetime: object expected"); + message.maximumLifetime = $root.google.protobuf.Duration.fromObject(object.maximumLifetime); + } + if (object.predefinedValues != null) { + if (typeof object.predefinedValues !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.predefinedValues: object expected"); + message.predefinedValues = $root.google.cloud.security.privateca.v1.X509Parameters.fromObject(object.predefinedValues); + } + if (object.identityConstraints != null) { + if (typeof object.identityConstraints !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.identityConstraints: object expected"); + message.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.fromObject(object.identityConstraints); + } + if (object.passthroughExtensions != null) { + if (typeof object.passthroughExtensions !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.passthroughExtensions: object expected"); + message.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.fromObject(object.passthroughExtensions); + } + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.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 CertificateTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @static + * @param {google.cloud.security.privateca.v1.CertificateTemplate} message CertificateTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.predefinedValues = null; + object.identityConstraints = null; + object.passthroughExtensions = null; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.maximumLifetime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.predefinedValues != null && message.hasOwnProperty("predefinedValues")) + object.predefinedValues = $root.google.cloud.security.privateca.v1.X509Parameters.toObject(message.predefinedValues, options); + if (message.identityConstraints != null && message.hasOwnProperty("identityConstraints")) + object.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.toObject(message.identityConstraints, options); + if (message.passthroughExtensions != null && message.hasOwnProperty("passthroughExtensions")) + object.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.toObject(message.passthroughExtensions, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) + object.maximumLifetime = $root.google.protobuf.Duration.toObject(message.maximumLifetime, options); + return object; + }; + + /** + * Converts this CertificateTemplate to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @instance + * @returns {Object.} JSON object + */ + CertificateTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateTemplate + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateTemplate"; + }; + + return CertificateTemplate; + })(); + + v1.X509Parameters = (function() { + + /** + * Properties of a X509Parameters. + * @memberof google.cloud.security.privateca.v1 + * @interface IX509Parameters + * @property {google.cloud.security.privateca.v1.IKeyUsage|null} [keyUsage] X509Parameters keyUsage + * @property {google.cloud.security.privateca.v1.X509Parameters.ICaOptions|null} [caOptions] X509Parameters caOptions + * @property {Array.|null} [policyIds] X509Parameters policyIds + * @property {Array.|null} [aiaOcspServers] X509Parameters aiaOcspServers + * @property {google.cloud.security.privateca.v1.X509Parameters.INameConstraints|null} [nameConstraints] X509Parameters nameConstraints + * @property {Array.|null} [additionalExtensions] X509Parameters additionalExtensions + */ + + /** + * Constructs a new X509Parameters. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a X509Parameters. + * @implements IX509Parameters + * @constructor + * @param {google.cloud.security.privateca.v1.IX509Parameters=} [properties] Properties to set + */ + function X509Parameters(properties) { + this.policyIds = []; + this.aiaOcspServers = []; + this.additionalExtensions = []; + 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]]; + } + + /** + * X509Parameters keyUsage. + * @member {google.cloud.security.privateca.v1.IKeyUsage|null|undefined} keyUsage + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @instance + */ + X509Parameters.prototype.keyUsage = null; + + /** + * X509Parameters caOptions. + * @member {google.cloud.security.privateca.v1.X509Parameters.ICaOptions|null|undefined} caOptions + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @instance + */ + X509Parameters.prototype.caOptions = null; + + /** + * X509Parameters policyIds. + * @member {Array.} policyIds + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @instance + */ + X509Parameters.prototype.policyIds = $util.emptyArray; + + /** + * X509Parameters aiaOcspServers. + * @member {Array.} aiaOcspServers + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @instance + */ + X509Parameters.prototype.aiaOcspServers = $util.emptyArray; + + /** + * X509Parameters nameConstraints. + * @member {google.cloud.security.privateca.v1.X509Parameters.INameConstraints|null|undefined} nameConstraints + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @instance + */ + X509Parameters.prototype.nameConstraints = null; + + /** + * X509Parameters additionalExtensions. + * @member {Array.} additionalExtensions + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @instance + */ + X509Parameters.prototype.additionalExtensions = $util.emptyArray; + + /** + * Creates a new X509Parameters instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @static + * @param {google.cloud.security.privateca.v1.IX509Parameters=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.X509Parameters} X509Parameters instance + */ + X509Parameters.create = function create(properties) { + return new X509Parameters(properties); + }; + + /** + * Encodes the specified X509Parameters message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @static + * @param {google.cloud.security.privateca.v1.IX509Parameters} message X509Parameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + X509Parameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyUsage != null && Object.hasOwnProperty.call(message, "keyUsage")) + $root.google.cloud.security.privateca.v1.KeyUsage.encode(message.keyUsage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.caOptions != null && Object.hasOwnProperty.call(message, "caOptions")) + $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions.encode(message.caOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.policyIds != null && message.policyIds.length) + for (var i = 0; i < message.policyIds.length; ++i) + $root.google.cloud.security.privateca.v1.ObjectId.encode(message.policyIds[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.aiaOcspServers != null && message.aiaOcspServers.length) + for (var i = 0; i < message.aiaOcspServers.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.aiaOcspServers[i]); + if (message.additionalExtensions != null && message.additionalExtensions.length) + for (var i = 0; i < message.additionalExtensions.length; ++i) + $root.google.cloud.security.privateca.v1.X509Extension.encode(message.additionalExtensions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.nameConstraints != null && Object.hasOwnProperty.call(message, "nameConstraints")) + $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints.encode(message.nameConstraints, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified X509Parameters message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @static + * @param {google.cloud.security.privateca.v1.IX509Parameters} message X509Parameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + X509Parameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a X509Parameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.X509Parameters} X509Parameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + X509Parameters.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.X509Parameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.decode(reader, reader.uint32()); + break; + } + case 2: { + message.caOptions = $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.policyIds && message.policyIds.length)) + message.policyIds = []; + message.policyIds.push($root.google.cloud.security.privateca.v1.ObjectId.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.aiaOcspServers && message.aiaOcspServers.length)) + message.aiaOcspServers = []; + message.aiaOcspServers.push(reader.string()); + break; + } + case 6: { + message.nameConstraints = $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.additionalExtensions && message.additionalExtensions.length)) + message.additionalExtensions = []; + message.additionalExtensions.push($root.google.cloud.security.privateca.v1.X509Extension.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a X509Parameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.X509Parameters} X509Parameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + X509Parameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a X509Parameters message. + * @function verify + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + X509Parameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyUsage != null && message.hasOwnProperty("keyUsage")) { + var error = $root.google.cloud.security.privateca.v1.KeyUsage.verify(message.keyUsage); + if (error) + return "keyUsage." + error; + } + if (message.caOptions != null && message.hasOwnProperty("caOptions")) { + var error = $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions.verify(message.caOptions); + if (error) + return "caOptions." + error; + } + if (message.policyIds != null && message.hasOwnProperty("policyIds")) { + if (!Array.isArray(message.policyIds)) + return "policyIds: array expected"; + for (var i = 0; i < message.policyIds.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.ObjectId.verify(message.policyIds[i]); + if (error) + return "policyIds." + error; + } + } + if (message.aiaOcspServers != null && message.hasOwnProperty("aiaOcspServers")) { + if (!Array.isArray(message.aiaOcspServers)) + return "aiaOcspServers: array expected"; + for (var i = 0; i < message.aiaOcspServers.length; ++i) + if (!$util.isString(message.aiaOcspServers[i])) + return "aiaOcspServers: string[] expected"; + } + if (message.nameConstraints != null && message.hasOwnProperty("nameConstraints")) { + var error = $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints.verify(message.nameConstraints); + if (error) + return "nameConstraints." + error; + } + if (message.additionalExtensions != null && message.hasOwnProperty("additionalExtensions")) { + if (!Array.isArray(message.additionalExtensions)) + return "additionalExtensions: array expected"; + for (var i = 0; i < message.additionalExtensions.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.X509Extension.verify(message.additionalExtensions[i]); + if (error) + return "additionalExtensions." + error; + } + } + return null; + }; + + /** + * Creates a X509Parameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.X509Parameters} X509Parameters + */ + X509Parameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.X509Parameters) + return object; + var message = new $root.google.cloud.security.privateca.v1.X509Parameters(); + if (object.keyUsage != null) { + if (typeof object.keyUsage !== "object") + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.keyUsage: object expected"); + message.keyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.fromObject(object.keyUsage); + } + if (object.caOptions != null) { + if (typeof object.caOptions !== "object") + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.caOptions: object expected"); + message.caOptions = $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions.fromObject(object.caOptions); + } + if (object.policyIds) { + if (!Array.isArray(object.policyIds)) + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.policyIds: array expected"); + message.policyIds = []; + for (var i = 0; i < object.policyIds.length; ++i) { + if (typeof object.policyIds[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.policyIds: object expected"); + message.policyIds[i] = $root.google.cloud.security.privateca.v1.ObjectId.fromObject(object.policyIds[i]); + } + } + if (object.aiaOcspServers) { + if (!Array.isArray(object.aiaOcspServers)) + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.aiaOcspServers: array expected"); + message.aiaOcspServers = []; + for (var i = 0; i < object.aiaOcspServers.length; ++i) + message.aiaOcspServers[i] = String(object.aiaOcspServers[i]); + } + if (object.nameConstraints != null) { + if (typeof object.nameConstraints !== "object") + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.nameConstraints: object expected"); + message.nameConstraints = $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints.fromObject(object.nameConstraints); + } + if (object.additionalExtensions) { + if (!Array.isArray(object.additionalExtensions)) + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.additionalExtensions: array expected"); + message.additionalExtensions = []; + for (var i = 0; i < object.additionalExtensions.length; ++i) { + if (typeof object.additionalExtensions[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.additionalExtensions: object expected"); + message.additionalExtensions[i] = $root.google.cloud.security.privateca.v1.X509Extension.fromObject(object.additionalExtensions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a X509Parameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @static + * @param {google.cloud.security.privateca.v1.X509Parameters} message X509Parameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + X509Parameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.policyIds = []; + object.aiaOcspServers = []; + object.additionalExtensions = []; + } + if (options.defaults) { + object.keyUsage = null; + object.caOptions = null; + object.nameConstraints = null; + } + if (message.keyUsage != null && message.hasOwnProperty("keyUsage")) + object.keyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.toObject(message.keyUsage, options); + if (message.caOptions != null && message.hasOwnProperty("caOptions")) + object.caOptions = $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions.toObject(message.caOptions, options); + if (message.policyIds && message.policyIds.length) { + object.policyIds = []; + for (var j = 0; j < message.policyIds.length; ++j) + object.policyIds[j] = $root.google.cloud.security.privateca.v1.ObjectId.toObject(message.policyIds[j], options); + } + if (message.aiaOcspServers && message.aiaOcspServers.length) { + object.aiaOcspServers = []; + for (var j = 0; j < message.aiaOcspServers.length; ++j) + object.aiaOcspServers[j] = message.aiaOcspServers[j]; + } + if (message.additionalExtensions && message.additionalExtensions.length) { + object.additionalExtensions = []; + for (var j = 0; j < message.additionalExtensions.length; ++j) + object.additionalExtensions[j] = $root.google.cloud.security.privateca.v1.X509Extension.toObject(message.additionalExtensions[j], options); + } + if (message.nameConstraints != null && message.hasOwnProperty("nameConstraints")) + object.nameConstraints = $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints.toObject(message.nameConstraints, options); + return object; + }; + + /** + * Converts this X509Parameters to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @instance + * @returns {Object.} JSON object + */ + X509Parameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for X509Parameters + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + X509Parameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.X509Parameters"; + }; + + X509Parameters.CaOptions = (function() { + + /** + * Properties of a CaOptions. + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @interface ICaOptions + * @property {boolean|null} [isCa] CaOptions isCa + * @property {number|null} [maxIssuerPathLength] CaOptions maxIssuerPathLength + */ + + /** + * Constructs a new CaOptions. + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @classdesc Represents a CaOptions. + * @implements ICaOptions + * @constructor + * @param {google.cloud.security.privateca.v1.X509Parameters.ICaOptions=} [properties] Properties to set + */ + function CaOptions(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]]; + } + + /** + * CaOptions isCa. + * @member {boolean|null|undefined} isCa + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @instance + */ + CaOptions.prototype.isCa = null; + + /** + * CaOptions maxIssuerPathLength. + * @member {number|null|undefined} maxIssuerPathLength + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @instance + */ + CaOptions.prototype.maxIssuerPathLength = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CaOptions.prototype, "_isCa", { + get: $util.oneOfGetter($oneOfFields = ["isCa"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CaOptions.prototype, "_maxIssuerPathLength", { + get: $util.oneOfGetter($oneOfFields = ["maxIssuerPathLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CaOptions instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @static + * @param {google.cloud.security.privateca.v1.X509Parameters.ICaOptions=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.X509Parameters.CaOptions} CaOptions instance + */ + CaOptions.create = function create(properties) { + return new CaOptions(properties); + }; + + /** + * Encodes the specified CaOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.CaOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @static + * @param {google.cloud.security.privateca.v1.X509Parameters.ICaOptions} message CaOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.isCa != null && Object.hasOwnProperty.call(message, "isCa")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isCa); + if (message.maxIssuerPathLength != null && Object.hasOwnProperty.call(message, "maxIssuerPathLength")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxIssuerPathLength); + return writer; + }; + + /** + * Encodes the specified CaOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.CaOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @static + * @param {google.cloud.security.privateca.v1.X509Parameters.ICaOptions} message CaOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.X509Parameters.CaOptions} CaOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.isCa = reader.bool(); + break; + } + case 2: { + message.maxIssuerPathLength = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.X509Parameters.CaOptions} CaOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaOptions message. + * @function verify + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.isCa != null && message.hasOwnProperty("isCa")) { + properties._isCa = 1; + if (typeof message.isCa !== "boolean") + return "isCa: boolean expected"; + } + if (message.maxIssuerPathLength != null && message.hasOwnProperty("maxIssuerPathLength")) { + properties._maxIssuerPathLength = 1; + if (!$util.isInteger(message.maxIssuerPathLength)) + return "maxIssuerPathLength: integer expected"; + } + return null; + }; + + /** + * Creates a CaOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.X509Parameters.CaOptions} CaOptions + */ + CaOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions) + return object; + var message = new $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions(); + if (object.isCa != null) + message.isCa = Boolean(object.isCa); + if (object.maxIssuerPathLength != null) + message.maxIssuerPathLength = object.maxIssuerPathLength | 0; + return message; + }; + + /** + * Creates a plain object from a CaOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @static + * @param {google.cloud.security.privateca.v1.X509Parameters.CaOptions} message CaOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.isCa != null && message.hasOwnProperty("isCa")) { + object.isCa = message.isCa; + if (options.oneofs) + object._isCa = "isCa"; + } + if (message.maxIssuerPathLength != null && message.hasOwnProperty("maxIssuerPathLength")) { + object.maxIssuerPathLength = message.maxIssuerPathLength; + if (options.oneofs) + object._maxIssuerPathLength = "maxIssuerPathLength"; + } + return object; + }; + + /** + * Converts this CaOptions to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @instance + * @returns {Object.} JSON object + */ + CaOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaOptions + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.X509Parameters.CaOptions"; + }; + + return CaOptions; + })(); + + X509Parameters.NameConstraints = (function() { + + /** + * Properties of a NameConstraints. + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @interface INameConstraints + * @property {boolean|null} [critical] NameConstraints critical + * @property {Array.|null} [permittedDnsNames] NameConstraints permittedDnsNames + * @property {Array.|null} [excludedDnsNames] NameConstraints excludedDnsNames + * @property {Array.|null} [permittedIpRanges] NameConstraints permittedIpRanges + * @property {Array.|null} [excludedIpRanges] NameConstraints excludedIpRanges + * @property {Array.|null} [permittedEmailAddresses] NameConstraints permittedEmailAddresses + * @property {Array.|null} [excludedEmailAddresses] NameConstraints excludedEmailAddresses + * @property {Array.|null} [permittedUris] NameConstraints permittedUris + * @property {Array.|null} [excludedUris] NameConstraints excludedUris + */ + + /** + * Constructs a new NameConstraints. + * @memberof google.cloud.security.privateca.v1.X509Parameters + * @classdesc Represents a NameConstraints. + * @implements INameConstraints + * @constructor + * @param {google.cloud.security.privateca.v1.X509Parameters.INameConstraints=} [properties] Properties to set + */ + function NameConstraints(properties) { + this.permittedDnsNames = []; + this.excludedDnsNames = []; + this.permittedIpRanges = []; + this.excludedIpRanges = []; + this.permittedEmailAddresses = []; + this.excludedEmailAddresses = []; + this.permittedUris = []; + this.excludedUris = []; + 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]]; + } + + /** + * NameConstraints critical. + * @member {boolean} critical + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @instance + */ + NameConstraints.prototype.critical = false; + + /** + * NameConstraints permittedDnsNames. + * @member {Array.} permittedDnsNames + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @instance + */ + NameConstraints.prototype.permittedDnsNames = $util.emptyArray; + + /** + * NameConstraints excludedDnsNames. + * @member {Array.} excludedDnsNames + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @instance + */ + NameConstraints.prototype.excludedDnsNames = $util.emptyArray; + + /** + * NameConstraints permittedIpRanges. + * @member {Array.} permittedIpRanges + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @instance + */ + NameConstraints.prototype.permittedIpRanges = $util.emptyArray; + + /** + * NameConstraints excludedIpRanges. + * @member {Array.} excludedIpRanges + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @instance + */ + NameConstraints.prototype.excludedIpRanges = $util.emptyArray; + + /** + * NameConstraints permittedEmailAddresses. + * @member {Array.} permittedEmailAddresses + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @instance + */ + NameConstraints.prototype.permittedEmailAddresses = $util.emptyArray; + + /** + * NameConstraints excludedEmailAddresses. + * @member {Array.} excludedEmailAddresses + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @instance + */ + NameConstraints.prototype.excludedEmailAddresses = $util.emptyArray; + + /** + * NameConstraints permittedUris. + * @member {Array.} permittedUris + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @instance + */ + NameConstraints.prototype.permittedUris = $util.emptyArray; + + /** + * NameConstraints excludedUris. + * @member {Array.} excludedUris + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @instance + */ + NameConstraints.prototype.excludedUris = $util.emptyArray; + + /** + * Creates a new NameConstraints instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @static + * @param {google.cloud.security.privateca.v1.X509Parameters.INameConstraints=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.X509Parameters.NameConstraints} NameConstraints instance + */ + NameConstraints.create = function create(properties) { + return new NameConstraints(properties); + }; + + /** + * Encodes the specified NameConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.NameConstraints.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @static + * @param {google.cloud.security.privateca.v1.X509Parameters.INameConstraints} message NameConstraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NameConstraints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.critical != null && Object.hasOwnProperty.call(message, "critical")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.critical); + if (message.permittedDnsNames != null && message.permittedDnsNames.length) + for (var i = 0; i < message.permittedDnsNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permittedDnsNames[i]); + if (message.excludedDnsNames != null && message.excludedDnsNames.length) + for (var i = 0; i < message.excludedDnsNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludedDnsNames[i]); + if (message.permittedIpRanges != null && message.permittedIpRanges.length) + for (var i = 0; i < message.permittedIpRanges.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.permittedIpRanges[i]); + if (message.excludedIpRanges != null && message.excludedIpRanges.length) + for (var i = 0; i < message.excludedIpRanges.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.excludedIpRanges[i]); + if (message.permittedEmailAddresses != null && message.permittedEmailAddresses.length) + for (var i = 0; i < message.permittedEmailAddresses.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.permittedEmailAddresses[i]); + if (message.excludedEmailAddresses != null && message.excludedEmailAddresses.length) + for (var i = 0; i < message.excludedEmailAddresses.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.excludedEmailAddresses[i]); + if (message.permittedUris != null && message.permittedUris.length) + for (var i = 0; i < message.permittedUris.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.permittedUris[i]); + if (message.excludedUris != null && message.excludedUris.length) + for (var i = 0; i < message.excludedUris.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.excludedUris[i]); + return writer; + }; + + /** + * Encodes the specified NameConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.NameConstraints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @static + * @param {google.cloud.security.privateca.v1.X509Parameters.INameConstraints} message NameConstraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NameConstraints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NameConstraints message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.X509Parameters.NameConstraints} NameConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NameConstraints.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.critical = reader.bool(); + break; + } + case 2: { + if (!(message.permittedDnsNames && message.permittedDnsNames.length)) + message.permittedDnsNames = []; + message.permittedDnsNames.push(reader.string()); + break; + } + case 3: { + if (!(message.excludedDnsNames && message.excludedDnsNames.length)) + message.excludedDnsNames = []; + message.excludedDnsNames.push(reader.string()); + break; + } + case 4: { + if (!(message.permittedIpRanges && message.permittedIpRanges.length)) + message.permittedIpRanges = []; + message.permittedIpRanges.push(reader.string()); + break; + } + case 5: { + if (!(message.excludedIpRanges && message.excludedIpRanges.length)) + message.excludedIpRanges = []; + message.excludedIpRanges.push(reader.string()); + break; + } + case 6: { + if (!(message.permittedEmailAddresses && message.permittedEmailAddresses.length)) + message.permittedEmailAddresses = []; + message.permittedEmailAddresses.push(reader.string()); + break; + } + case 7: { + if (!(message.excludedEmailAddresses && message.excludedEmailAddresses.length)) + message.excludedEmailAddresses = []; + message.excludedEmailAddresses.push(reader.string()); + break; + } + case 8: { + if (!(message.permittedUris && message.permittedUris.length)) + message.permittedUris = []; + message.permittedUris.push(reader.string()); + break; + } + case 9: { + if (!(message.excludedUris && message.excludedUris.length)) + message.excludedUris = []; + message.excludedUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NameConstraints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.X509Parameters.NameConstraints} NameConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NameConstraints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NameConstraints message. + * @function verify + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NameConstraints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.critical != null && message.hasOwnProperty("critical")) + if (typeof message.critical !== "boolean") + return "critical: boolean expected"; + if (message.permittedDnsNames != null && message.hasOwnProperty("permittedDnsNames")) { + if (!Array.isArray(message.permittedDnsNames)) + return "permittedDnsNames: array expected"; + for (var i = 0; i < message.permittedDnsNames.length; ++i) + if (!$util.isString(message.permittedDnsNames[i])) + return "permittedDnsNames: string[] expected"; + } + if (message.excludedDnsNames != null && message.hasOwnProperty("excludedDnsNames")) { + if (!Array.isArray(message.excludedDnsNames)) + return "excludedDnsNames: array expected"; + for (var i = 0; i < message.excludedDnsNames.length; ++i) + if (!$util.isString(message.excludedDnsNames[i])) + return "excludedDnsNames: string[] expected"; + } + if (message.permittedIpRanges != null && message.hasOwnProperty("permittedIpRanges")) { + if (!Array.isArray(message.permittedIpRanges)) + return "permittedIpRanges: array expected"; + for (var i = 0; i < message.permittedIpRanges.length; ++i) + if (!$util.isString(message.permittedIpRanges[i])) + return "permittedIpRanges: string[] expected"; + } + if (message.excludedIpRanges != null && message.hasOwnProperty("excludedIpRanges")) { + if (!Array.isArray(message.excludedIpRanges)) + return "excludedIpRanges: array expected"; + for (var i = 0; i < message.excludedIpRanges.length; ++i) + if (!$util.isString(message.excludedIpRanges[i])) + return "excludedIpRanges: string[] expected"; + } + if (message.permittedEmailAddresses != null && message.hasOwnProperty("permittedEmailAddresses")) { + if (!Array.isArray(message.permittedEmailAddresses)) + return "permittedEmailAddresses: array expected"; + for (var i = 0; i < message.permittedEmailAddresses.length; ++i) + if (!$util.isString(message.permittedEmailAddresses[i])) + return "permittedEmailAddresses: string[] expected"; + } + if (message.excludedEmailAddresses != null && message.hasOwnProperty("excludedEmailAddresses")) { + if (!Array.isArray(message.excludedEmailAddresses)) + return "excludedEmailAddresses: array expected"; + for (var i = 0; i < message.excludedEmailAddresses.length; ++i) + if (!$util.isString(message.excludedEmailAddresses[i])) + return "excludedEmailAddresses: string[] expected"; + } + if (message.permittedUris != null && message.hasOwnProperty("permittedUris")) { + if (!Array.isArray(message.permittedUris)) + return "permittedUris: array expected"; + for (var i = 0; i < message.permittedUris.length; ++i) + if (!$util.isString(message.permittedUris[i])) + return "permittedUris: string[] expected"; + } + if (message.excludedUris != null && message.hasOwnProperty("excludedUris")) { + if (!Array.isArray(message.excludedUris)) + return "excludedUris: array expected"; + for (var i = 0; i < message.excludedUris.length; ++i) + if (!$util.isString(message.excludedUris[i])) + return "excludedUris: string[] expected"; + } + return null; + }; + + /** + * Creates a NameConstraints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.X509Parameters.NameConstraints} NameConstraints + */ + NameConstraints.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints) + return object; + var message = new $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints(); + if (object.critical != null) + message.critical = Boolean(object.critical); + if (object.permittedDnsNames) { + if (!Array.isArray(object.permittedDnsNames)) + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.permittedDnsNames: array expected"); + message.permittedDnsNames = []; + for (var i = 0; i < object.permittedDnsNames.length; ++i) + message.permittedDnsNames[i] = String(object.permittedDnsNames[i]); + } + if (object.excludedDnsNames) { + if (!Array.isArray(object.excludedDnsNames)) + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.excludedDnsNames: array expected"); + message.excludedDnsNames = []; + for (var i = 0; i < object.excludedDnsNames.length; ++i) + message.excludedDnsNames[i] = String(object.excludedDnsNames[i]); + } + if (object.permittedIpRanges) { + if (!Array.isArray(object.permittedIpRanges)) + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.permittedIpRanges: array expected"); + message.permittedIpRanges = []; + for (var i = 0; i < object.permittedIpRanges.length; ++i) + message.permittedIpRanges[i] = String(object.permittedIpRanges[i]); + } + if (object.excludedIpRanges) { + if (!Array.isArray(object.excludedIpRanges)) + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.excludedIpRanges: array expected"); + message.excludedIpRanges = []; + for (var i = 0; i < object.excludedIpRanges.length; ++i) + message.excludedIpRanges[i] = String(object.excludedIpRanges[i]); + } + if (object.permittedEmailAddresses) { + if (!Array.isArray(object.permittedEmailAddresses)) + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.permittedEmailAddresses: array expected"); + message.permittedEmailAddresses = []; + for (var i = 0; i < object.permittedEmailAddresses.length; ++i) + message.permittedEmailAddresses[i] = String(object.permittedEmailAddresses[i]); + } + if (object.excludedEmailAddresses) { + if (!Array.isArray(object.excludedEmailAddresses)) + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.excludedEmailAddresses: array expected"); + message.excludedEmailAddresses = []; + for (var i = 0; i < object.excludedEmailAddresses.length; ++i) + message.excludedEmailAddresses[i] = String(object.excludedEmailAddresses[i]); + } + if (object.permittedUris) { + if (!Array.isArray(object.permittedUris)) + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.permittedUris: array expected"); + message.permittedUris = []; + for (var i = 0; i < object.permittedUris.length; ++i) + message.permittedUris[i] = String(object.permittedUris[i]); + } + if (object.excludedUris) { + if (!Array.isArray(object.excludedUris)) + throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.excludedUris: array expected"); + message.excludedUris = []; + for (var i = 0; i < object.excludedUris.length; ++i) + message.excludedUris[i] = String(object.excludedUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a NameConstraints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @static + * @param {google.cloud.security.privateca.v1.X509Parameters.NameConstraints} message NameConstraints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NameConstraints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.permittedDnsNames = []; + object.excludedDnsNames = []; + object.permittedIpRanges = []; + object.excludedIpRanges = []; + object.permittedEmailAddresses = []; + object.excludedEmailAddresses = []; + object.permittedUris = []; + object.excludedUris = []; + } + if (options.defaults) + object.critical = false; + if (message.critical != null && message.hasOwnProperty("critical")) + object.critical = message.critical; + if (message.permittedDnsNames && message.permittedDnsNames.length) { + object.permittedDnsNames = []; + for (var j = 0; j < message.permittedDnsNames.length; ++j) + object.permittedDnsNames[j] = message.permittedDnsNames[j]; + } + if (message.excludedDnsNames && message.excludedDnsNames.length) { + object.excludedDnsNames = []; + for (var j = 0; j < message.excludedDnsNames.length; ++j) + object.excludedDnsNames[j] = message.excludedDnsNames[j]; + } + if (message.permittedIpRanges && message.permittedIpRanges.length) { + object.permittedIpRanges = []; + for (var j = 0; j < message.permittedIpRanges.length; ++j) + object.permittedIpRanges[j] = message.permittedIpRanges[j]; + } + if (message.excludedIpRanges && message.excludedIpRanges.length) { + object.excludedIpRanges = []; + for (var j = 0; j < message.excludedIpRanges.length; ++j) + object.excludedIpRanges[j] = message.excludedIpRanges[j]; + } + if (message.permittedEmailAddresses && message.permittedEmailAddresses.length) { + object.permittedEmailAddresses = []; + for (var j = 0; j < message.permittedEmailAddresses.length; ++j) + object.permittedEmailAddresses[j] = message.permittedEmailAddresses[j]; + } + if (message.excludedEmailAddresses && message.excludedEmailAddresses.length) { + object.excludedEmailAddresses = []; + for (var j = 0; j < message.excludedEmailAddresses.length; ++j) + object.excludedEmailAddresses[j] = message.excludedEmailAddresses[j]; + } + if (message.permittedUris && message.permittedUris.length) { + object.permittedUris = []; + for (var j = 0; j < message.permittedUris.length; ++j) + object.permittedUris[j] = message.permittedUris[j]; + } + if (message.excludedUris && message.excludedUris.length) { + object.excludedUris = []; + for (var j = 0; j < message.excludedUris.length; ++j) + object.excludedUris[j] = message.excludedUris[j]; + } + return object; + }; + + /** + * Converts this NameConstraints to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @instance + * @returns {Object.} JSON object + */ + NameConstraints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NameConstraints + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NameConstraints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.X509Parameters.NameConstraints"; + }; + + return NameConstraints; + })(); + + return X509Parameters; + })(); + + v1.SubordinateConfig = (function() { + + /** + * Properties of a SubordinateConfig. + * @memberof google.cloud.security.privateca.v1 + * @interface ISubordinateConfig + * @property {string|null} [certificateAuthority] SubordinateConfig certificateAuthority + * @property {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain|null} [pemIssuerChain] SubordinateConfig pemIssuerChain + */ + + /** + * Constructs a new SubordinateConfig. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a SubordinateConfig. + * @implements ISubordinateConfig + * @constructor + * @param {google.cloud.security.privateca.v1.ISubordinateConfig=} [properties] Properties to set + */ + function SubordinateConfig(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]]; + } + + /** + * SubordinateConfig certificateAuthority. + * @member {string|null|undefined} certificateAuthority + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @instance + */ + SubordinateConfig.prototype.certificateAuthority = null; + + /** + * SubordinateConfig pemIssuerChain. + * @member {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain|null|undefined} pemIssuerChain + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @instance + */ + SubordinateConfig.prototype.pemIssuerChain = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubordinateConfig subordinateConfig. + * @member {"certificateAuthority"|"pemIssuerChain"|undefined} subordinateConfig + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @instance + */ + Object.defineProperty(SubordinateConfig.prototype, "subordinateConfig", { + get: $util.oneOfGetter($oneOfFields = ["certificateAuthority", "pemIssuerChain"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubordinateConfig instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @static + * @param {google.cloud.security.privateca.v1.ISubordinateConfig=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.SubordinateConfig} SubordinateConfig instance + */ + SubordinateConfig.create = function create(properties) { + return new SubordinateConfig(properties); + }; + + /** + * Encodes the specified SubordinateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @static + * @param {google.cloud.security.privateca.v1.ISubordinateConfig} message SubordinateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubordinateConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificateAuthority); + if (message.pemIssuerChain != null && Object.hasOwnProperty.call(message, "pemIssuerChain")) + $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.encode(message.pemIssuerChain, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubordinateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @static + * @param {google.cloud.security.privateca.v1.ISubordinateConfig} message SubordinateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubordinateConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubordinateConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.SubordinateConfig} SubordinateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubordinateConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.SubordinateConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.certificateAuthority = reader.string(); + break; + } + case 2: { + message.pemIssuerChain = $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubordinateConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.SubordinateConfig} SubordinateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubordinateConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubordinateConfig message. + * @function verify + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubordinateConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { + properties.subordinateConfig = 1; + if (!$util.isString(message.certificateAuthority)) + return "certificateAuthority: string expected"; + } + if (message.pemIssuerChain != null && message.hasOwnProperty("pemIssuerChain")) { + if (properties.subordinateConfig === 1) + return "subordinateConfig: multiple values"; + properties.subordinateConfig = 1; + { + var error = $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.verify(message.pemIssuerChain); + if (error) + return "pemIssuerChain." + error; + } + } + return null; + }; + + /** + * Creates a SubordinateConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.SubordinateConfig} SubordinateConfig + */ + SubordinateConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.SubordinateConfig) + return object; + var message = new $root.google.cloud.security.privateca.v1.SubordinateConfig(); + if (object.certificateAuthority != null) + message.certificateAuthority = String(object.certificateAuthority); + if (object.pemIssuerChain != null) { + if (typeof object.pemIssuerChain !== "object") + throw TypeError(".google.cloud.security.privateca.v1.SubordinateConfig.pemIssuerChain: object expected"); + message.pemIssuerChain = $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.fromObject(object.pemIssuerChain); + } + return message; + }; + + /** + * Creates a plain object from a SubordinateConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @static + * @param {google.cloud.security.privateca.v1.SubordinateConfig} message SubordinateConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubordinateConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { + object.certificateAuthority = message.certificateAuthority; + if (options.oneofs) + object.subordinateConfig = "certificateAuthority"; + } + if (message.pemIssuerChain != null && message.hasOwnProperty("pemIssuerChain")) { + object.pemIssuerChain = $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.toObject(message.pemIssuerChain, options); + if (options.oneofs) + object.subordinateConfig = "pemIssuerChain"; + } + return object; + }; + + /** + * Converts this SubordinateConfig to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @instance + * @returns {Object.} JSON object + */ + SubordinateConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubordinateConfig + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubordinateConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.SubordinateConfig"; + }; + + SubordinateConfig.SubordinateConfigChain = (function() { + + /** + * Properties of a SubordinateConfigChain. + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @interface ISubordinateConfigChain + * @property {Array.|null} [pemCertificates] SubordinateConfigChain pemCertificates + */ + + /** + * Constructs a new SubordinateConfigChain. + * @memberof google.cloud.security.privateca.v1.SubordinateConfig + * @classdesc Represents a SubordinateConfigChain. + * @implements ISubordinateConfigChain + * @constructor + * @param {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain=} [properties] Properties to set + */ + function SubordinateConfigChain(properties) { + this.pemCertificates = []; + 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]]; + } + + /** + * SubordinateConfigChain pemCertificates. + * @member {Array.} pemCertificates + * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain + * @instance + */ + SubordinateConfigChain.prototype.pemCertificates = $util.emptyArray; + + /** + * Creates a new SubordinateConfigChain instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain instance + */ + SubordinateConfigChain.create = function create(properties) { + return new SubordinateConfigChain(properties); + }; + + /** + * Encodes the specified SubordinateConfigChain message. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain} message SubordinateConfigChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubordinateConfigChain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pemCertificates != null && message.pemCertificates.length) + for (var i = 0; i < message.pemCertificates.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificates[i]); + return writer; + }; + + /** + * Encodes the specified SubordinateConfigChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain} message SubordinateConfigChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubordinateConfigChain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubordinateConfigChain message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubordinateConfigChain.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.pemCertificates && message.pemCertificates.length)) + message.pemCertificates = []; + message.pemCertificates.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubordinateConfigChain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubordinateConfigChain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubordinateConfigChain message. + * @function verify + * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubordinateConfigChain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pemCertificates != null && message.hasOwnProperty("pemCertificates")) { + if (!Array.isArray(message.pemCertificates)) + return "pemCertificates: array expected"; + for (var i = 0; i < message.pemCertificates.length; ++i) + if (!$util.isString(message.pemCertificates[i])) + return "pemCertificates: string[] expected"; + } + return null; + }; + + /** + * Creates a SubordinateConfigChain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain + */ + SubordinateConfigChain.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain) + return object; + var message = new $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain(); + if (object.pemCertificates) { + if (!Array.isArray(object.pemCertificates)) + throw TypeError(".google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.pemCertificates: array expected"); + message.pemCertificates = []; + for (var i = 0; i < object.pemCertificates.length; ++i) + message.pemCertificates[i] = String(object.pemCertificates[i]); + } + return message; + }; + + /** + * Creates a plain object from a SubordinateConfigChain message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain} message SubordinateConfigChain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubordinateConfigChain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pemCertificates = []; + if (message.pemCertificates && message.pemCertificates.length) { + object.pemCertificates = []; + for (var j = 0; j < message.pemCertificates.length; ++j) + object.pemCertificates[j] = message.pemCertificates[j]; + } + return object; + }; + + /** + * Converts this SubordinateConfigChain to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain + * @instance + * @returns {Object.} JSON object + */ + SubordinateConfigChain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubordinateConfigChain + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubordinateConfigChain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain"; + }; + + return SubordinateConfigChain; + })(); + + return SubordinateConfig; + })(); + + v1.PublicKey = (function() { + + /** + * Properties of a PublicKey. + * @memberof google.cloud.security.privateca.v1 + * @interface IPublicKey + * @property {Uint8Array|null} [key] PublicKey key + * @property {google.cloud.security.privateca.v1.PublicKey.KeyFormat|null} [format] PublicKey format + */ + + /** + * Constructs a new PublicKey. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a PublicKey. + * @implements IPublicKey + * @constructor + * @param {google.cloud.security.privateca.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]]; + } + + /** + * PublicKey key. + * @member {Uint8Array} key + * @memberof google.cloud.security.privateca.v1.PublicKey + * @instance + */ + PublicKey.prototype.key = $util.newBuffer([]); + + /** + * PublicKey format. + * @member {google.cloud.security.privateca.v1.PublicKey.KeyFormat} format + * @memberof google.cloud.security.privateca.v1.PublicKey + * @instance + */ + PublicKey.prototype.format = 0; + + /** + * Creates a new PublicKey instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.PublicKey + * @static + * @param {google.cloud.security.privateca.v1.IPublicKey=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.PublicKey} PublicKey instance + */ + PublicKey.create = function create(properties) { + return new PublicKey(properties); + }; + + /** + * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.security.privateca.v1.PublicKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.PublicKey + * @static + * @param {google.cloud.security.privateca.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.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.format); + return writer; + }; + + /** + * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.PublicKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.PublicKey + * @static + * @param {google.cloud.security.privateca.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(); + }; + + /** + * Decodes a PublicKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.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.security.privateca.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.PublicKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.key = reader.bytes(); + break; + } + case 2: { + message.format = 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.security.privateca.v1.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.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()); + }; + + /** + * Verifies a PublicKey message. + * @function verify + * @memberof google.cloud.security.privateca.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.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.PublicKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.PublicKey} PublicKey + */ + PublicKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.PublicKey) + return object; + var message = new $root.google.cloud.security.privateca.v1.PublicKey(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length >= 0) + message.key = object.key; + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "KEY_FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "PEM": + case 1: + message.format = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a PublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.PublicKey + * @static + * @param {google.cloud.security.privateca.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) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + object.format = options.enums === String ? "KEY_FORMAT_UNSPECIFIED" : 0; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.cloud.security.privateca.v1.PublicKey.KeyFormat[message.format] === undefined ? message.format : $root.google.cloud.security.privateca.v1.PublicKey.KeyFormat[message.format] : message.format; + return object; + }; + + /** + * Converts this PublicKey to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.PublicKey + * @instance + * @returns {Object.} JSON object + */ + PublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PublicKey + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.PublicKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PublicKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.PublicKey"; + }; + + /** + * KeyFormat enum. + * @name google.cloud.security.privateca.v1.PublicKey.KeyFormat + * @enum {number} + * @property {number} KEY_FORMAT_UNSPECIFIED=0 KEY_FORMAT_UNSPECIFIED value + * @property {number} PEM=1 PEM value + */ + PublicKey.KeyFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KEY_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PEM"] = 1; + return values; + })(); + + return PublicKey; + })(); + + v1.CertificateConfig = (function() { + + /** + * Properties of a CertificateConfig. + * @memberof google.cloud.security.privateca.v1 + * @interface ICertificateConfig + * @property {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig|null} [subjectConfig] CertificateConfig subjectConfig + * @property {google.cloud.security.privateca.v1.IX509Parameters|null} [x509Config] CertificateConfig x509Config + * @property {google.cloud.security.privateca.v1.IPublicKey|null} [publicKey] CertificateConfig publicKey + * @property {google.cloud.security.privateca.v1.CertificateConfig.IKeyId|null} [subjectKeyId] CertificateConfig subjectKeyId + */ + + /** + * Constructs a new CertificateConfig. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CertificateConfig. + * @implements ICertificateConfig + * @constructor + * @param {google.cloud.security.privateca.v1.ICertificateConfig=} [properties] Properties to set + */ + function CertificateConfig(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]]; + } + + /** + * CertificateConfig subjectConfig. + * @member {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig|null|undefined} subjectConfig + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @instance + */ + CertificateConfig.prototype.subjectConfig = null; + + /** + * CertificateConfig x509Config. + * @member {google.cloud.security.privateca.v1.IX509Parameters|null|undefined} x509Config + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @instance + */ + CertificateConfig.prototype.x509Config = null; + + /** + * CertificateConfig publicKey. + * @member {google.cloud.security.privateca.v1.IPublicKey|null|undefined} publicKey + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @instance + */ + CertificateConfig.prototype.publicKey = null; + + /** + * CertificateConfig subjectKeyId. + * @member {google.cloud.security.privateca.v1.CertificateConfig.IKeyId|null|undefined} subjectKeyId + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @instance + */ + CertificateConfig.prototype.subjectKeyId = null; + + /** + * Creates a new CertificateConfig instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @static + * @param {google.cloud.security.privateca.v1.ICertificateConfig=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateConfig} CertificateConfig instance + */ + CertificateConfig.create = function create(properties) { + return new CertificateConfig(properties); + }; + + /** + * Encodes the specified CertificateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @static + * @param {google.cloud.security.privateca.v1.ICertificateConfig} message CertificateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subjectConfig != null && Object.hasOwnProperty.call(message, "subjectConfig")) + $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.encode(message.subjectConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.x509Config != null && Object.hasOwnProperty.call(message, "x509Config")) + $root.google.cloud.security.privateca.v1.X509Parameters.encode(message.x509Config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + $root.google.cloud.security.privateca.v1.PublicKey.encode(message.publicKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.subjectKeyId != null && Object.hasOwnProperty.call(message, "subjectKeyId")) + $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId.encode(message.subjectKeyId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CertificateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @static + * @param {google.cloud.security.privateca.v1.ICertificateConfig} message CertificateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateConfig} CertificateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subjectConfig = $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.x509Config = $root.google.cloud.security.privateca.v1.X509Parameters.decode(reader, reader.uint32()); + break; + } + case 3: { + message.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.decode(reader, reader.uint32()); + break; + } + case 4: { + message.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateConfig} CertificateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateConfig message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subjectConfig != null && message.hasOwnProperty("subjectConfig")) { + var error = $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.verify(message.subjectConfig); + if (error) + return "subjectConfig." + error; + } + if (message.x509Config != null && message.hasOwnProperty("x509Config")) { + var error = $root.google.cloud.security.privateca.v1.X509Parameters.verify(message.x509Config); + if (error) + return "x509Config." + error; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) { + var error = $root.google.cloud.security.privateca.v1.PublicKey.verify(message.publicKey); + if (error) + return "publicKey." + error; + } + if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) { + var error = $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId.verify(message.subjectKeyId); + if (error) + return "subjectKeyId." + error; + } + return null; + }; + + /** + * Creates a CertificateConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateConfig} CertificateConfig + */ + CertificateConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateConfig) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateConfig(); + if (object.subjectConfig != null) { + if (typeof object.subjectConfig !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.subjectConfig: object expected"); + message.subjectConfig = $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.fromObject(object.subjectConfig); + } + if (object.x509Config != null) { + if (typeof object.x509Config !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.x509Config: object expected"); + message.x509Config = $root.google.cloud.security.privateca.v1.X509Parameters.fromObject(object.x509Config); + } + if (object.publicKey != null) { + if (typeof object.publicKey !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.publicKey: object expected"); + message.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.fromObject(object.publicKey); + } + if (object.subjectKeyId != null) { + if (typeof object.subjectKeyId !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.subjectKeyId: object expected"); + message.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId.fromObject(object.subjectKeyId); + } + return message; + }; + + /** + * Creates a plain object from a CertificateConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @static + * @param {google.cloud.security.privateca.v1.CertificateConfig} message CertificateConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subjectConfig = null; + object.x509Config = null; + object.publicKey = null; + object.subjectKeyId = null; + } + if (message.subjectConfig != null && message.hasOwnProperty("subjectConfig")) + object.subjectConfig = $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.toObject(message.subjectConfig, options); + if (message.x509Config != null && message.hasOwnProperty("x509Config")) + object.x509Config = $root.google.cloud.security.privateca.v1.X509Parameters.toObject(message.x509Config, options); + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.toObject(message.publicKey, options); + if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) + object.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId.toObject(message.subjectKeyId, options); + return object; + }; + + /** + * Converts this CertificateConfig to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @instance + * @returns {Object.} JSON object + */ + CertificateConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateConfig + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateConfig"; + }; + + CertificateConfig.SubjectConfig = (function() { + + /** + * Properties of a SubjectConfig. + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @interface ISubjectConfig + * @property {google.cloud.security.privateca.v1.ISubject|null} [subject] SubjectConfig subject + * @property {google.cloud.security.privateca.v1.ISubjectAltNames|null} [subjectAltName] SubjectConfig subjectAltName + */ + + /** + * Constructs a new SubjectConfig. + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @classdesc Represents a SubjectConfig. + * @implements ISubjectConfig + * @constructor + * @param {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig=} [properties] Properties to set + */ + function SubjectConfig(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]]; + } + + /** + * SubjectConfig subject. + * @member {google.cloud.security.privateca.v1.ISubject|null|undefined} subject + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @instance + */ + SubjectConfig.prototype.subject = null; + + /** + * SubjectConfig subjectAltName. + * @member {google.cloud.security.privateca.v1.ISubjectAltNames|null|undefined} subjectAltName + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @instance + */ + SubjectConfig.prototype.subjectAltName = null; + + /** + * Creates a new SubjectConfig instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @static + * @param {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig} SubjectConfig instance + */ + SubjectConfig.create = function create(properties) { + return new SubjectConfig(properties); + }; + + /** + * Encodes the specified SubjectConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @static + * @param {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig} message SubjectConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + $root.google.cloud.security.privateca.v1.Subject.encode(message.subject, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.subjectAltName != null && Object.hasOwnProperty.call(message, "subjectAltName")) + $root.google.cloud.security.privateca.v1.SubjectAltNames.encode(message.subjectAltName, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubjectConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @static + * @param {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig} message SubjectConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubjectConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig} SubjectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subject = $root.google.cloud.security.privateca.v1.Subject.decode(reader, reader.uint32()); + break; + } + case 2: { + message.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubjectConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig} SubjectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubjectConfig message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubjectConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subject != null && message.hasOwnProperty("subject")) { + var error = $root.google.cloud.security.privateca.v1.Subject.verify(message.subject); + if (error) + return "subject." + error; + } + if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) { + var error = $root.google.cloud.security.privateca.v1.SubjectAltNames.verify(message.subjectAltName); + if (error) + return "subjectAltName." + error; + } + return null; + }; + + /** + * Creates a SubjectConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig} SubjectConfig + */ + SubjectConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig(); + if (object.subject != null) { + if (typeof object.subject !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.subject: object expected"); + message.subject = $root.google.cloud.security.privateca.v1.Subject.fromObject(object.subject); + } + if (object.subjectAltName != null) { + if (typeof object.subjectAltName !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.subjectAltName: object expected"); + message.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.fromObject(object.subjectAltName); + } + return message; + }; + + /** + * Creates a plain object from a SubjectConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @static + * @param {google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig} message SubjectConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubjectConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subject = null; + object.subjectAltName = null; + } + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = $root.google.cloud.security.privateca.v1.Subject.toObject(message.subject, options); + if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) + object.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.toObject(message.subjectAltName, options); + return object; + }; + + /** + * Converts this SubjectConfig to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @instance + * @returns {Object.} JSON object + */ + SubjectConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubjectConfig + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubjectConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig"; + }; + + return SubjectConfig; + })(); + + CertificateConfig.KeyId = (function() { + + /** + * Properties of a KeyId. + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @interface IKeyId + * @property {string|null} [keyId] KeyId keyId + */ + + /** + * Constructs a new KeyId. + * @memberof google.cloud.security.privateca.v1.CertificateConfig + * @classdesc Represents a KeyId. + * @implements IKeyId + * @constructor + * @param {google.cloud.security.privateca.v1.CertificateConfig.IKeyId=} [properties] Properties to set + */ + function KeyId(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]]; + } + + /** + * KeyId keyId. + * @member {string} keyId + * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId + * @instance + */ + KeyId.prototype.keyId = ""; + + /** + * Creates a new KeyId instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId + * @static + * @param {google.cloud.security.privateca.v1.CertificateConfig.IKeyId=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateConfig.KeyId} KeyId instance + */ + KeyId.create = function create(properties) { + return new KeyId(properties); + }; + + /** + * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.KeyId.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId + * @static + * @param {google.cloud.security.privateca.v1.CertificateConfig.IKeyId} message KeyId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyId); + return writer; + }; + + /** + * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.KeyId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId + * @static + * @param {google.cloud.security.privateca.v1.CertificateConfig.IKeyId} message KeyId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyId message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateConfig.KeyId} KeyId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyId.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateConfig.KeyId} KeyId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyId message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyId != null && message.hasOwnProperty("keyId")) + if (!$util.isString(message.keyId)) + return "keyId: string expected"; + return null; + }; + + /** + * Creates a KeyId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateConfig.KeyId} KeyId + */ + KeyId.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId(); + if (object.keyId != null) + message.keyId = String(object.keyId); + return message; + }; + + /** + * Creates a plain object from a KeyId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId + * @static + * @param {google.cloud.security.privateca.v1.CertificateConfig.KeyId} message KeyId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.keyId = ""; + if (message.keyId != null && message.hasOwnProperty("keyId")) + object.keyId = message.keyId; + return object; + }; + + /** + * Converts this KeyId to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId + * @instance + * @returns {Object.} JSON object + */ + KeyId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyId + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateConfig.KeyId"; + }; + + return KeyId; + })(); + + return CertificateConfig; + })(); + + v1.CertificateDescription = (function() { + + /** + * Properties of a CertificateDescription. + * @memberof google.cloud.security.privateca.v1 + * @interface ICertificateDescription + * @property {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription|null} [subjectDescription] CertificateDescription subjectDescription + * @property {google.cloud.security.privateca.v1.IX509Parameters|null} [x509Description] CertificateDescription x509Description + * @property {google.cloud.security.privateca.v1.IPublicKey|null} [publicKey] CertificateDescription publicKey + * @property {google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null} [subjectKeyId] CertificateDescription subjectKeyId + * @property {google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null} [authorityKeyId] CertificateDescription authorityKeyId + * @property {Array.|null} [crlDistributionPoints] CertificateDescription crlDistributionPoints + * @property {Array.|null} [aiaIssuingCertificateUrls] CertificateDescription aiaIssuingCertificateUrls + * @property {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint|null} [certFingerprint] CertificateDescription certFingerprint + * @property {string|null} [tbsCertificateDigest] CertificateDescription tbsCertificateDigest + */ + + /** + * Constructs a new CertificateDescription. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CertificateDescription. + * @implements ICertificateDescription + * @constructor + * @param {google.cloud.security.privateca.v1.ICertificateDescription=} [properties] Properties to set + */ + function CertificateDescription(properties) { + this.crlDistributionPoints = []; + this.aiaIssuingCertificateUrls = []; + 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]]; + } + + /** + * CertificateDescription subjectDescription. + * @member {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription|null|undefined} subjectDescription + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.subjectDescription = null; + + /** + * CertificateDescription x509Description. + * @member {google.cloud.security.privateca.v1.IX509Parameters|null|undefined} x509Description + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.x509Description = null; + + /** + * CertificateDescription publicKey. + * @member {google.cloud.security.privateca.v1.IPublicKey|null|undefined} publicKey + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.publicKey = null; + + /** + * CertificateDescription subjectKeyId. + * @member {google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null|undefined} subjectKeyId + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.subjectKeyId = null; + + /** + * CertificateDescription authorityKeyId. + * @member {google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null|undefined} authorityKeyId + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.authorityKeyId = null; + + /** + * CertificateDescription crlDistributionPoints. + * @member {Array.} crlDistributionPoints + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.crlDistributionPoints = $util.emptyArray; + + /** + * CertificateDescription aiaIssuingCertificateUrls. + * @member {Array.} aiaIssuingCertificateUrls + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.aiaIssuingCertificateUrls = $util.emptyArray; + + /** + * CertificateDescription certFingerprint. + * @member {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint|null|undefined} certFingerprint + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.certFingerprint = null; + + /** + * CertificateDescription tbsCertificateDigest. + * @member {string} tbsCertificateDigest + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.tbsCertificateDigest = ""; + + /** + * Creates a new CertificateDescription instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @static + * @param {google.cloud.security.privateca.v1.ICertificateDescription=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateDescription} CertificateDescription instance + */ + CertificateDescription.create = function create(properties) { + return new CertificateDescription(properties); + }; + + /** + * Encodes the specified CertificateDescription message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @static + * @param {google.cloud.security.privateca.v1.ICertificateDescription} message CertificateDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateDescription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subjectDescription != null && Object.hasOwnProperty.call(message, "subjectDescription")) + $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.encode(message.subjectDescription, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.x509Description != null && Object.hasOwnProperty.call(message, "x509Description")) + $root.google.cloud.security.privateca.v1.X509Parameters.encode(message.x509Description, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + $root.google.cloud.security.privateca.v1.PublicKey.encode(message.publicKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.subjectKeyId != null && Object.hasOwnProperty.call(message, "subjectKeyId")) + $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.encode(message.subjectKeyId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.authorityKeyId != null && Object.hasOwnProperty.call(message, "authorityKeyId")) + $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.encode(message.authorityKeyId, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.crlDistributionPoints != null && message.crlDistributionPoints.length) + for (var i = 0; i < message.crlDistributionPoints.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.crlDistributionPoints[i]); + if (message.aiaIssuingCertificateUrls != null && message.aiaIssuingCertificateUrls.length) + for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.aiaIssuingCertificateUrls[i]); + if (message.certFingerprint != null && Object.hasOwnProperty.call(message, "certFingerprint")) + $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.encode(message.certFingerprint, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.tbsCertificateDigest != null && Object.hasOwnProperty.call(message, "tbsCertificateDigest")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.tbsCertificateDigest); + return writer; + }; + + /** + * Encodes the specified CertificateDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @static + * @param {google.cloud.security.privateca.v1.ICertificateDescription} message CertificateDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateDescription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateDescription message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateDescription} CertificateDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateDescription.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateDescription(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subjectDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.decode(reader, reader.uint32()); + break; + } + case 2: { + message.x509Description = $root.google.cloud.security.privateca.v1.X509Parameters.decode(reader, reader.uint32()); + break; + } + case 3: { + message.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.decode(reader, reader.uint32()); + break; + } + case 4: { + message.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.decode(reader, reader.uint32()); + break; + } + case 5: { + message.authorityKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.crlDistributionPoints && message.crlDistributionPoints.length)) + message.crlDistributionPoints = []; + message.crlDistributionPoints.push(reader.string()); + break; + } + case 7: { + if (!(message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length)) + message.aiaIssuingCertificateUrls = []; + message.aiaIssuingCertificateUrls.push(reader.string()); + break; + } + case 8: { + message.certFingerprint = $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.decode(reader, reader.uint32()); + break; + } + case 9: { + message.tbsCertificateDigest = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateDescription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateDescription} CertificateDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateDescription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateDescription message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateDescription.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subjectDescription != null && message.hasOwnProperty("subjectDescription")) { + var error = $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.verify(message.subjectDescription); + if (error) + return "subjectDescription." + error; + } + if (message.x509Description != null && message.hasOwnProperty("x509Description")) { + var error = $root.google.cloud.security.privateca.v1.X509Parameters.verify(message.x509Description); + if (error) + return "x509Description." + error; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) { + var error = $root.google.cloud.security.privateca.v1.PublicKey.verify(message.publicKey); + if (error) + return "publicKey." + error; + } + if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) { + var error = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify(message.subjectKeyId); + if (error) + return "subjectKeyId." + error; + } + if (message.authorityKeyId != null && message.hasOwnProperty("authorityKeyId")) { + var error = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify(message.authorityKeyId); + if (error) + return "authorityKeyId." + error; + } + if (message.crlDistributionPoints != null && message.hasOwnProperty("crlDistributionPoints")) { + if (!Array.isArray(message.crlDistributionPoints)) + return "crlDistributionPoints: array expected"; + for (var i = 0; i < message.crlDistributionPoints.length; ++i) + if (!$util.isString(message.crlDistributionPoints[i])) + return "crlDistributionPoints: string[] expected"; + } + if (message.aiaIssuingCertificateUrls != null && message.hasOwnProperty("aiaIssuingCertificateUrls")) { + if (!Array.isArray(message.aiaIssuingCertificateUrls)) + return "aiaIssuingCertificateUrls: array expected"; + for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) + if (!$util.isString(message.aiaIssuingCertificateUrls[i])) + return "aiaIssuingCertificateUrls: string[] expected"; + } + if (message.certFingerprint != null && message.hasOwnProperty("certFingerprint")) { + var error = $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.verify(message.certFingerprint); + if (error) + return "certFingerprint." + error; + } + if (message.tbsCertificateDigest != null && message.hasOwnProperty("tbsCertificateDigest")) + if (!$util.isString(message.tbsCertificateDigest)) + return "tbsCertificateDigest: string expected"; + return null; + }; + + /** + * Creates a CertificateDescription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateDescription} CertificateDescription + */ + CertificateDescription.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateDescription) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateDescription(); + if (object.subjectDescription != null) { + if (typeof object.subjectDescription !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.subjectDescription: object expected"); + message.subjectDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.fromObject(object.subjectDescription); + } + if (object.x509Description != null) { + if (typeof object.x509Description !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.x509Description: object expected"); + message.x509Description = $root.google.cloud.security.privateca.v1.X509Parameters.fromObject(object.x509Description); + } + if (object.publicKey != null) { + if (typeof object.publicKey !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.publicKey: object expected"); + message.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.fromObject(object.publicKey); + } + if (object.subjectKeyId != null) { + if (typeof object.subjectKeyId !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.subjectKeyId: object expected"); + message.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.fromObject(object.subjectKeyId); + } + if (object.authorityKeyId != null) { + if (typeof object.authorityKeyId !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.authorityKeyId: object expected"); + message.authorityKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.fromObject(object.authorityKeyId); + } + if (object.crlDistributionPoints) { + if (!Array.isArray(object.crlDistributionPoints)) + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.crlDistributionPoints: array expected"); + message.crlDistributionPoints = []; + for (var i = 0; i < object.crlDistributionPoints.length; ++i) + message.crlDistributionPoints[i] = String(object.crlDistributionPoints[i]); + } + if (object.aiaIssuingCertificateUrls) { + if (!Array.isArray(object.aiaIssuingCertificateUrls)) + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.aiaIssuingCertificateUrls: array expected"); + message.aiaIssuingCertificateUrls = []; + for (var i = 0; i < object.aiaIssuingCertificateUrls.length; ++i) + message.aiaIssuingCertificateUrls[i] = String(object.aiaIssuingCertificateUrls[i]); + } + if (object.certFingerprint != null) { + if (typeof object.certFingerprint !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.certFingerprint: object expected"); + message.certFingerprint = $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.fromObject(object.certFingerprint); + } + if (object.tbsCertificateDigest != null) + message.tbsCertificateDigest = String(object.tbsCertificateDigest); + return message; + }; + + /** + * Creates a plain object from a CertificateDescription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription} message CertificateDescription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateDescription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.crlDistributionPoints = []; + object.aiaIssuingCertificateUrls = []; + } + if (options.defaults) { + object.subjectDescription = null; + object.x509Description = null; + object.publicKey = null; + object.subjectKeyId = null; + object.authorityKeyId = null; + object.certFingerprint = null; + object.tbsCertificateDigest = ""; + } + if (message.subjectDescription != null && message.hasOwnProperty("subjectDescription")) + object.subjectDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.toObject(message.subjectDescription, options); + if (message.x509Description != null && message.hasOwnProperty("x509Description")) + object.x509Description = $root.google.cloud.security.privateca.v1.X509Parameters.toObject(message.x509Description, options); + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.toObject(message.publicKey, options); + if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) + object.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.toObject(message.subjectKeyId, options); + if (message.authorityKeyId != null && message.hasOwnProperty("authorityKeyId")) + object.authorityKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.toObject(message.authorityKeyId, options); + if (message.crlDistributionPoints && message.crlDistributionPoints.length) { + object.crlDistributionPoints = []; + for (var j = 0; j < message.crlDistributionPoints.length; ++j) + object.crlDistributionPoints[j] = message.crlDistributionPoints[j]; + } + if (message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length) { + object.aiaIssuingCertificateUrls = []; + for (var j = 0; j < message.aiaIssuingCertificateUrls.length; ++j) + object.aiaIssuingCertificateUrls[j] = message.aiaIssuingCertificateUrls[j]; + } + if (message.certFingerprint != null && message.hasOwnProperty("certFingerprint")) + object.certFingerprint = $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.toObject(message.certFingerprint, options); + if (message.tbsCertificateDigest != null && message.hasOwnProperty("tbsCertificateDigest")) + object.tbsCertificateDigest = message.tbsCertificateDigest; + return object; + }; + + /** + * Converts this CertificateDescription to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @instance + * @returns {Object.} JSON object + */ + CertificateDescription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateDescription + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateDescription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateDescription"; + }; + + CertificateDescription.SubjectDescription = (function() { + + /** + * Properties of a SubjectDescription. + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @interface ISubjectDescription + * @property {google.cloud.security.privateca.v1.ISubject|null} [subject] SubjectDescription subject + * @property {google.cloud.security.privateca.v1.ISubjectAltNames|null} [subjectAltName] SubjectDescription subjectAltName + * @property {string|null} [hexSerialNumber] SubjectDescription hexSerialNumber + * @property {google.protobuf.IDuration|null} [lifetime] SubjectDescription lifetime + * @property {google.protobuf.ITimestamp|null} [notBeforeTime] SubjectDescription notBeforeTime + * @property {google.protobuf.ITimestamp|null} [notAfterTime] SubjectDescription notAfterTime + */ + + /** + * Constructs a new SubjectDescription. + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @classdesc Represents a SubjectDescription. + * @implements ISubjectDescription + * @constructor + * @param {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription=} [properties] Properties to set + */ + function SubjectDescription(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]]; + } + + /** + * SubjectDescription subject. + * @member {google.cloud.security.privateca.v1.ISubject|null|undefined} subject + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.subject = null; + + /** + * SubjectDescription subjectAltName. + * @member {google.cloud.security.privateca.v1.ISubjectAltNames|null|undefined} subjectAltName + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.subjectAltName = null; + + /** + * SubjectDescription hexSerialNumber. + * @member {string} hexSerialNumber + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.hexSerialNumber = ""; + + /** + * SubjectDescription lifetime. + * @member {google.protobuf.IDuration|null|undefined} lifetime + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.lifetime = null; + + /** + * SubjectDescription notBeforeTime. + * @member {google.protobuf.ITimestamp|null|undefined} notBeforeTime + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.notBeforeTime = null; + + /** + * SubjectDescription notAfterTime. + * @member {google.protobuf.ITimestamp|null|undefined} notAfterTime + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.notAfterTime = null; + + /** + * Creates a new SubjectDescription instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription} SubjectDescription instance + */ + SubjectDescription.create = function create(properties) { + return new SubjectDescription(properties); + }; + + /** + * Encodes the specified SubjectDescription message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription} message SubjectDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectDescription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + $root.google.cloud.security.privateca.v1.Subject.encode(message.subject, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.subjectAltName != null && Object.hasOwnProperty.call(message, "subjectAltName")) + $root.google.cloud.security.privateca.v1.SubjectAltNames.encode(message.subjectAltName, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.hexSerialNumber != null && Object.hasOwnProperty.call(message, "hexSerialNumber")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.hexSerialNumber); + if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) + $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.notBeforeTime != null && Object.hasOwnProperty.call(message, "notBeforeTime")) + $root.google.protobuf.Timestamp.encode(message.notBeforeTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.notAfterTime != null && Object.hasOwnProperty.call(message, "notAfterTime")) + $root.google.protobuf.Timestamp.encode(message.notAfterTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubjectDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription} message SubjectDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectDescription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubjectDescription message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription} SubjectDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectDescription.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subject = $root.google.cloud.security.privateca.v1.Subject.decode(reader, reader.uint32()); + break; + } + case 2: { + message.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.decode(reader, reader.uint32()); + break; + } + case 3: { + message.hexSerialNumber = reader.string(); + break; + } + case 4: { + message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.notBeforeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.notAfterTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubjectDescription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription} SubjectDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectDescription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubjectDescription message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubjectDescription.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subject != null && message.hasOwnProperty("subject")) { + var error = $root.google.cloud.security.privateca.v1.Subject.verify(message.subject); + if (error) + return "subject." + error; + } + if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) { + var error = $root.google.cloud.security.privateca.v1.SubjectAltNames.verify(message.subjectAltName); + if (error) + return "subjectAltName." + error; + } + if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) + if (!$util.isString(message.hexSerialNumber)) + return "hexSerialNumber: string expected"; + if (message.lifetime != null && message.hasOwnProperty("lifetime")) { + var error = $root.google.protobuf.Duration.verify(message.lifetime); + if (error) + return "lifetime." + error; + } + if (message.notBeforeTime != null && message.hasOwnProperty("notBeforeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.notBeforeTime); + if (error) + return "notBeforeTime." + error; + } + if (message.notAfterTime != null && message.hasOwnProperty("notAfterTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.notAfterTime); + if (error) + return "notAfterTime." + error; + } + return null; + }; + + /** + * Creates a SubjectDescription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription} SubjectDescription + */ + SubjectDescription.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription(); + if (object.subject != null) { + if (typeof object.subject !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.subject: object expected"); + message.subject = $root.google.cloud.security.privateca.v1.Subject.fromObject(object.subject); + } + if (object.subjectAltName != null) { + if (typeof object.subjectAltName !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.subjectAltName: object expected"); + message.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.fromObject(object.subjectAltName); + } + if (object.hexSerialNumber != null) + message.hexSerialNumber = String(object.hexSerialNumber); + if (object.lifetime != null) { + if (typeof object.lifetime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.lifetime: object expected"); + message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); + } + if (object.notBeforeTime != null) { + if (typeof object.notBeforeTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.notBeforeTime: object expected"); + message.notBeforeTime = $root.google.protobuf.Timestamp.fromObject(object.notBeforeTime); + } + if (object.notAfterTime != null) { + if (typeof object.notAfterTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.notAfterTime: object expected"); + message.notAfterTime = $root.google.protobuf.Timestamp.fromObject(object.notAfterTime); + } + return message; + }; + + /** + * Creates a plain object from a SubjectDescription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription} message SubjectDescription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubjectDescription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subject = null; + object.subjectAltName = null; + object.hexSerialNumber = ""; + object.lifetime = null; + object.notBeforeTime = null; + object.notAfterTime = null; + } + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = $root.google.cloud.security.privateca.v1.Subject.toObject(message.subject, options); + if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) + object.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.toObject(message.subjectAltName, options); + if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) + object.hexSerialNumber = message.hexSerialNumber; + if (message.lifetime != null && message.hasOwnProperty("lifetime")) + object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); + if (message.notBeforeTime != null && message.hasOwnProperty("notBeforeTime")) + object.notBeforeTime = $root.google.protobuf.Timestamp.toObject(message.notBeforeTime, options); + if (message.notAfterTime != null && message.hasOwnProperty("notAfterTime")) + object.notAfterTime = $root.google.protobuf.Timestamp.toObject(message.notAfterTime, options); + return object; + }; + + /** + * Converts this SubjectDescription to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @instance + * @returns {Object.} JSON object + */ + SubjectDescription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubjectDescription + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubjectDescription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription"; + }; + + return SubjectDescription; + })(); + + CertificateDescription.KeyId = (function() { + + /** + * Properties of a KeyId. + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @interface IKeyId + * @property {string|null} [keyId] KeyId keyId + */ + + /** + * Constructs a new KeyId. + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @classdesc Represents a KeyId. + * @implements IKeyId + * @constructor + * @param {google.cloud.security.privateca.v1.CertificateDescription.IKeyId=} [properties] Properties to set + */ + function KeyId(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]]; + } + + /** + * KeyId keyId. + * @member {string} keyId + * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId + * @instance + */ + KeyId.prototype.keyId = ""; + + /** + * Creates a new KeyId instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.IKeyId=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateDescription.KeyId} KeyId instance + */ + KeyId.create = function create(properties) { + return new KeyId(properties); + }; + + /** + * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.IKeyId} message KeyId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyId); + return writer; + }; + + /** + * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.IKeyId} message KeyId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyId message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateDescription.KeyId} KeyId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyId.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateDescription.KeyId} KeyId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyId message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyId != null && message.hasOwnProperty("keyId")) + if (!$util.isString(message.keyId)) + return "keyId: string expected"; + return null; + }; + + /** + * Creates a KeyId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateDescription.KeyId} KeyId + */ + KeyId.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId(); + if (object.keyId != null) + message.keyId = String(object.keyId); + return message; + }; + + /** + * Creates a plain object from a KeyId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.KeyId} message KeyId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.keyId = ""; + if (message.keyId != null && message.hasOwnProperty("keyId")) + object.keyId = message.keyId; + return object; + }; + + /** + * Converts this KeyId to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId + * @instance + * @returns {Object.} JSON object + */ + KeyId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyId + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateDescription.KeyId"; + }; + + return KeyId; + })(); + + CertificateDescription.CertificateFingerprint = (function() { + + /** + * Properties of a CertificateFingerprint. + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @interface ICertificateFingerprint + * @property {string|null} [sha256Hash] CertificateFingerprint sha256Hash + */ + + /** + * Constructs a new CertificateFingerprint. + * @memberof google.cloud.security.privateca.v1.CertificateDescription + * @classdesc Represents a CertificateFingerprint. + * @implements ICertificateFingerprint + * @constructor + * @param {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint=} [properties] Properties to set + */ + function CertificateFingerprint(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]]; + } + + /** + * CertificateFingerprint sha256Hash. + * @member {string} sha256Hash + * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint + * @instance + */ + CertificateFingerprint.prototype.sha256Hash = ""; + + /** + * Creates a new CertificateFingerprint instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint} CertificateFingerprint instance + */ + CertificateFingerprint.create = function create(properties) { + return new CertificateFingerprint(properties); + }; + + /** + * Encodes the specified CertificateFingerprint message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint} message CertificateFingerprint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateFingerprint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sha256Hash != null && Object.hasOwnProperty.call(message, "sha256Hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sha256Hash); + return writer; + }; + + /** + * Encodes the specified CertificateFingerprint message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint} message CertificateFingerprint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateFingerprint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateFingerprint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint} CertificateFingerprint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateFingerprint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sha256Hash = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateFingerprint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint} CertificateFingerprint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateFingerprint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateFingerprint message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateFingerprint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash")) + if (!$util.isString(message.sha256Hash)) + return "sha256Hash: string expected"; + return null; + }; + + /** + * Creates a CertificateFingerprint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint} CertificateFingerprint + */ + CertificateFingerprint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint(); + if (object.sha256Hash != null) + message.sha256Hash = String(object.sha256Hash); + return message; + }; + + /** + * Creates a plain object from a CertificateFingerprint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint + * @static + * @param {google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint} message CertificateFingerprint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateFingerprint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sha256Hash = ""; + if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash")) + object.sha256Hash = message.sha256Hash; + return object; + }; + + /** + * Converts this CertificateFingerprint to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint + * @instance + * @returns {Object.} JSON object + */ + CertificateFingerprint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateFingerprint + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateFingerprint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint"; + }; + + return CertificateFingerprint; + })(); + + return CertificateDescription; + })(); + + v1.ObjectId = (function() { + + /** + * Properties of an ObjectId. + * @memberof google.cloud.security.privateca.v1 + * @interface IObjectId + * @property {Array.|null} [objectIdPath] ObjectId objectIdPath + */ + + /** + * Constructs a new ObjectId. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an ObjectId. + * @implements IObjectId + * @constructor + * @param {google.cloud.security.privateca.v1.IObjectId=} [properties] Properties to set + */ + function ObjectId(properties) { + this.objectIdPath = []; + 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]]; + } + + /** + * ObjectId objectIdPath. + * @member {Array.} objectIdPath + * @memberof google.cloud.security.privateca.v1.ObjectId + * @instance + */ + ObjectId.prototype.objectIdPath = $util.emptyArray; + + /** + * Creates a new ObjectId instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ObjectId + * @static + * @param {google.cloud.security.privateca.v1.IObjectId=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ObjectId} ObjectId instance + */ + ObjectId.create = function create(properties) { + return new ObjectId(properties); + }; + + /** + * Encodes the specified ObjectId message. Does not implicitly {@link google.cloud.security.privateca.v1.ObjectId.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ObjectId + * @static + * @param {google.cloud.security.privateca.v1.IObjectId} message ObjectId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objectIdPath != null && message.objectIdPath.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.objectIdPath.length; ++i) + writer.int32(message.objectIdPath[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ObjectId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ObjectId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ObjectId + * @static + * @param {google.cloud.security.privateca.v1.IObjectId} message ObjectId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectId message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ObjectId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ObjectId} ObjectId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectId.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ObjectId(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.objectIdPath && message.objectIdPath.length)) + message.objectIdPath = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.objectIdPath.push(reader.int32()); + } else + message.objectIdPath.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ObjectId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ObjectId} ObjectId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectId message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ObjectId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objectIdPath != null && message.hasOwnProperty("objectIdPath")) { + if (!Array.isArray(message.objectIdPath)) + return "objectIdPath: array expected"; + for (var i = 0; i < message.objectIdPath.length; ++i) + if (!$util.isInteger(message.objectIdPath[i])) + return "objectIdPath: integer[] expected"; + } + return null; + }; + + /** + * Creates an ObjectId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ObjectId + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ObjectId} ObjectId + */ + ObjectId.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ObjectId) + return object; + var message = new $root.google.cloud.security.privateca.v1.ObjectId(); + if (object.objectIdPath) { + if (!Array.isArray(object.objectIdPath)) + throw TypeError(".google.cloud.security.privateca.v1.ObjectId.objectIdPath: array expected"); + message.objectIdPath = []; + for (var i = 0; i < object.objectIdPath.length; ++i) + message.objectIdPath[i] = object.objectIdPath[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an ObjectId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ObjectId + * @static + * @param {google.cloud.security.privateca.v1.ObjectId} message ObjectId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.objectIdPath = []; + if (message.objectIdPath && message.objectIdPath.length) { + object.objectIdPath = []; + for (var j = 0; j < message.objectIdPath.length; ++j) + object.objectIdPath[j] = message.objectIdPath[j]; + } + return object; + }; + + /** + * Converts this ObjectId to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ObjectId + * @instance + * @returns {Object.} JSON object + */ + ObjectId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectId + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ObjectId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ObjectId"; + }; + + return ObjectId; + })(); + + v1.X509Extension = (function() { + + /** + * Properties of a X509Extension. + * @memberof google.cloud.security.privateca.v1 + * @interface IX509Extension + * @property {google.cloud.security.privateca.v1.IObjectId|null} [objectId] X509Extension objectId + * @property {boolean|null} [critical] X509Extension critical + * @property {Uint8Array|null} [value] X509Extension value + */ + + /** + * Constructs a new X509Extension. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a X509Extension. + * @implements IX509Extension + * @constructor + * @param {google.cloud.security.privateca.v1.IX509Extension=} [properties] Properties to set + */ + function X509Extension(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]]; + } + + /** + * X509Extension objectId. + * @member {google.cloud.security.privateca.v1.IObjectId|null|undefined} objectId + * @memberof google.cloud.security.privateca.v1.X509Extension + * @instance + */ + X509Extension.prototype.objectId = null; + + /** + * X509Extension critical. + * @member {boolean} critical + * @memberof google.cloud.security.privateca.v1.X509Extension + * @instance + */ + X509Extension.prototype.critical = false; + + /** + * X509Extension value. + * @member {Uint8Array} value + * @memberof google.cloud.security.privateca.v1.X509Extension + * @instance + */ + X509Extension.prototype.value = $util.newBuffer([]); + + /** + * Creates a new X509Extension instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.X509Extension + * @static + * @param {google.cloud.security.privateca.v1.IX509Extension=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.X509Extension} X509Extension instance + */ + X509Extension.create = function create(properties) { + return new X509Extension(properties); + }; + + /** + * Encodes the specified X509Extension message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Extension.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.X509Extension + * @static + * @param {google.cloud.security.privateca.v1.IX509Extension} message X509Extension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + X509Extension.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objectId != null && Object.hasOwnProperty.call(message, "objectId")) + $root.google.cloud.security.privateca.v1.ObjectId.encode(message.objectId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.critical != null && Object.hasOwnProperty.call(message, "critical")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.critical); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified X509Extension message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Extension.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.X509Extension + * @static + * @param {google.cloud.security.privateca.v1.IX509Extension} message X509Extension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + X509Extension.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a X509Extension message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.X509Extension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.X509Extension} X509Extension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + X509Extension.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.X509Extension(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.objectId = $root.google.cloud.security.privateca.v1.ObjectId.decode(reader, reader.uint32()); + break; + } + case 2: { + message.critical = reader.bool(); + break; + } + case 3: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a X509Extension message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.X509Extension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.X509Extension} X509Extension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + X509Extension.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a X509Extension message. + * @function verify + * @memberof google.cloud.security.privateca.v1.X509Extension + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + X509Extension.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objectId != null && message.hasOwnProperty("objectId")) { + var error = $root.google.cloud.security.privateca.v1.ObjectId.verify(message.objectId); + if (error) + return "objectId." + error; + } + if (message.critical != null && message.hasOwnProperty("critical")) + if (typeof message.critical !== "boolean") + return "critical: boolean expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a X509Extension message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.X509Extension + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.X509Extension} X509Extension + */ + X509Extension.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.X509Extension) + return object; + var message = new $root.google.cloud.security.privateca.v1.X509Extension(); + if (object.objectId != null) { + if (typeof object.objectId !== "object") + throw TypeError(".google.cloud.security.privateca.v1.X509Extension.objectId: object expected"); + message.objectId = $root.google.cloud.security.privateca.v1.ObjectId.fromObject(object.objectId); + } + if (object.critical != null) + message.critical = Boolean(object.critical); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a X509Extension message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.X509Extension + * @static + * @param {google.cloud.security.privateca.v1.X509Extension} message X509Extension + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + X509Extension.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.objectId = null; + object.critical = false; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.objectId != null && message.hasOwnProperty("objectId")) + object.objectId = $root.google.cloud.security.privateca.v1.ObjectId.toObject(message.objectId, options); + if (message.critical != null && message.hasOwnProperty("critical")) + object.critical = message.critical; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this X509Extension to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.X509Extension + * @instance + * @returns {Object.} JSON object + */ + X509Extension.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for X509Extension + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.X509Extension + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + X509Extension.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.X509Extension"; + }; + + return X509Extension; + })(); + + v1.KeyUsage = (function() { + + /** + * Properties of a KeyUsage. + * @memberof google.cloud.security.privateca.v1 + * @interface IKeyUsage + * @property {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions|null} [baseKeyUsage] KeyUsage baseKeyUsage + * @property {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions|null} [extendedKeyUsage] KeyUsage extendedKeyUsage + * @property {Array.|null} [unknownExtendedKeyUsages] KeyUsage unknownExtendedKeyUsages + */ + + /** + * Constructs a new KeyUsage. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a KeyUsage. + * @implements IKeyUsage + * @constructor + * @param {google.cloud.security.privateca.v1.IKeyUsage=} [properties] Properties to set + */ + function KeyUsage(properties) { + this.unknownExtendedKeyUsages = []; + 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]]; + } + + /** + * KeyUsage baseKeyUsage. + * @member {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions|null|undefined} baseKeyUsage + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @instance + */ + KeyUsage.prototype.baseKeyUsage = null; + + /** + * KeyUsage extendedKeyUsage. + * @member {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions|null|undefined} extendedKeyUsage + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @instance + */ + KeyUsage.prototype.extendedKeyUsage = null; + + /** + * KeyUsage unknownExtendedKeyUsages. + * @member {Array.} unknownExtendedKeyUsages + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @instance + */ + KeyUsage.prototype.unknownExtendedKeyUsages = $util.emptyArray; + + /** + * Creates a new KeyUsage instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @static + * @param {google.cloud.security.privateca.v1.IKeyUsage=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.KeyUsage} KeyUsage instance + */ + KeyUsage.create = function create(properties) { + return new KeyUsage(properties); + }; + + /** + * Encodes the specified KeyUsage message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @static + * @param {google.cloud.security.privateca.v1.IKeyUsage} message KeyUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyUsage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseKeyUsage != null && Object.hasOwnProperty.call(message, "baseKeyUsage")) + $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.encode(message.baseKeyUsage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.extendedKeyUsage != null && Object.hasOwnProperty.call(message, "extendedKeyUsage")) + $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.encode(message.extendedKeyUsage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.unknownExtendedKeyUsages != null && message.unknownExtendedKeyUsages.length) + for (var i = 0; i < message.unknownExtendedKeyUsages.length; ++i) + $root.google.cloud.security.privateca.v1.ObjectId.encode(message.unknownExtendedKeyUsages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KeyUsage message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @static + * @param {google.cloud.security.privateca.v1.IKeyUsage} message KeyUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyUsage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyUsage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.KeyUsage} KeyUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyUsage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.KeyUsage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.decode(reader, reader.uint32()); + break; + } + case 2: { + message.extendedKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.unknownExtendedKeyUsages && message.unknownExtendedKeyUsages.length)) + message.unknownExtendedKeyUsages = []; + message.unknownExtendedKeyUsages.push($root.google.cloud.security.privateca.v1.ObjectId.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyUsage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.KeyUsage} KeyUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyUsage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyUsage message. + * @function verify + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyUsage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseKeyUsage != null && message.hasOwnProperty("baseKeyUsage")) { + var error = $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.verify(message.baseKeyUsage); + if (error) + return "baseKeyUsage." + error; + } + if (message.extendedKeyUsage != null && message.hasOwnProperty("extendedKeyUsage")) { + var error = $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.verify(message.extendedKeyUsage); + if (error) + return "extendedKeyUsage." + error; + } + if (message.unknownExtendedKeyUsages != null && message.hasOwnProperty("unknownExtendedKeyUsages")) { + if (!Array.isArray(message.unknownExtendedKeyUsages)) + return "unknownExtendedKeyUsages: array expected"; + for (var i = 0; i < message.unknownExtendedKeyUsages.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.ObjectId.verify(message.unknownExtendedKeyUsages[i]); + if (error) + return "unknownExtendedKeyUsages." + error; + } + } + return null; + }; + + /** + * Creates a KeyUsage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.KeyUsage} KeyUsage + */ + KeyUsage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.KeyUsage) + return object; + var message = new $root.google.cloud.security.privateca.v1.KeyUsage(); + if (object.baseKeyUsage != null) { + if (typeof object.baseKeyUsage !== "object") + throw TypeError(".google.cloud.security.privateca.v1.KeyUsage.baseKeyUsage: object expected"); + message.baseKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.fromObject(object.baseKeyUsage); + } + if (object.extendedKeyUsage != null) { + if (typeof object.extendedKeyUsage !== "object") + throw TypeError(".google.cloud.security.privateca.v1.KeyUsage.extendedKeyUsage: object expected"); + message.extendedKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.fromObject(object.extendedKeyUsage); + } + if (object.unknownExtendedKeyUsages) { + if (!Array.isArray(object.unknownExtendedKeyUsages)) + throw TypeError(".google.cloud.security.privateca.v1.KeyUsage.unknownExtendedKeyUsages: array expected"); + message.unknownExtendedKeyUsages = []; + for (var i = 0; i < object.unknownExtendedKeyUsages.length; ++i) { + if (typeof object.unknownExtendedKeyUsages[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.KeyUsage.unknownExtendedKeyUsages: object expected"); + message.unknownExtendedKeyUsages[i] = $root.google.cloud.security.privateca.v1.ObjectId.fromObject(object.unknownExtendedKeyUsages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a KeyUsage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @static + * @param {google.cloud.security.privateca.v1.KeyUsage} message KeyUsage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyUsage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unknownExtendedKeyUsages = []; + if (options.defaults) { + object.baseKeyUsage = null; + object.extendedKeyUsage = null; + } + if (message.baseKeyUsage != null && message.hasOwnProperty("baseKeyUsage")) + object.baseKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.toObject(message.baseKeyUsage, options); + if (message.extendedKeyUsage != null && message.hasOwnProperty("extendedKeyUsage")) + object.extendedKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.toObject(message.extendedKeyUsage, options); + if (message.unknownExtendedKeyUsages && message.unknownExtendedKeyUsages.length) { + object.unknownExtendedKeyUsages = []; + for (var j = 0; j < message.unknownExtendedKeyUsages.length; ++j) + object.unknownExtendedKeyUsages[j] = $root.google.cloud.security.privateca.v1.ObjectId.toObject(message.unknownExtendedKeyUsages[j], options); + } + return object; + }; + + /** + * Converts this KeyUsage to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @instance + * @returns {Object.} JSON object + */ + KeyUsage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyUsage + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.KeyUsage"; + }; + + KeyUsage.KeyUsageOptions = (function() { + + /** + * Properties of a KeyUsageOptions. + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @interface IKeyUsageOptions + * @property {boolean|null} [digitalSignature] KeyUsageOptions digitalSignature + * @property {boolean|null} [contentCommitment] KeyUsageOptions contentCommitment + * @property {boolean|null} [keyEncipherment] KeyUsageOptions keyEncipherment + * @property {boolean|null} [dataEncipherment] KeyUsageOptions dataEncipherment + * @property {boolean|null} [keyAgreement] KeyUsageOptions keyAgreement + * @property {boolean|null} [certSign] KeyUsageOptions certSign + * @property {boolean|null} [crlSign] KeyUsageOptions crlSign + * @property {boolean|null} [encipherOnly] KeyUsageOptions encipherOnly + * @property {boolean|null} [decipherOnly] KeyUsageOptions decipherOnly + */ + + /** + * Constructs a new KeyUsageOptions. + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @classdesc Represents a KeyUsageOptions. + * @implements IKeyUsageOptions + * @constructor + * @param {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions=} [properties] Properties to set + */ + function KeyUsageOptions(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]]; + } + + /** + * KeyUsageOptions digitalSignature. + * @member {boolean} digitalSignature + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.digitalSignature = false; + + /** + * KeyUsageOptions contentCommitment. + * @member {boolean} contentCommitment + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.contentCommitment = false; + + /** + * KeyUsageOptions keyEncipherment. + * @member {boolean} keyEncipherment + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.keyEncipherment = false; + + /** + * KeyUsageOptions dataEncipherment. + * @member {boolean} dataEncipherment + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.dataEncipherment = false; + + /** + * KeyUsageOptions keyAgreement. + * @member {boolean} keyAgreement + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.keyAgreement = false; + + /** + * KeyUsageOptions certSign. + * @member {boolean} certSign + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.certSign = false; + + /** + * KeyUsageOptions crlSign. + * @member {boolean} crlSign + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.crlSign = false; + + /** + * KeyUsageOptions encipherOnly. + * @member {boolean} encipherOnly + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.encipherOnly = false; + + /** + * KeyUsageOptions decipherOnly. + * @member {boolean} decipherOnly + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.decipherOnly = false; + + /** + * Creates a new KeyUsageOptions instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions} KeyUsageOptions instance + */ + KeyUsageOptions.create = function create(properties) { + return new KeyUsageOptions(properties); + }; + + /** + * Encodes the specified KeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions} message KeyUsageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyUsageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.digitalSignature != null && Object.hasOwnProperty.call(message, "digitalSignature")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.digitalSignature); + if (message.contentCommitment != null && Object.hasOwnProperty.call(message, "contentCommitment")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.contentCommitment); + if (message.keyEncipherment != null && Object.hasOwnProperty.call(message, "keyEncipherment")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.keyEncipherment); + if (message.dataEncipherment != null && Object.hasOwnProperty.call(message, "dataEncipherment")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.dataEncipherment); + if (message.keyAgreement != null && Object.hasOwnProperty.call(message, "keyAgreement")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.keyAgreement); + if (message.certSign != null && Object.hasOwnProperty.call(message, "certSign")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.certSign); + if (message.crlSign != null && Object.hasOwnProperty.call(message, "crlSign")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.crlSign); + if (message.encipherOnly != null && Object.hasOwnProperty.call(message, "encipherOnly")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.encipherOnly); + if (message.decipherOnly != null && Object.hasOwnProperty.call(message, "decipherOnly")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.decipherOnly); + return writer; + }; + + /** + * Encodes the specified KeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions} message KeyUsageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyUsageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyUsageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions} KeyUsageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyUsageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.digitalSignature = reader.bool(); + break; + } + case 2: { + message.contentCommitment = reader.bool(); + break; + } + case 3: { + message.keyEncipherment = reader.bool(); + break; + } + case 4: { + message.dataEncipherment = reader.bool(); + break; + } + case 5: { + message.keyAgreement = reader.bool(); + break; + } + case 6: { + message.certSign = reader.bool(); + break; + } + case 7: { + message.crlSign = reader.bool(); + break; + } + case 8: { + message.encipherOnly = reader.bool(); + break; + } + case 9: { + message.decipherOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyUsageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions} KeyUsageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyUsageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyUsageOptions message. + * @function verify + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyUsageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.digitalSignature != null && message.hasOwnProperty("digitalSignature")) + if (typeof message.digitalSignature !== "boolean") + return "digitalSignature: boolean expected"; + if (message.contentCommitment != null && message.hasOwnProperty("contentCommitment")) + if (typeof message.contentCommitment !== "boolean") + return "contentCommitment: boolean expected"; + if (message.keyEncipherment != null && message.hasOwnProperty("keyEncipherment")) + if (typeof message.keyEncipherment !== "boolean") + return "keyEncipherment: boolean expected"; + if (message.dataEncipherment != null && message.hasOwnProperty("dataEncipherment")) + if (typeof message.dataEncipherment !== "boolean") + return "dataEncipherment: boolean expected"; + if (message.keyAgreement != null && message.hasOwnProperty("keyAgreement")) + if (typeof message.keyAgreement !== "boolean") + return "keyAgreement: boolean expected"; + if (message.certSign != null && message.hasOwnProperty("certSign")) + if (typeof message.certSign !== "boolean") + return "certSign: boolean expected"; + if (message.crlSign != null && message.hasOwnProperty("crlSign")) + if (typeof message.crlSign !== "boolean") + return "crlSign: boolean expected"; + if (message.encipherOnly != null && message.hasOwnProperty("encipherOnly")) + if (typeof message.encipherOnly !== "boolean") + return "encipherOnly: boolean expected"; + if (message.decipherOnly != null && message.hasOwnProperty("decipherOnly")) + if (typeof message.decipherOnly !== "boolean") + return "decipherOnly: boolean expected"; + return null; + }; + + /** + * Creates a KeyUsageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions} KeyUsageOptions + */ + KeyUsageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions) + return object; + var message = new $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions(); + if (object.digitalSignature != null) + message.digitalSignature = Boolean(object.digitalSignature); + if (object.contentCommitment != null) + message.contentCommitment = Boolean(object.contentCommitment); + if (object.keyEncipherment != null) + message.keyEncipherment = Boolean(object.keyEncipherment); + if (object.dataEncipherment != null) + message.dataEncipherment = Boolean(object.dataEncipherment); + if (object.keyAgreement != null) + message.keyAgreement = Boolean(object.keyAgreement); + if (object.certSign != null) + message.certSign = Boolean(object.certSign); + if (object.crlSign != null) + message.crlSign = Boolean(object.crlSign); + if (object.encipherOnly != null) + message.encipherOnly = Boolean(object.encipherOnly); + if (object.decipherOnly != null) + message.decipherOnly = Boolean(object.decipherOnly); + return message; + }; + + /** + * Creates a plain object from a KeyUsageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions} message KeyUsageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyUsageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.digitalSignature = false; + object.contentCommitment = false; + object.keyEncipherment = false; + object.dataEncipherment = false; + object.keyAgreement = false; + object.certSign = false; + object.crlSign = false; + object.encipherOnly = false; + object.decipherOnly = false; + } + if (message.digitalSignature != null && message.hasOwnProperty("digitalSignature")) + object.digitalSignature = message.digitalSignature; + if (message.contentCommitment != null && message.hasOwnProperty("contentCommitment")) + object.contentCommitment = message.contentCommitment; + if (message.keyEncipherment != null && message.hasOwnProperty("keyEncipherment")) + object.keyEncipherment = message.keyEncipherment; + if (message.dataEncipherment != null && message.hasOwnProperty("dataEncipherment")) + object.dataEncipherment = message.dataEncipherment; + if (message.keyAgreement != null && message.hasOwnProperty("keyAgreement")) + object.keyAgreement = message.keyAgreement; + if (message.certSign != null && message.hasOwnProperty("certSign")) + object.certSign = message.certSign; + if (message.crlSign != null && message.hasOwnProperty("crlSign")) + object.crlSign = message.crlSign; + if (message.encipherOnly != null && message.hasOwnProperty("encipherOnly")) + object.encipherOnly = message.encipherOnly; + if (message.decipherOnly != null && message.hasOwnProperty("decipherOnly")) + object.decipherOnly = message.decipherOnly; + return object; + }; + + /** + * Converts this KeyUsageOptions to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @instance + * @returns {Object.} JSON object + */ + KeyUsageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyUsageOptions + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyUsageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions"; + }; + + return KeyUsageOptions; + })(); + + KeyUsage.ExtendedKeyUsageOptions = (function() { + + /** + * Properties of an ExtendedKeyUsageOptions. + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @interface IExtendedKeyUsageOptions + * @property {boolean|null} [serverAuth] ExtendedKeyUsageOptions serverAuth + * @property {boolean|null} [clientAuth] ExtendedKeyUsageOptions clientAuth + * @property {boolean|null} [codeSigning] ExtendedKeyUsageOptions codeSigning + * @property {boolean|null} [emailProtection] ExtendedKeyUsageOptions emailProtection + * @property {boolean|null} [timeStamping] ExtendedKeyUsageOptions timeStamping + * @property {boolean|null} [ocspSigning] ExtendedKeyUsageOptions ocspSigning + */ + + /** + * Constructs a new ExtendedKeyUsageOptions. + * @memberof google.cloud.security.privateca.v1.KeyUsage + * @classdesc Represents an ExtendedKeyUsageOptions. + * @implements IExtendedKeyUsageOptions + * @constructor + * @param {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions=} [properties] Properties to set + */ + function ExtendedKeyUsageOptions(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]]; + } + + /** + * ExtendedKeyUsageOptions serverAuth. + * @member {boolean} serverAuth + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.serverAuth = false; + + /** + * ExtendedKeyUsageOptions clientAuth. + * @member {boolean} clientAuth + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.clientAuth = false; + + /** + * ExtendedKeyUsageOptions codeSigning. + * @member {boolean} codeSigning + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.codeSigning = false; + + /** + * ExtendedKeyUsageOptions emailProtection. + * @member {boolean} emailProtection + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.emailProtection = false; + + /** + * ExtendedKeyUsageOptions timeStamping. + * @member {boolean} timeStamping + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.timeStamping = false; + + /** + * ExtendedKeyUsageOptions ocspSigning. + * @member {boolean} ocspSigning + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.ocspSigning = false; + + /** + * Creates a new ExtendedKeyUsageOptions instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions instance + */ + ExtendedKeyUsageOptions.create = function create(properties) { + return new ExtendedKeyUsageOptions(properties); + }; + + /** + * Encodes the specified ExtendedKeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions} message ExtendedKeyUsageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtendedKeyUsageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serverAuth != null && Object.hasOwnProperty.call(message, "serverAuth")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.serverAuth); + if (message.clientAuth != null && Object.hasOwnProperty.call(message, "clientAuth")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.clientAuth); + if (message.codeSigning != null && Object.hasOwnProperty.call(message, "codeSigning")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.codeSigning); + if (message.emailProtection != null && Object.hasOwnProperty.call(message, "emailProtection")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.emailProtection); + if (message.timeStamping != null && Object.hasOwnProperty.call(message, "timeStamping")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.timeStamping); + if (message.ocspSigning != null && Object.hasOwnProperty.call(message, "ocspSigning")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.ocspSigning); + return writer; + }; + + /** + * Encodes the specified ExtendedKeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions} message ExtendedKeyUsageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtendedKeyUsageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtendedKeyUsageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serverAuth = reader.bool(); + break; + } + case 2: { + message.clientAuth = reader.bool(); + break; + } + case 3: { + message.codeSigning = reader.bool(); + break; + } + case 4: { + message.emailProtection = reader.bool(); + break; + } + case 5: { + message.timeStamping = reader.bool(); + break; + } + case 6: { + message.ocspSigning = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtendedKeyUsageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtendedKeyUsageOptions message. + * @function verify + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtendedKeyUsageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serverAuth != null && message.hasOwnProperty("serverAuth")) + if (typeof message.serverAuth !== "boolean") + return "serverAuth: boolean expected"; + if (message.clientAuth != null && message.hasOwnProperty("clientAuth")) + if (typeof message.clientAuth !== "boolean") + return "clientAuth: boolean expected"; + if (message.codeSigning != null && message.hasOwnProperty("codeSigning")) + if (typeof message.codeSigning !== "boolean") + return "codeSigning: boolean expected"; + if (message.emailProtection != null && message.hasOwnProperty("emailProtection")) + if (typeof message.emailProtection !== "boolean") + return "emailProtection: boolean expected"; + if (message.timeStamping != null && message.hasOwnProperty("timeStamping")) + if (typeof message.timeStamping !== "boolean") + return "timeStamping: boolean expected"; + if (message.ocspSigning != null && message.hasOwnProperty("ocspSigning")) + if (typeof message.ocspSigning !== "boolean") + return "ocspSigning: boolean expected"; + return null; + }; + + /** + * Creates an ExtendedKeyUsageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions + */ + ExtendedKeyUsageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions) + return object; + var message = new $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions(); + if (object.serverAuth != null) + message.serverAuth = Boolean(object.serverAuth); + if (object.clientAuth != null) + message.clientAuth = Boolean(object.clientAuth); + if (object.codeSigning != null) + message.codeSigning = Boolean(object.codeSigning); + if (object.emailProtection != null) + message.emailProtection = Boolean(object.emailProtection); + if (object.timeStamping != null) + message.timeStamping = Boolean(object.timeStamping); + if (object.ocspSigning != null) + message.ocspSigning = Boolean(object.ocspSigning); + return message; + }; + + /** + * Creates a plain object from an ExtendedKeyUsageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions} message ExtendedKeyUsageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtendedKeyUsageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serverAuth = false; + object.clientAuth = false; + object.codeSigning = false; + object.emailProtection = false; + object.timeStamping = false; + object.ocspSigning = false; + } + if (message.serverAuth != null && message.hasOwnProperty("serverAuth")) + object.serverAuth = message.serverAuth; + if (message.clientAuth != null && message.hasOwnProperty("clientAuth")) + object.clientAuth = message.clientAuth; + if (message.codeSigning != null && message.hasOwnProperty("codeSigning")) + object.codeSigning = message.codeSigning; + if (message.emailProtection != null && message.hasOwnProperty("emailProtection")) + object.emailProtection = message.emailProtection; + if (message.timeStamping != null && message.hasOwnProperty("timeStamping")) + object.timeStamping = message.timeStamping; + if (message.ocspSigning != null && message.hasOwnProperty("ocspSigning")) + object.ocspSigning = message.ocspSigning; + return object; + }; + + /** + * Converts this ExtendedKeyUsageOptions to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @instance + * @returns {Object.} JSON object + */ + ExtendedKeyUsageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtendedKeyUsageOptions + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtendedKeyUsageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions"; + }; + + return ExtendedKeyUsageOptions; + })(); + + return KeyUsage; + })(); + + v1.AttributeTypeAndValue = (function() { + + /** + * Properties of an AttributeTypeAndValue. + * @memberof google.cloud.security.privateca.v1 + * @interface IAttributeTypeAndValue + * @property {google.cloud.security.privateca.v1.AttributeType|null} [type] AttributeTypeAndValue type + * @property {google.cloud.security.privateca.v1.IObjectId|null} [objectId] AttributeTypeAndValue objectId + * @property {string|null} [value] AttributeTypeAndValue value + */ + + /** + * Constructs a new AttributeTypeAndValue. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an AttributeTypeAndValue. + * @implements IAttributeTypeAndValue + * @constructor + * @param {google.cloud.security.privateca.v1.IAttributeTypeAndValue=} [properties] Properties to set + */ + function AttributeTypeAndValue(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]]; + } + + /** + * AttributeTypeAndValue type. + * @member {google.cloud.security.privateca.v1.AttributeType|null|undefined} type + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @instance + */ + AttributeTypeAndValue.prototype.type = null; + + /** + * AttributeTypeAndValue objectId. + * @member {google.cloud.security.privateca.v1.IObjectId|null|undefined} objectId + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @instance + */ + AttributeTypeAndValue.prototype.objectId = null; + + /** + * AttributeTypeAndValue value. + * @member {string} value + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @instance + */ + AttributeTypeAndValue.prototype.value = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttributeTypeAndValue attributeType. + * @member {"type"|"objectId"|undefined} attributeType + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @instance + */ + Object.defineProperty(AttributeTypeAndValue.prototype, "attributeType", { + get: $util.oneOfGetter($oneOfFields = ["type", "objectId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttributeTypeAndValue instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @static + * @param {google.cloud.security.privateca.v1.IAttributeTypeAndValue=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.AttributeTypeAndValue} AttributeTypeAndValue instance + */ + AttributeTypeAndValue.create = function create(properties) { + return new AttributeTypeAndValue(properties); + }; + + /** + * Encodes the specified AttributeTypeAndValue message. Does not implicitly {@link google.cloud.security.privateca.v1.AttributeTypeAndValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @static + * @param {google.cloud.security.privateca.v1.IAttributeTypeAndValue} message AttributeTypeAndValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeTypeAndValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.objectId != null && Object.hasOwnProperty.call(message, "objectId")) + $root.google.cloud.security.privateca.v1.ObjectId.encode(message.objectId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.value); + return writer; + }; + + /** + * Encodes the specified AttributeTypeAndValue message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.AttributeTypeAndValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @static + * @param {google.cloud.security.privateca.v1.IAttributeTypeAndValue} message AttributeTypeAndValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeTypeAndValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttributeTypeAndValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.AttributeTypeAndValue} AttributeTypeAndValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeTypeAndValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.AttributeTypeAndValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.objectId = $root.google.cloud.security.privateca.v1.ObjectId.decode(reader, reader.uint32()); + break; + } + case 3: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttributeTypeAndValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.AttributeTypeAndValue} AttributeTypeAndValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeTypeAndValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttributeTypeAndValue message. + * @function verify + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttributeTypeAndValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) { + properties.attributeType = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message.objectId != null && message.hasOwnProperty("objectId")) { + if (properties.attributeType === 1) + return "attributeType: multiple values"; + properties.attributeType = 1; + { + var error = $root.google.cloud.security.privateca.v1.ObjectId.verify(message.objectId); + if (error) + return "objectId." + error; + } + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an AttributeTypeAndValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.AttributeTypeAndValue} AttributeTypeAndValue + */ + AttributeTypeAndValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.AttributeTypeAndValue) + return object; + var message = new $root.google.cloud.security.privateca.v1.AttributeTypeAndValue(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "ATTRIBUTE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "COMMON_NAME": + case 1: + message.type = 1; + break; + case "COUNTRY_CODE": + case 2: + message.type = 2; + break; + case "ORGANIZATION": + case 3: + message.type = 3; + break; + case "ORGANIZATIONAL_UNIT": + case 4: + message.type = 4; + break; + case "LOCALITY": + case 5: + message.type = 5; + break; + case "PROVINCE": + case 6: + message.type = 6; + break; + case "STREET_ADDRESS": + case 7: + message.type = 7; + break; + case "POSTAL_CODE": + case 8: + message.type = 8; + break; + } + if (object.objectId != null) { + if (typeof object.objectId !== "object") + throw TypeError(".google.cloud.security.privateca.v1.AttributeTypeAndValue.objectId: object expected"); + message.objectId = $root.google.cloud.security.privateca.v1.ObjectId.fromObject(object.objectId); + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an AttributeTypeAndValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @static + * @param {google.cloud.security.privateca.v1.AttributeTypeAndValue} message AttributeTypeAndValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttributeTypeAndValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.security.privateca.v1.AttributeType[message.type] === undefined ? message.type : $root.google.cloud.security.privateca.v1.AttributeType[message.type] : message.type; + if (options.oneofs) + object.attributeType = "type"; + } + if (message.objectId != null && message.hasOwnProperty("objectId")) { + object.objectId = $root.google.cloud.security.privateca.v1.ObjectId.toObject(message.objectId, options); + if (options.oneofs) + object.attributeType = "objectId"; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this AttributeTypeAndValue to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @instance + * @returns {Object.} JSON object + */ + AttributeTypeAndValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttributeTypeAndValue + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttributeTypeAndValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.AttributeTypeAndValue"; + }; + + return AttributeTypeAndValue; + })(); + + v1.RelativeDistinguishedName = (function() { + + /** + * Properties of a RelativeDistinguishedName. + * @memberof google.cloud.security.privateca.v1 + * @interface IRelativeDistinguishedName + * @property {Array.|null} [attributes] RelativeDistinguishedName attributes + */ + + /** + * Constructs a new RelativeDistinguishedName. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a RelativeDistinguishedName. + * @implements IRelativeDistinguishedName + * @constructor + * @param {google.cloud.security.privateca.v1.IRelativeDistinguishedName=} [properties] Properties to set + */ + function RelativeDistinguishedName(properties) { + this.attributes = []; + 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]]; + } + + /** + * RelativeDistinguishedName attributes. + * @member {Array.} attributes + * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName + * @instance + */ + RelativeDistinguishedName.prototype.attributes = $util.emptyArray; + + /** + * Creates a new RelativeDistinguishedName instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName + * @static + * @param {google.cloud.security.privateca.v1.IRelativeDistinguishedName=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.RelativeDistinguishedName} RelativeDistinguishedName instance + */ + RelativeDistinguishedName.create = function create(properties) { + return new RelativeDistinguishedName(properties); + }; + + /** + * Encodes the specified RelativeDistinguishedName message. Does not implicitly {@link google.cloud.security.privateca.v1.RelativeDistinguishedName.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName + * @static + * @param {google.cloud.security.privateca.v1.IRelativeDistinguishedName} message RelativeDistinguishedName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelativeDistinguishedName.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributes != null && message.attributes.length) + for (var i = 0; i < message.attributes.length; ++i) + $root.google.cloud.security.privateca.v1.AttributeTypeAndValue.encode(message.attributes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RelativeDistinguishedName message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.RelativeDistinguishedName.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName + * @static + * @param {google.cloud.security.privateca.v1.IRelativeDistinguishedName} message RelativeDistinguishedName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelativeDistinguishedName.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelativeDistinguishedName message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.RelativeDistinguishedName} RelativeDistinguishedName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelativeDistinguishedName.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.RelativeDistinguishedName(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.google.cloud.security.privateca.v1.AttributeTypeAndValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelativeDistinguishedName message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.RelativeDistinguishedName} RelativeDistinguishedName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelativeDistinguishedName.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelativeDistinguishedName message. + * @function verify + * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelativeDistinguishedName.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.AttributeTypeAndValue.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates a RelativeDistinguishedName message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.RelativeDistinguishedName} RelativeDistinguishedName + */ + RelativeDistinguishedName.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.RelativeDistinguishedName) + return object; + var message = new $root.google.cloud.security.privateca.v1.RelativeDistinguishedName(); + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".google.cloud.security.privateca.v1.RelativeDistinguishedName.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.RelativeDistinguishedName.attributes: object expected"); + message.attributes[i] = $root.google.cloud.security.privateca.v1.AttributeTypeAndValue.fromObject(object.attributes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RelativeDistinguishedName message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName + * @static + * @param {google.cloud.security.privateca.v1.RelativeDistinguishedName} message RelativeDistinguishedName + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelativeDistinguishedName.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attributes = []; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.google.cloud.security.privateca.v1.AttributeTypeAndValue.toObject(message.attributes[j], options); + } + return object; + }; + + /** + * Converts this RelativeDistinguishedName to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName + * @instance + * @returns {Object.} JSON object + */ + RelativeDistinguishedName.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RelativeDistinguishedName + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelativeDistinguishedName.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.RelativeDistinguishedName"; + }; + + return RelativeDistinguishedName; + })(); + + v1.Subject = (function() { + + /** + * Properties of a Subject. + * @memberof google.cloud.security.privateca.v1 + * @interface ISubject + * @property {string|null} [commonName] Subject commonName + * @property {string|null} [countryCode] Subject countryCode + * @property {string|null} [organization] Subject organization + * @property {string|null} [organizationalUnit] Subject organizationalUnit + * @property {string|null} [locality] Subject locality + * @property {string|null} [province] Subject province + * @property {string|null} [streetAddress] Subject streetAddress + * @property {string|null} [postalCode] Subject postalCode + * @property {Array.|null} [rdnSequence] Subject rdnSequence + */ + + /** + * Constructs a new Subject. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a Subject. + * @implements ISubject + * @constructor + * @param {google.cloud.security.privateca.v1.ISubject=} [properties] Properties to set + */ + function Subject(properties) { + this.rdnSequence = []; + 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]]; + } + + /** + * Subject commonName. + * @member {string} commonName + * @memberof google.cloud.security.privateca.v1.Subject + * @instance + */ + Subject.prototype.commonName = ""; + + /** + * Subject countryCode. + * @member {string} countryCode + * @memberof google.cloud.security.privateca.v1.Subject + * @instance + */ + Subject.prototype.countryCode = ""; + + /** + * Subject organization. + * @member {string} organization + * @memberof google.cloud.security.privateca.v1.Subject + * @instance + */ + Subject.prototype.organization = ""; + + /** + * Subject organizationalUnit. + * @member {string} organizationalUnit + * @memberof google.cloud.security.privateca.v1.Subject + * @instance + */ + Subject.prototype.organizationalUnit = ""; + + /** + * Subject locality. + * @member {string} locality + * @memberof google.cloud.security.privateca.v1.Subject + * @instance + */ + Subject.prototype.locality = ""; + + /** + * Subject province. + * @member {string} province + * @memberof google.cloud.security.privateca.v1.Subject + * @instance + */ + Subject.prototype.province = ""; + + /** + * Subject streetAddress. + * @member {string} streetAddress + * @memberof google.cloud.security.privateca.v1.Subject + * @instance + */ + Subject.prototype.streetAddress = ""; + + /** + * Subject postalCode. + * @member {string} postalCode + * @memberof google.cloud.security.privateca.v1.Subject + * @instance + */ + Subject.prototype.postalCode = ""; + + /** + * Subject rdnSequence. + * @member {Array.} rdnSequence + * @memberof google.cloud.security.privateca.v1.Subject + * @instance + */ + Subject.prototype.rdnSequence = $util.emptyArray; + + /** + * Creates a new Subject instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.Subject + * @static + * @param {google.cloud.security.privateca.v1.ISubject=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.Subject} Subject instance + */ + Subject.create = function create(properties) { + return new Subject(properties); + }; + + /** + * Encodes the specified Subject message. Does not implicitly {@link google.cloud.security.privateca.v1.Subject.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.Subject + * @static + * @param {google.cloud.security.privateca.v1.ISubject} message Subject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.commonName); + if (message.countryCode != null && Object.hasOwnProperty.call(message, "countryCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.countryCode); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.organization); + if (message.organizationalUnit != null && Object.hasOwnProperty.call(message, "organizationalUnit")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.organizationalUnit); + if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.locality); + if (message.province != null && Object.hasOwnProperty.call(message, "province")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.province); + if (message.streetAddress != null && Object.hasOwnProperty.call(message, "streetAddress")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.streetAddress); + if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.postalCode); + if (message.rdnSequence != null && message.rdnSequence.length) + for (var i = 0; i < message.rdnSequence.length; ++i) + $root.google.cloud.security.privateca.v1.RelativeDistinguishedName.encode(message.rdnSequence[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Subject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.Subject + * @static + * @param {google.cloud.security.privateca.v1.ISubject} message Subject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Subject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.Subject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.Subject} Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subject.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.Subject(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonName = reader.string(); + break; + } + case 2: { + message.countryCode = reader.string(); + break; + } + case 3: { + message.organization = reader.string(); + break; + } + case 4: { + message.organizationalUnit = reader.string(); + break; + } + case 5: { + message.locality = reader.string(); + break; + } + case 6: { + message.province = reader.string(); + break; + } + case 7: { + message.streetAddress = reader.string(); + break; + } + case 8: { + message.postalCode = reader.string(); + break; + } + case 9: { + if (!(message.rdnSequence && message.rdnSequence.length)) + message.rdnSequence = []; + message.rdnSequence.push($root.google.cloud.security.privateca.v1.RelativeDistinguishedName.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Subject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.Subject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.Subject} Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Subject message. + * @function verify + * @memberof google.cloud.security.privateca.v1.Subject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Subject.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonName != null && message.hasOwnProperty("commonName")) + if (!$util.isString(message.commonName)) + return "commonName: string expected"; + if (message.countryCode != null && message.hasOwnProperty("countryCode")) + if (!$util.isString(message.countryCode)) + return "countryCode: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) + if (!$util.isString(message.organizationalUnit)) + return "organizationalUnit: string expected"; + if (message.locality != null && message.hasOwnProperty("locality")) + if (!$util.isString(message.locality)) + return "locality: string expected"; + if (message.province != null && message.hasOwnProperty("province")) + if (!$util.isString(message.province)) + return "province: string expected"; + if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) + if (!$util.isString(message.streetAddress)) + return "streetAddress: string expected"; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + if (!$util.isString(message.postalCode)) + return "postalCode: string expected"; + if (message.rdnSequence != null && message.hasOwnProperty("rdnSequence")) { + if (!Array.isArray(message.rdnSequence)) + return "rdnSequence: array expected"; + for (var i = 0; i < message.rdnSequence.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.RelativeDistinguishedName.verify(message.rdnSequence[i]); + if (error) + return "rdnSequence." + error; + } + } + return null; + }; + + /** + * Creates a Subject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.Subject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.Subject} Subject + */ + Subject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.Subject) + return object; + var message = new $root.google.cloud.security.privateca.v1.Subject(); + if (object.commonName != null) + message.commonName = String(object.commonName); + if (object.countryCode != null) + message.countryCode = String(object.countryCode); + if (object.organization != null) + message.organization = String(object.organization); + if (object.organizationalUnit != null) + message.organizationalUnit = String(object.organizationalUnit); + if (object.locality != null) + message.locality = String(object.locality); + if (object.province != null) + message.province = String(object.province); + if (object.streetAddress != null) + message.streetAddress = String(object.streetAddress); + if (object.postalCode != null) + message.postalCode = String(object.postalCode); + if (object.rdnSequence) { + if (!Array.isArray(object.rdnSequence)) + throw TypeError(".google.cloud.security.privateca.v1.Subject.rdnSequence: array expected"); + message.rdnSequence = []; + for (var i = 0; i < object.rdnSequence.length; ++i) { + if (typeof object.rdnSequence[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.Subject.rdnSequence: object expected"); + message.rdnSequence[i] = $root.google.cloud.security.privateca.v1.RelativeDistinguishedName.fromObject(object.rdnSequence[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Subject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.Subject + * @static + * @param {google.cloud.security.privateca.v1.Subject} message Subject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Subject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rdnSequence = []; + if (options.defaults) { + object.commonName = ""; + object.countryCode = ""; + object.organization = ""; + object.organizationalUnit = ""; + object.locality = ""; + object.province = ""; + object.streetAddress = ""; + object.postalCode = ""; + } + if (message.commonName != null && message.hasOwnProperty("commonName")) + object.commonName = message.commonName; + if (message.countryCode != null && message.hasOwnProperty("countryCode")) + object.countryCode = message.countryCode; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) + object.organizationalUnit = message.organizationalUnit; + if (message.locality != null && message.hasOwnProperty("locality")) + object.locality = message.locality; + if (message.province != null && message.hasOwnProperty("province")) + object.province = message.province; + if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) + object.streetAddress = message.streetAddress; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + object.postalCode = message.postalCode; + if (message.rdnSequence && message.rdnSequence.length) { + object.rdnSequence = []; + for (var j = 0; j < message.rdnSequence.length; ++j) + object.rdnSequence[j] = $root.google.cloud.security.privateca.v1.RelativeDistinguishedName.toObject(message.rdnSequence[j], options); + } + return object; + }; + + /** + * Converts this Subject to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.Subject + * @instance + * @returns {Object.} JSON object + */ + Subject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Subject + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.Subject + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Subject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.Subject"; + }; + + return Subject; + })(); + + v1.SubjectAltNames = (function() { + + /** + * Properties of a SubjectAltNames. + * @memberof google.cloud.security.privateca.v1 + * @interface ISubjectAltNames + * @property {Array.|null} [dnsNames] SubjectAltNames dnsNames + * @property {Array.|null} [uris] SubjectAltNames uris + * @property {Array.|null} [emailAddresses] SubjectAltNames emailAddresses + * @property {Array.|null} [ipAddresses] SubjectAltNames ipAddresses + * @property {Array.|null} [customSans] SubjectAltNames customSans + */ + + /** + * Constructs a new SubjectAltNames. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a SubjectAltNames. + * @implements ISubjectAltNames + * @constructor + * @param {google.cloud.security.privateca.v1.ISubjectAltNames=} [properties] Properties to set + */ + function SubjectAltNames(properties) { + this.dnsNames = []; + this.uris = []; + this.emailAddresses = []; + this.ipAddresses = []; + this.customSans = []; + 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]]; + } + + /** + * SubjectAltNames dnsNames. + * @member {Array.} dnsNames + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @instance + */ + SubjectAltNames.prototype.dnsNames = $util.emptyArray; + + /** + * SubjectAltNames uris. + * @member {Array.} uris + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @instance + */ + SubjectAltNames.prototype.uris = $util.emptyArray; + + /** + * SubjectAltNames emailAddresses. + * @member {Array.} emailAddresses + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @instance + */ + SubjectAltNames.prototype.emailAddresses = $util.emptyArray; + + /** + * SubjectAltNames ipAddresses. + * @member {Array.} ipAddresses + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @instance + */ + SubjectAltNames.prototype.ipAddresses = $util.emptyArray; + + /** + * SubjectAltNames customSans. + * @member {Array.} customSans + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @instance + */ + SubjectAltNames.prototype.customSans = $util.emptyArray; + + /** + * Creates a new SubjectAltNames instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1.ISubjectAltNames=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.SubjectAltNames} SubjectAltNames instance + */ + SubjectAltNames.create = function create(properties) { + return new SubjectAltNames(properties); + }; + + /** + * Encodes the specified SubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1.SubjectAltNames.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1.ISubjectAltNames} message SubjectAltNames message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectAltNames.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dnsNames != null && message.dnsNames.length) + for (var i = 0; i < message.dnsNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dnsNames[i]); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uris[i]); + if (message.emailAddresses != null && message.emailAddresses.length) + for (var i = 0; i < message.emailAddresses.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.emailAddresses[i]); + if (message.ipAddresses != null && message.ipAddresses.length) + for (var i = 0; i < message.ipAddresses.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ipAddresses[i]); + if (message.customSans != null && message.customSans.length) + for (var i = 0; i < message.customSans.length; ++i) + $root.google.cloud.security.privateca.v1.X509Extension.encode(message.customSans[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubjectAltNames.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1.ISubjectAltNames} message SubjectAltNames message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectAltNames.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubjectAltNames message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.SubjectAltNames} SubjectAltNames + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectAltNames.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.SubjectAltNames(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dnsNames && message.dnsNames.length)) + message.dnsNames = []; + message.dnsNames.push(reader.string()); + break; + } + case 2: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } + case 3: { + if (!(message.emailAddresses && message.emailAddresses.length)) + message.emailAddresses = []; + message.emailAddresses.push(reader.string()); + break; + } + case 4: { + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(reader.string()); + break; + } + case 5: { + if (!(message.customSans && message.customSans.length)) + message.customSans = []; + message.customSans.push($root.google.cloud.security.privateca.v1.X509Extension.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubjectAltNames message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.SubjectAltNames} SubjectAltNames + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectAltNames.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubjectAltNames message. + * @function verify + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubjectAltNames.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { + if (!Array.isArray(message.dnsNames)) + return "dnsNames: array expected"; + for (var i = 0; i < message.dnsNames.length; ++i) + if (!$util.isString(message.dnsNames[i])) + return "dnsNames: string[] expected"; + } + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + if (message.emailAddresses != null && message.hasOwnProperty("emailAddresses")) { + if (!Array.isArray(message.emailAddresses)) + return "emailAddresses: array expected"; + for (var i = 0; i < message.emailAddresses.length; ++i) + if (!$util.isString(message.emailAddresses[i])) + return "emailAddresses: string[] expected"; + } + if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (!Array.isArray(message.ipAddresses)) + return "ipAddresses: array expected"; + for (var i = 0; i < message.ipAddresses.length; ++i) + if (!$util.isString(message.ipAddresses[i])) + return "ipAddresses: string[] expected"; + } + if (message.customSans != null && message.hasOwnProperty("customSans")) { + if (!Array.isArray(message.customSans)) + return "customSans: array expected"; + for (var i = 0; i < message.customSans.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.X509Extension.verify(message.customSans[i]); + if (error) + return "customSans." + error; + } + } + return null; + }; + + /** + * Creates a SubjectAltNames message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.SubjectAltNames} SubjectAltNames + */ + SubjectAltNames.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.SubjectAltNames) + return object; + var message = new $root.google.cloud.security.privateca.v1.SubjectAltNames(); + if (object.dnsNames) { + if (!Array.isArray(object.dnsNames)) + throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.dnsNames: array expected"); + message.dnsNames = []; + for (var i = 0; i < object.dnsNames.length; ++i) + message.dnsNames[i] = String(object.dnsNames[i]); + } + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + if (object.emailAddresses) { + if (!Array.isArray(object.emailAddresses)) + throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.emailAddresses: array expected"); + message.emailAddresses = []; + for (var i = 0; i < object.emailAddresses.length; ++i) + message.emailAddresses[i] = String(object.emailAddresses[i]); + } + if (object.ipAddresses) { + if (!Array.isArray(object.ipAddresses)) + throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.ipAddresses: array expected"); + message.ipAddresses = []; + for (var i = 0; i < object.ipAddresses.length; ++i) + message.ipAddresses[i] = String(object.ipAddresses[i]); + } + if (object.customSans) { + if (!Array.isArray(object.customSans)) + throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.customSans: array expected"); + message.customSans = []; + for (var i = 0; i < object.customSans.length; ++i) { + if (typeof object.customSans[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.customSans: object expected"); + message.customSans[i] = $root.google.cloud.security.privateca.v1.X509Extension.fromObject(object.customSans[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SubjectAltNames message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1.SubjectAltNames} message SubjectAltNames + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubjectAltNames.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dnsNames = []; + object.uris = []; + object.emailAddresses = []; + object.ipAddresses = []; + object.customSans = []; + } + if (message.dnsNames && message.dnsNames.length) { + object.dnsNames = []; + for (var j = 0; j < message.dnsNames.length; ++j) + object.dnsNames[j] = message.dnsNames[j]; + } + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + if (message.emailAddresses && message.emailAddresses.length) { + object.emailAddresses = []; + for (var j = 0; j < message.emailAddresses.length; ++j) + object.emailAddresses[j] = message.emailAddresses[j]; + } + if (message.ipAddresses && message.ipAddresses.length) { + object.ipAddresses = []; + for (var j = 0; j < message.ipAddresses.length; ++j) + object.ipAddresses[j] = message.ipAddresses[j]; + } + if (message.customSans && message.customSans.length) { + object.customSans = []; + for (var j = 0; j < message.customSans.length; ++j) + object.customSans[j] = $root.google.cloud.security.privateca.v1.X509Extension.toObject(message.customSans[j], options); + } + return object; + }; + + /** + * Converts this SubjectAltNames to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @instance + * @returns {Object.} JSON object + */ + SubjectAltNames.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubjectAltNames + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.SubjectAltNames + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubjectAltNames.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.SubjectAltNames"; + }; + + return SubjectAltNames; + })(); + + v1.CertificateIdentityConstraints = (function() { + + /** + * Properties of a CertificateIdentityConstraints. + * @memberof google.cloud.security.privateca.v1 + * @interface ICertificateIdentityConstraints + * @property {google.type.IExpr|null} [celExpression] CertificateIdentityConstraints celExpression + * @property {boolean|null} [allowSubjectPassthrough] CertificateIdentityConstraints allowSubjectPassthrough + * @property {boolean|null} [allowSubjectAltNamesPassthrough] CertificateIdentityConstraints allowSubjectAltNamesPassthrough + */ + + /** + * Constructs a new CertificateIdentityConstraints. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CertificateIdentityConstraints. + * @implements ICertificateIdentityConstraints + * @constructor + * @param {google.cloud.security.privateca.v1.ICertificateIdentityConstraints=} [properties] Properties to set + */ + function CertificateIdentityConstraints(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]]; + } + + /** + * CertificateIdentityConstraints celExpression. + * @member {google.type.IExpr|null|undefined} celExpression + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @instance + */ + CertificateIdentityConstraints.prototype.celExpression = null; + + /** + * CertificateIdentityConstraints allowSubjectPassthrough. + * @member {boolean|null|undefined} allowSubjectPassthrough + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @instance + */ + CertificateIdentityConstraints.prototype.allowSubjectPassthrough = null; + + /** + * CertificateIdentityConstraints allowSubjectAltNamesPassthrough. + * @member {boolean|null|undefined} allowSubjectAltNamesPassthrough + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @instance + */ + CertificateIdentityConstraints.prototype.allowSubjectAltNamesPassthrough = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CertificateIdentityConstraints.prototype, "_allowSubjectPassthrough", { + get: $util.oneOfGetter($oneOfFields = ["allowSubjectPassthrough"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CertificateIdentityConstraints.prototype, "_allowSubjectAltNamesPassthrough", { + get: $util.oneOfGetter($oneOfFields = ["allowSubjectAltNamesPassthrough"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CertificateIdentityConstraints instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @static + * @param {google.cloud.security.privateca.v1.ICertificateIdentityConstraints=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateIdentityConstraints} CertificateIdentityConstraints instance + */ + CertificateIdentityConstraints.create = function create(properties) { + return new CertificateIdentityConstraints(properties); + }; + + /** + * Encodes the specified CertificateIdentityConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @static + * @param {google.cloud.security.privateca.v1.ICertificateIdentityConstraints} message CertificateIdentityConstraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateIdentityConstraints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.celExpression != null && Object.hasOwnProperty.call(message, "celExpression")) + $root.google.type.Expr.encode(message.celExpression, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.allowSubjectPassthrough != null && Object.hasOwnProperty.call(message, "allowSubjectPassthrough")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowSubjectPassthrough); + if (message.allowSubjectAltNamesPassthrough != null && Object.hasOwnProperty.call(message, "allowSubjectAltNamesPassthrough")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowSubjectAltNamesPassthrough); + return writer; + }; + + /** + * Encodes the specified CertificateIdentityConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @static + * @param {google.cloud.security.privateca.v1.ICertificateIdentityConstraints} message CertificateIdentityConstraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateIdentityConstraints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateIdentityConstraints message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateIdentityConstraints} CertificateIdentityConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateIdentityConstraints.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.celExpression = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + case 2: { + message.allowSubjectPassthrough = reader.bool(); + break; + } + case 3: { + message.allowSubjectAltNamesPassthrough = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateIdentityConstraints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateIdentityConstraints} CertificateIdentityConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateIdentityConstraints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateIdentityConstraints message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateIdentityConstraints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.celExpression != null && message.hasOwnProperty("celExpression")) { + var error = $root.google.type.Expr.verify(message.celExpression); + if (error) + return "celExpression." + error; + } + if (message.allowSubjectPassthrough != null && message.hasOwnProperty("allowSubjectPassthrough")) { + properties._allowSubjectPassthrough = 1; + if (typeof message.allowSubjectPassthrough !== "boolean") + return "allowSubjectPassthrough: boolean expected"; + } + if (message.allowSubjectAltNamesPassthrough != null && message.hasOwnProperty("allowSubjectAltNamesPassthrough")) { + properties._allowSubjectAltNamesPassthrough = 1; + if (typeof message.allowSubjectAltNamesPassthrough !== "boolean") + return "allowSubjectAltNamesPassthrough: boolean expected"; + } + return null; + }; + + /** + * Creates a CertificateIdentityConstraints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateIdentityConstraints} CertificateIdentityConstraints + */ + CertificateIdentityConstraints.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints(); + if (object.celExpression != null) { + if (typeof object.celExpression !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateIdentityConstraints.celExpression: object expected"); + message.celExpression = $root.google.type.Expr.fromObject(object.celExpression); + } + if (object.allowSubjectPassthrough != null) + message.allowSubjectPassthrough = Boolean(object.allowSubjectPassthrough); + if (object.allowSubjectAltNamesPassthrough != null) + message.allowSubjectAltNamesPassthrough = Boolean(object.allowSubjectAltNamesPassthrough); + return message; + }; + + /** + * Creates a plain object from a CertificateIdentityConstraints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @static + * @param {google.cloud.security.privateca.v1.CertificateIdentityConstraints} message CertificateIdentityConstraints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateIdentityConstraints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.celExpression = null; + if (message.celExpression != null && message.hasOwnProperty("celExpression")) + object.celExpression = $root.google.type.Expr.toObject(message.celExpression, options); + if (message.allowSubjectPassthrough != null && message.hasOwnProperty("allowSubjectPassthrough")) { + object.allowSubjectPassthrough = message.allowSubjectPassthrough; + if (options.oneofs) + object._allowSubjectPassthrough = "allowSubjectPassthrough"; + } + if (message.allowSubjectAltNamesPassthrough != null && message.hasOwnProperty("allowSubjectAltNamesPassthrough")) { + object.allowSubjectAltNamesPassthrough = message.allowSubjectAltNamesPassthrough; + if (options.oneofs) + object._allowSubjectAltNamesPassthrough = "allowSubjectAltNamesPassthrough"; + } + return object; + }; + + /** + * Converts this CertificateIdentityConstraints to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @instance + * @returns {Object.} JSON object + */ + CertificateIdentityConstraints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateIdentityConstraints + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateIdentityConstraints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateIdentityConstraints"; + }; + + return CertificateIdentityConstraints; + })(); + + v1.CertificateExtensionConstraints = (function() { + + /** + * Properties of a CertificateExtensionConstraints. + * @memberof google.cloud.security.privateca.v1 + * @interface ICertificateExtensionConstraints + * @property {Array.|null} [knownExtensions] CertificateExtensionConstraints knownExtensions + * @property {Array.|null} [additionalExtensions] CertificateExtensionConstraints additionalExtensions + */ + + /** + * Constructs a new CertificateExtensionConstraints. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CertificateExtensionConstraints. + * @implements ICertificateExtensionConstraints + * @constructor + * @param {google.cloud.security.privateca.v1.ICertificateExtensionConstraints=} [properties] Properties to set + */ + function CertificateExtensionConstraints(properties) { + this.knownExtensions = []; + this.additionalExtensions = []; + 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]]; + } + + /** + * CertificateExtensionConstraints knownExtensions. + * @member {Array.} knownExtensions + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @instance + */ + CertificateExtensionConstraints.prototype.knownExtensions = $util.emptyArray; + + /** + * CertificateExtensionConstraints additionalExtensions. + * @member {Array.} additionalExtensions + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @instance + */ + CertificateExtensionConstraints.prototype.additionalExtensions = $util.emptyArray; + + /** + * Creates a new CertificateExtensionConstraints instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @static + * @param {google.cloud.security.privateca.v1.ICertificateExtensionConstraints=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CertificateExtensionConstraints} CertificateExtensionConstraints instance + */ + CertificateExtensionConstraints.create = function create(properties) { + return new CertificateExtensionConstraints(properties); + }; + + /** + * Encodes the specified CertificateExtensionConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @static + * @param {google.cloud.security.privateca.v1.ICertificateExtensionConstraints} message CertificateExtensionConstraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateExtensionConstraints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.knownExtensions != null && message.knownExtensions.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.knownExtensions.length; ++i) + writer.int32(message.knownExtensions[i]); + writer.ldelim(); + } + if (message.additionalExtensions != null && message.additionalExtensions.length) + for (var i = 0; i < message.additionalExtensions.length; ++i) + $root.google.cloud.security.privateca.v1.ObjectId.encode(message.additionalExtensions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CertificateExtensionConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @static + * @param {google.cloud.security.privateca.v1.ICertificateExtensionConstraints} message CertificateExtensionConstraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateExtensionConstraints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateExtensionConstraints message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CertificateExtensionConstraints} CertificateExtensionConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateExtensionConstraints.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.knownExtensions && message.knownExtensions.length)) + message.knownExtensions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.knownExtensions.push(reader.int32()); + } else + message.knownExtensions.push(reader.int32()); + break; + } + case 2: { + if (!(message.additionalExtensions && message.additionalExtensions.length)) + message.additionalExtensions = []; + message.additionalExtensions.push($root.google.cloud.security.privateca.v1.ObjectId.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateExtensionConstraints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CertificateExtensionConstraints} CertificateExtensionConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateExtensionConstraints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateExtensionConstraints message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateExtensionConstraints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.knownExtensions != null && message.hasOwnProperty("knownExtensions")) { + if (!Array.isArray(message.knownExtensions)) + return "knownExtensions: array expected"; + for (var i = 0; i < message.knownExtensions.length; ++i) + switch (message.knownExtensions[i]) { + default: + return "knownExtensions: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.additionalExtensions != null && message.hasOwnProperty("additionalExtensions")) { + if (!Array.isArray(message.additionalExtensions)) + return "additionalExtensions: array expected"; + for (var i = 0; i < message.additionalExtensions.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.ObjectId.verify(message.additionalExtensions[i]); + if (error) + return "additionalExtensions." + error; + } + } + return null; + }; + + /** + * Creates a CertificateExtensionConstraints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CertificateExtensionConstraints} CertificateExtensionConstraints + */ + CertificateExtensionConstraints.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints) + return object; + var message = new $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints(); + if (object.knownExtensions) { + if (!Array.isArray(object.knownExtensions)) + throw TypeError(".google.cloud.security.privateca.v1.CertificateExtensionConstraints.knownExtensions: array expected"); + message.knownExtensions = []; + for (var i = 0; i < object.knownExtensions.length; ++i) + switch (object.knownExtensions[i]) { + default: + if (typeof object.knownExtensions[i] === "number") { + message.knownExtensions[i] = object.knownExtensions[i]; + break; + } + case "KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED": + case 0: + message.knownExtensions[i] = 0; + break; + case "BASE_KEY_USAGE": + case 1: + message.knownExtensions[i] = 1; + break; + case "EXTENDED_KEY_USAGE": + case 2: + message.knownExtensions[i] = 2; + break; + case "CA_OPTIONS": + case 3: + message.knownExtensions[i] = 3; + break; + case "POLICY_IDS": + case 4: + message.knownExtensions[i] = 4; + break; + case "AIA_OCSP_SERVERS": + case 5: + message.knownExtensions[i] = 5; + break; + case "NAME_CONSTRAINTS": + case 6: + message.knownExtensions[i] = 6; + break; + } + } + if (object.additionalExtensions) { + if (!Array.isArray(object.additionalExtensions)) + throw TypeError(".google.cloud.security.privateca.v1.CertificateExtensionConstraints.additionalExtensions: array expected"); + message.additionalExtensions = []; + for (var i = 0; i < object.additionalExtensions.length; ++i) { + if (typeof object.additionalExtensions[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CertificateExtensionConstraints.additionalExtensions: object expected"); + message.additionalExtensions[i] = $root.google.cloud.security.privateca.v1.ObjectId.fromObject(object.additionalExtensions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CertificateExtensionConstraints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @static + * @param {google.cloud.security.privateca.v1.CertificateExtensionConstraints} message CertificateExtensionConstraints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateExtensionConstraints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.knownExtensions = []; + object.additionalExtensions = []; + } + if (message.knownExtensions && message.knownExtensions.length) { + object.knownExtensions = []; + for (var j = 0; j < message.knownExtensions.length; ++j) + object.knownExtensions[j] = options.enums === String ? $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension[message.knownExtensions[j]] === undefined ? message.knownExtensions[j] : $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension[message.knownExtensions[j]] : message.knownExtensions[j]; + } + if (message.additionalExtensions && message.additionalExtensions.length) { + object.additionalExtensions = []; + for (var j = 0; j < message.additionalExtensions.length; ++j) + object.additionalExtensions[j] = $root.google.cloud.security.privateca.v1.ObjectId.toObject(message.additionalExtensions[j], options); + } + return object; + }; + + /** + * Converts this CertificateExtensionConstraints to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @instance + * @returns {Object.} JSON object + */ + CertificateExtensionConstraints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateExtensionConstraints + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateExtensionConstraints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateExtensionConstraints"; + }; + + /** + * KnownCertificateExtension enum. + * @name google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension + * @enum {number} + * @property {number} KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED=0 KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED value + * @property {number} BASE_KEY_USAGE=1 BASE_KEY_USAGE value + * @property {number} EXTENDED_KEY_USAGE=2 EXTENDED_KEY_USAGE value + * @property {number} CA_OPTIONS=3 CA_OPTIONS value + * @property {number} POLICY_IDS=4 POLICY_IDS value + * @property {number} AIA_OCSP_SERVERS=5 AIA_OCSP_SERVERS value + * @property {number} NAME_CONSTRAINTS=6 NAME_CONSTRAINTS value + */ + CertificateExtensionConstraints.KnownCertificateExtension = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASE_KEY_USAGE"] = 1; + values[valuesById[2] = "EXTENDED_KEY_USAGE"] = 2; + values[valuesById[3] = "CA_OPTIONS"] = 3; + values[valuesById[4] = "POLICY_IDS"] = 4; + values[valuesById[5] = "AIA_OCSP_SERVERS"] = 5; + values[valuesById[6] = "NAME_CONSTRAINTS"] = 6; + return values; + })(); + + return CertificateExtensionConstraints; + })(); + + /** + * AttributeType enum. + * @name google.cloud.security.privateca.v1.AttributeType + * @enum {number} + * @property {number} ATTRIBUTE_TYPE_UNSPECIFIED=0 ATTRIBUTE_TYPE_UNSPECIFIED value + * @property {number} COMMON_NAME=1 COMMON_NAME value + * @property {number} COUNTRY_CODE=2 COUNTRY_CODE value + * @property {number} ORGANIZATION=3 ORGANIZATION value + * @property {number} ORGANIZATIONAL_UNIT=4 ORGANIZATIONAL_UNIT value + * @property {number} LOCALITY=5 LOCALITY value + * @property {number} PROVINCE=6 PROVINCE value + * @property {number} STREET_ADDRESS=7 STREET_ADDRESS value + * @property {number} POSTAL_CODE=8 POSTAL_CODE value + */ + v1.AttributeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTRIBUTE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMMON_NAME"] = 1; + values[valuesById[2] = "COUNTRY_CODE"] = 2; + values[valuesById[3] = "ORGANIZATION"] = 3; + values[valuesById[4] = "ORGANIZATIONAL_UNIT"] = 4; + values[valuesById[5] = "LOCALITY"] = 5; + values[valuesById[6] = "PROVINCE"] = 6; + values[valuesById[7] = "STREET_ADDRESS"] = 7; + values[valuesById[8] = "POSTAL_CODE"] = 8; + return values; + })(); + + /** + * RevocationReason enum. + * @name google.cloud.security.privateca.v1.RevocationReason + * @enum {number} + * @property {number} REVOCATION_REASON_UNSPECIFIED=0 REVOCATION_REASON_UNSPECIFIED value + * @property {number} KEY_COMPROMISE=1 KEY_COMPROMISE value + * @property {number} CERTIFICATE_AUTHORITY_COMPROMISE=2 CERTIFICATE_AUTHORITY_COMPROMISE value + * @property {number} AFFILIATION_CHANGED=3 AFFILIATION_CHANGED value + * @property {number} SUPERSEDED=4 SUPERSEDED value + * @property {number} CESSATION_OF_OPERATION=5 CESSATION_OF_OPERATION value + * @property {number} CERTIFICATE_HOLD=6 CERTIFICATE_HOLD value + * @property {number} PRIVILEGE_WITHDRAWN=7 PRIVILEGE_WITHDRAWN value + * @property {number} ATTRIBUTE_AUTHORITY_COMPROMISE=8 ATTRIBUTE_AUTHORITY_COMPROMISE value + */ + v1.RevocationReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REVOCATION_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "KEY_COMPROMISE"] = 1; + values[valuesById[2] = "CERTIFICATE_AUTHORITY_COMPROMISE"] = 2; + values[valuesById[3] = "AFFILIATION_CHANGED"] = 3; + values[valuesById[4] = "SUPERSEDED"] = 4; + values[valuesById[5] = "CESSATION_OF_OPERATION"] = 5; + values[valuesById[6] = "CERTIFICATE_HOLD"] = 6; + values[valuesById[7] = "PRIVILEGE_WITHDRAWN"] = 7; + values[valuesById[8] = "ATTRIBUTE_AUTHORITY_COMPROMISE"] = 8; + return values; + })(); + + /** + * SubjectRequestMode enum. + * @name google.cloud.security.privateca.v1.SubjectRequestMode + * @enum {number} + * @property {number} SUBJECT_REQUEST_MODE_UNSPECIFIED=0 SUBJECT_REQUEST_MODE_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} RDN_SEQUENCE=3 RDN_SEQUENCE value + * @property {number} REFLECTED_SPIFFE=2 REFLECTED_SPIFFE value + */ + v1.SubjectRequestMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SUBJECT_REQUEST_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[3] = "RDN_SEQUENCE"] = 3; + values[valuesById[2] = "REFLECTED_SPIFFE"] = 2; + return values; + })(); + + v1.CertificateAuthorityService = (function() { + + /** + * Constructs a new CertificateAuthorityService service. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CertificateAuthorityService + * @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 CertificateAuthorityService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CertificateAuthorityService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CertificateAuthorityService; + + /** + * Creates new CertificateAuthorityService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @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 {CertificateAuthorityService} RPC service. Useful where requests and/or responses are streamed. + */ + CertificateAuthorityService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificate}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef CreateCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.Certificate} [response] Certificate + */ + + /** + * Calls CreateCertificate. + * @function createCertificate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest} request CreateCertificateRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateCallback} callback Node-style callback called with the error, if any, and Certificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.createCertificate = function createCertificate(request, callback) { + return this.rpcCall(createCertificate, $root.google.cloud.security.privateca.v1.CreateCertificateRequest, $root.google.cloud.security.privateca.v1.Certificate, request, callback); + }, "name", { value: "CreateCertificate" }); + + /** + * Calls CreateCertificate. + * @function createCertificate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest} request CreateCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificate}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef GetCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.Certificate} [response] Certificate + */ + + /** + * Calls GetCertificate. + * @function getCertificate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IGetCertificateRequest} request GetCertificateRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateCallback} callback Node-style callback called with the error, if any, and Certificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.getCertificate = function getCertificate(request, callback) { + return this.rpcCall(getCertificate, $root.google.cloud.security.privateca.v1.GetCertificateRequest, $root.google.cloud.security.privateca.v1.Certificate, request, callback); + }, "name", { value: "GetCertificate" }); + + /** + * Calls GetCertificate. + * @function getCertificate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IGetCertificateRequest} request GetCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificates}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef ListCertificatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.ListCertificatesResponse} [response] ListCertificatesResponse + */ + + /** + * Calls ListCertificates. + * @function listCertificates + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IListCertificatesRequest} request ListCertificatesRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificatesCallback} callback Node-style callback called with the error, if any, and ListCertificatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.listCertificates = function listCertificates(request, callback) { + return this.rpcCall(listCertificates, $root.google.cloud.security.privateca.v1.ListCertificatesRequest, $root.google.cloud.security.privateca.v1.ListCertificatesResponse, request, callback); + }, "name", { value: "ListCertificates" }); + + /** + * Calls ListCertificates. + * @function listCertificates + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IListCertificatesRequest} request ListCertificatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|revokeCertificate}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef RevokeCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.Certificate} [response] Certificate + */ + + /** + * Calls RevokeCertificate. + * @function revokeCertificate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest} request RevokeCertificateRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificateCallback} callback Node-style callback called with the error, if any, and Certificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.revokeCertificate = function revokeCertificate(request, callback) { + return this.rpcCall(revokeCertificate, $root.google.cloud.security.privateca.v1.RevokeCertificateRequest, $root.google.cloud.security.privateca.v1.Certificate, request, callback); + }, "name", { value: "RevokeCertificate" }); + + /** + * Calls RevokeCertificate. + * @function revokeCertificate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest} request RevokeCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificate}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef UpdateCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.Certificate} [response] Certificate + */ + + /** + * Calls UpdateCertificate. + * @function updateCertificate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest} request UpdateCertificateRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateCallback} callback Node-style callback called with the error, if any, and Certificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.updateCertificate = function updateCertificate(request, callback) { + return this.rpcCall(updateCertificate, $root.google.cloud.security.privateca.v1.UpdateCertificateRequest, $root.google.cloud.security.privateca.v1.Certificate, request, callback); + }, "name", { value: "UpdateCertificate" }); + + /** + * Calls UpdateCertificate. + * @function updateCertificate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest} request UpdateCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|activateCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef ActivateCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ActivateCertificateAuthority. + * @function activateCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest} request ActivateCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.activateCertificateAuthority = function activateCertificateAuthority(request, callback) { + return this.rpcCall(activateCertificateAuthority, $root.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ActivateCertificateAuthority" }); + + /** + * Calls ActivateCertificateAuthority. + * @function activateCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest} request ActivateCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef CreateCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCertificateAuthority. + * @function createCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest} request CreateCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.createCertificateAuthority = function createCertificateAuthority(request, callback) { + return this.rpcCall(createCertificateAuthority, $root.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCertificateAuthority" }); + + /** + * Calls CreateCertificateAuthority. + * @function createCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest} request CreateCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|disableCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef DisableCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DisableCertificateAuthority. + * @function disableCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest} request DisableCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.disableCertificateAuthority = function disableCertificateAuthority(request, callback) { + return this.rpcCall(disableCertificateAuthority, $root.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DisableCertificateAuthority" }); + + /** + * Calls DisableCertificateAuthority. + * @function disableCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest} request DisableCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|enableCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef EnableCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls EnableCertificateAuthority. + * @function enableCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest} request EnableCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.enableCertificateAuthority = function enableCertificateAuthority(request, callback) { + return this.rpcCall(enableCertificateAuthority, $root.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "EnableCertificateAuthority" }); + + /** + * Calls EnableCertificateAuthority. + * @function enableCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest} request EnableCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|fetchCertificateAuthorityCsr}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef FetchCertificateAuthorityCsrCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} [response] FetchCertificateAuthorityCsrResponse + */ + + /** + * Calls FetchCertificateAuthorityCsr. + * @function fetchCertificateAuthorityCsr + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest} request FetchCertificateAuthorityCsrRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsrCallback} callback Node-style callback called with the error, if any, and FetchCertificateAuthorityCsrResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.fetchCertificateAuthorityCsr = function fetchCertificateAuthorityCsr(request, callback) { + return this.rpcCall(fetchCertificateAuthorityCsr, $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest, $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse, request, callback); + }, "name", { value: "FetchCertificateAuthorityCsr" }); + + /** + * Calls FetchCertificateAuthorityCsr. + * @function fetchCertificateAuthorityCsr + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest} request FetchCertificateAuthorityCsrRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef GetCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.CertificateAuthority} [response] CertificateAuthority + */ + + /** + * Calls GetCertificateAuthority. + * @function getCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest} request GetCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and CertificateAuthority + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.getCertificateAuthority = function getCertificateAuthority(request, callback) { + return this.rpcCall(getCertificateAuthority, $root.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest, $root.google.cloud.security.privateca.v1.CertificateAuthority, request, callback); + }, "name", { value: "GetCertificateAuthority" }); + + /** + * Calls GetCertificateAuthority. + * @function getCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest} request GetCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateAuthorities}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef ListCertificateAuthoritiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} [response] ListCertificateAuthoritiesResponse + */ + + /** + * Calls ListCertificateAuthorities. + * @function listCertificateAuthorities + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest} request ListCertificateAuthoritiesRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthoritiesCallback} callback Node-style callback called with the error, if any, and ListCertificateAuthoritiesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.listCertificateAuthorities = function listCertificateAuthorities(request, callback) { + return this.rpcCall(listCertificateAuthorities, $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest, $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse, request, callback); + }, "name", { value: "ListCertificateAuthorities" }); + + /** + * Calls ListCertificateAuthorities. + * @function listCertificateAuthorities + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest} request ListCertificateAuthoritiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|undeleteCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef UndeleteCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeleteCertificateAuthority. + * @function undeleteCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest} request UndeleteCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.undeleteCertificateAuthority = function undeleteCertificateAuthority(request, callback) { + return this.rpcCall(undeleteCertificateAuthority, $root.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeleteCertificateAuthority" }); + + /** + * Calls UndeleteCertificateAuthority. + * @function undeleteCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest} request UndeleteCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef DeleteCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCertificateAuthority. + * @function deleteCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest} request DeleteCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.deleteCertificateAuthority = function deleteCertificateAuthority(request, callback) { + return this.rpcCall(deleteCertificateAuthority, $root.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCertificateAuthority" }); + + /** + * Calls DeleteCertificateAuthority. + * @function deleteCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest} request DeleteCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef UpdateCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCertificateAuthority. + * @function updateCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest} request UpdateCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.updateCertificateAuthority = function updateCertificateAuthority(request, callback) { + return this.rpcCall(updateCertificateAuthority, $root.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCertificateAuthority" }); + + /** + * Calls UpdateCertificateAuthority. + * @function updateCertificateAuthority + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest} request UpdateCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCaPool}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef CreateCaPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCaPool. + * @function createCaPool + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest} request CreateCaPoolRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.createCaPool = function createCaPool(request, callback) { + return this.rpcCall(createCaPool, $root.google.cloud.security.privateca.v1.CreateCaPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCaPool" }); + + /** + * Calls CreateCaPool. + * @function createCaPool + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest} request CreateCaPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCaPool}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef UpdateCaPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCaPool. + * @function updateCaPool + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest} request UpdateCaPoolRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.updateCaPool = function updateCaPool(request, callback) { + return this.rpcCall(updateCaPool, $root.google.cloud.security.privateca.v1.UpdateCaPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCaPool" }); + + /** + * Calls UpdateCaPool. + * @function updateCaPool + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest} request UpdateCaPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCaPool}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef GetCaPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.CaPool} [response] CaPool + */ + + /** + * Calls GetCaPool. + * @function getCaPool + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest} request GetCaPoolRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPoolCallback} callback Node-style callback called with the error, if any, and CaPool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.getCaPool = function getCaPool(request, callback) { + return this.rpcCall(getCaPool, $root.google.cloud.security.privateca.v1.GetCaPoolRequest, $root.google.cloud.security.privateca.v1.CaPool, request, callback); + }, "name", { value: "GetCaPool" }); + + /** + * Calls GetCaPool. + * @function getCaPool + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest} request GetCaPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCaPools}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef ListCaPoolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.ListCaPoolsResponse} [response] ListCaPoolsResponse + */ + + /** + * Calls ListCaPools. + * @function listCaPools + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest} request ListCaPoolsRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPoolsCallback} callback Node-style callback called with the error, if any, and ListCaPoolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.listCaPools = function listCaPools(request, callback) { + return this.rpcCall(listCaPools, $root.google.cloud.security.privateca.v1.ListCaPoolsRequest, $root.google.cloud.security.privateca.v1.ListCaPoolsResponse, request, callback); + }, "name", { value: "ListCaPools" }); + + /** + * Calls ListCaPools. + * @function listCaPools + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest} request ListCaPoolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCaPool}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef DeleteCaPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCaPool. + * @function deleteCaPool + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest} request DeleteCaPoolRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.deleteCaPool = function deleteCaPool(request, callback) { + return this.rpcCall(deleteCaPool, $root.google.cloud.security.privateca.v1.DeleteCaPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCaPool" }); + + /** + * Calls DeleteCaPool. + * @function deleteCaPool + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest} request DeleteCaPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|fetchCaCerts}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef FetchCaCertsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse} [response] FetchCaCertsResponse + */ + + /** + * Calls FetchCaCerts. + * @function fetchCaCerts + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest} request FetchCaCertsRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCertsCallback} callback Node-style callback called with the error, if any, and FetchCaCertsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.fetchCaCerts = function fetchCaCerts(request, callback) { + return this.rpcCall(fetchCaCerts, $root.google.cloud.security.privateca.v1.FetchCaCertsRequest, $root.google.cloud.security.privateca.v1.FetchCaCertsResponse, request, callback); + }, "name", { value: "FetchCaCerts" }); + + /** + * Calls FetchCaCerts. + * @function fetchCaCerts + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest} request FetchCaCertsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateRevocationList}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef GetCertificateRevocationListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.CertificateRevocationList} [response] CertificateRevocationList + */ + + /** + * Calls GetCertificateRevocationList. + * @function getCertificateRevocationList + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest} request GetCertificateRevocationListRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationListCallback} callback Node-style callback called with the error, if any, and CertificateRevocationList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.getCertificateRevocationList = function getCertificateRevocationList(request, callback) { + return this.rpcCall(getCertificateRevocationList, $root.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest, $root.google.cloud.security.privateca.v1.CertificateRevocationList, request, callback); + }, "name", { value: "GetCertificateRevocationList" }); + + /** + * Calls GetCertificateRevocationList. + * @function getCertificateRevocationList + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest} request GetCertificateRevocationListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateRevocationLists}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef ListCertificateRevocationListsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} [response] ListCertificateRevocationListsResponse + */ + + /** + * Calls ListCertificateRevocationLists. + * @function listCertificateRevocationLists + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest} request ListCertificateRevocationListsRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationListsCallback} callback Node-style callback called with the error, if any, and ListCertificateRevocationListsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.listCertificateRevocationLists = function listCertificateRevocationLists(request, callback) { + return this.rpcCall(listCertificateRevocationLists, $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest, $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse, request, callback); + }, "name", { value: "ListCertificateRevocationLists" }); + + /** + * Calls ListCertificateRevocationLists. + * @function listCertificateRevocationLists + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest} request ListCertificateRevocationListsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateRevocationList}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef UpdateCertificateRevocationListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCertificateRevocationList. + * @function updateCertificateRevocationList + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest} request UpdateCertificateRevocationListRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationListCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.updateCertificateRevocationList = function updateCertificateRevocationList(request, callback) { + return this.rpcCall(updateCertificateRevocationList, $root.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCertificateRevocationList" }); + + /** + * Calls UpdateCertificateRevocationList. + * @function updateCertificateRevocationList + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest} request UpdateCertificateRevocationListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificateTemplate}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef CreateCertificateTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCertificateTemplate. + * @function createCertificateTemplate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest} request CreateCertificateTemplateRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.createCertificateTemplate = function createCertificateTemplate(request, callback) { + return this.rpcCall(createCertificateTemplate, $root.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCertificateTemplate" }); + + /** + * Calls CreateCertificateTemplate. + * @function createCertificateTemplate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest} request CreateCertificateTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCertificateTemplate}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef DeleteCertificateTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCertificateTemplate. + * @function deleteCertificateTemplate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest} request DeleteCertificateTemplateRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.deleteCertificateTemplate = function deleteCertificateTemplate(request, callback) { + return this.rpcCall(deleteCertificateTemplate, $root.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCertificateTemplate" }); + + /** + * Calls DeleteCertificateTemplate. + * @function deleteCertificateTemplate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest} request DeleteCertificateTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateTemplate}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef GetCertificateTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.CertificateTemplate} [response] CertificateTemplate + */ + + /** + * Calls GetCertificateTemplate. + * @function getCertificateTemplate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest} request GetCertificateTemplateRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplateCallback} callback Node-style callback called with the error, if any, and CertificateTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.getCertificateTemplate = function getCertificateTemplate(request, callback) { + return this.rpcCall(getCertificateTemplate, $root.google.cloud.security.privateca.v1.GetCertificateTemplateRequest, $root.google.cloud.security.privateca.v1.CertificateTemplate, request, callback); + }, "name", { value: "GetCertificateTemplate" }); + + /** + * Calls GetCertificateTemplate. + * @function getCertificateTemplate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest} request GetCertificateTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateTemplates}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef ListCertificateTemplatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} [response] ListCertificateTemplatesResponse + */ + + /** + * Calls ListCertificateTemplates. + * @function listCertificateTemplates + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest} request ListCertificateTemplatesRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplatesCallback} callback Node-style callback called with the error, if any, and ListCertificateTemplatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.listCertificateTemplates = function listCertificateTemplates(request, callback) { + return this.rpcCall(listCertificateTemplates, $root.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest, $root.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse, request, callback); + }, "name", { value: "ListCertificateTemplates" }); + + /** + * Calls ListCertificateTemplates. + * @function listCertificateTemplates + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest} request ListCertificateTemplatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateTemplate}. + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @typedef UpdateCertificateTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCertificateTemplate. + * @function updateCertificateTemplate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest} request UpdateCertificateTemplateRequest message or plain object + * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.updateCertificateTemplate = function updateCertificateTemplate(request, callback) { + return this.rpcCall(updateCertificateTemplate, $root.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCertificateTemplate" }); + + /** + * Calls UpdateCertificateTemplate. + * @function updateCertificateTemplate + * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest} request UpdateCertificateTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CertificateAuthorityService; + })(); + + v1.CreateCertificateRequest = (function() { + + /** + * Properties of a CreateCertificateRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface ICreateCertificateRequest + * @property {string|null} [parent] CreateCertificateRequest parent + * @property {string|null} [certificateId] CreateCertificateRequest certificateId + * @property {google.cloud.security.privateca.v1.ICertificate|null} [certificate] CreateCertificateRequest certificate + * @property {string|null} [requestId] CreateCertificateRequest requestId + * @property {boolean|null} [validateOnly] CreateCertificateRequest validateOnly + * @property {string|null} [issuingCertificateAuthorityId] CreateCertificateRequest issuingCertificateAuthorityId + */ + + /** + * Constructs a new CreateCertificateRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CreateCertificateRequest. + * @implements ICreateCertificateRequest + * @constructor + * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest=} [properties] Properties to set + */ + function CreateCertificateRequest(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]]; + } + + /** + * CreateCertificateRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.parent = ""; + + /** + * CreateCertificateRequest certificateId. + * @member {string} certificateId + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.certificateId = ""; + + /** + * CreateCertificateRequest certificate. + * @member {google.cloud.security.privateca.v1.ICertificate|null|undefined} certificate + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.certificate = null; + + /** + * CreateCertificateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.requestId = ""; + + /** + * CreateCertificateRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.validateOnly = false; + + /** + * CreateCertificateRequest issuingCertificateAuthorityId. + * @member {string} issuingCertificateAuthorityId + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.issuingCertificateAuthorityId = ""; + + /** + * Creates a new CreateCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CreateCertificateRequest} CreateCertificateRequest instance + */ + CreateCertificateRequest.create = function create(properties) { + return new CreateCertificateRequest(properties); + }; + + /** + * Encodes the specified CreateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest} message CreateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.certificateId != null && Object.hasOwnProperty.call(message, "certificateId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateId); + if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + $root.google.cloud.security.privateca.v1.Certificate.encode(message.certificate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.issuingCertificateAuthorityId != null && Object.hasOwnProperty.call(message, "issuingCertificateAuthorityId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.issuingCertificateAuthorityId); + return writer; + }; + + /** + * Encodes the specified CreateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest} message CreateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CreateCertificateRequest} CreateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CreateCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.certificateId = reader.string(); + break; + } + case 3: { + message.certificate = $root.google.cloud.security.privateca.v1.Certificate.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + case 6: { + message.issuingCertificateAuthorityId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CreateCertificateRequest} CreateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCertificateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCertificateRequest.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.certificateId != null && message.hasOwnProperty("certificateId")) + if (!$util.isString(message.certificateId)) + return "certificateId: string expected"; + if (message.certificate != null && message.hasOwnProperty("certificate")) { + var error = $root.google.cloud.security.privateca.v1.Certificate.verify(message.certificate); + if (error) + return "certificate." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.issuingCertificateAuthorityId != null && message.hasOwnProperty("issuingCertificateAuthorityId")) + if (!$util.isString(message.issuingCertificateAuthorityId)) + return "issuingCertificateAuthorityId: string expected"; + return null; + }; + + /** + * Creates a CreateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CreateCertificateRequest} CreateCertificateRequest + */ + CreateCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CreateCertificateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.CreateCertificateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.certificateId != null) + message.certificateId = String(object.certificateId); + if (object.certificate != null) { + if (typeof object.certificate !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CreateCertificateRequest.certificate: object expected"); + message.certificate = $root.google.cloud.security.privateca.v1.Certificate.fromObject(object.certificate); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.issuingCertificateAuthorityId != null) + message.issuingCertificateAuthorityId = String(object.issuingCertificateAuthorityId); + return message; + }; + + /** + * Creates a plain object from a CreateCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.CreateCertificateRequest} message CreateCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.certificateId = ""; + object.certificate = null; + object.requestId = ""; + object.validateOnly = false; + object.issuingCertificateAuthorityId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.certificateId != null && message.hasOwnProperty("certificateId")) + object.certificateId = message.certificateId; + if (message.certificate != null && message.hasOwnProperty("certificate")) + object.certificate = $root.google.cloud.security.privateca.v1.Certificate.toObject(message.certificate, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.issuingCertificateAuthorityId != null && message.hasOwnProperty("issuingCertificateAuthorityId")) + object.issuingCertificateAuthorityId = message.issuingCertificateAuthorityId; + return object; + }; + + /** + * Converts this CreateCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CreateCertificateRequest"; + }; + + return CreateCertificateRequest; + })(); + + v1.GetCertificateRequest = (function() { + + /** + * Properties of a GetCertificateRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IGetCertificateRequest + * @property {string|null} [name] GetCertificateRequest name + */ + + /** + * Constructs a new GetCertificateRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a GetCertificateRequest. + * @implements IGetCertificateRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IGetCertificateRequest=} [properties] Properties to set + */ + function GetCertificateRequest(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]]; + } + + /** + * GetCertificateRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.GetCertificateRequest + * @instance + */ + GetCertificateRequest.prototype.name = ""; + + /** + * Creates a new GetCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.GetCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.GetCertificateRequest} GetCertificateRequest instance + */ + GetCertificateRequest.create = function create(properties) { + return new GetCertificateRequest(properties); + }; + + /** + * Encodes the specified GetCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.GetCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateRequest} message GetCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.GetCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateRequest} message GetCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.GetCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.GetCertificateRequest} GetCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.GetCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.GetCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.GetCertificateRequest} GetCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCertificateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.GetCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCertificateRequest.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 GetCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.GetCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.GetCertificateRequest} GetCertificateRequest + */ + GetCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.GetCertificateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.GetCertificateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.GetCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.GetCertificateRequest} message GetCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCertificateRequest.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 GetCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.GetCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + GetCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.GetCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.GetCertificateRequest"; + }; + + return GetCertificateRequest; + })(); + + v1.ListCertificatesRequest = (function() { + + /** + * Properties of a ListCertificatesRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IListCertificatesRequest + * @property {string|null} [parent] ListCertificatesRequest parent + * @property {number|null} [pageSize] ListCertificatesRequest pageSize + * @property {string|null} [pageToken] ListCertificatesRequest pageToken + * @property {string|null} [filter] ListCertificatesRequest filter + * @property {string|null} [orderBy] ListCertificatesRequest orderBy + */ + + /** + * Constructs a new ListCertificatesRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a ListCertificatesRequest. + * @implements IListCertificatesRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IListCertificatesRequest=} [properties] Properties to set + */ + function ListCertificatesRequest(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]]; + } + + /** + * ListCertificatesRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.parent = ""; + + /** + * ListCertificatesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.pageSize = 0; + + /** + * ListCertificatesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.pageToken = ""; + + /** + * ListCertificatesRequest filter. + * @member {string} filter + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.filter = ""; + + /** + * ListCertificatesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCertificatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificatesRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ListCertificatesRequest} ListCertificatesRequest instance + */ + ListCertificatesRequest.create = function create(properties) { + return new ListCertificatesRequest(properties); + }; + + /** + * Encodes the specified ListCertificatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificatesRequest} message ListCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificatesRequest} message ListCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ListCertificatesRequest} ListCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListCertificatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ListCertificatesRequest} ListCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificatesRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificatesRequest.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 ListCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ListCertificatesRequest} ListCertificatesRequest + */ + ListCertificatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificatesRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.ListCertificatesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCertificatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @static + * @param {google.cloud.security.privateca.v1.ListCertificatesRequest} message ListCertificatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCertificatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCertificatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificatesRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificatesRequest"; + }; + + return ListCertificatesRequest; + })(); + + v1.ListCertificatesResponse = (function() { + + /** + * Properties of a ListCertificatesResponse. + * @memberof google.cloud.security.privateca.v1 + * @interface IListCertificatesResponse + * @property {Array.|null} [certificates] ListCertificatesResponse certificates + * @property {string|null} [nextPageToken] ListCertificatesResponse nextPageToken + * @property {Array.|null} [unreachable] ListCertificatesResponse unreachable + */ + + /** + * Constructs a new ListCertificatesResponse. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a ListCertificatesResponse. + * @implements IListCertificatesResponse + * @constructor + * @param {google.cloud.security.privateca.v1.IListCertificatesResponse=} [properties] Properties to set + */ + function ListCertificatesResponse(properties) { + this.certificates = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCertificatesResponse certificates. + * @member {Array.} certificates + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @instance + */ + ListCertificatesResponse.prototype.certificates = $util.emptyArray; + + /** + * ListCertificatesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @instance + */ + ListCertificatesResponse.prototype.nextPageToken = ""; + + /** + * ListCertificatesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @instance + */ + ListCertificatesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCertificatesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificatesResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ListCertificatesResponse} ListCertificatesResponse instance + */ + ListCertificatesResponse.create = function create(properties) { + return new ListCertificatesResponse(properties); + }; + + /** + * Encodes the specified ListCertificatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificatesResponse} message ListCertificatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificates != null && message.certificates.length) + for (var i = 0; i < message.certificates.length; ++i) + $root.google.cloud.security.privateca.v1.Certificate.encode(message.certificates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCertificatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificatesResponse} message ListCertificatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ListCertificatesResponse} ListCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.certificates && message.certificates.length)) + message.certificates = []; + message.certificates.push($root.google.cloud.security.privateca.v1.Certificate.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ListCertificatesResponse} ListCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificatesResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificates != null && message.hasOwnProperty("certificates")) { + if (!Array.isArray(message.certificates)) + return "certificates: array expected"; + for (var i = 0; i < message.certificates.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.Certificate.verify(message.certificates[i]); + if (error) + return "certificates." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCertificatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ListCertificatesResponse} ListCertificatesResponse + */ + ListCertificatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificatesResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1.ListCertificatesResponse(); + if (object.certificates) { + if (!Array.isArray(object.certificates)) + throw TypeError(".google.cloud.security.privateca.v1.ListCertificatesResponse.certificates: array expected"); + message.certificates = []; + for (var i = 0; i < object.certificates.length; ++i) { + if (typeof object.certificates[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.ListCertificatesResponse.certificates: object expected"); + message.certificates[i] = $root.google.cloud.security.privateca.v1.Certificate.fromObject(object.certificates[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.security.privateca.v1.ListCertificatesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCertificatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @static + * @param {google.cloud.security.privateca.v1.ListCertificatesResponse} message ListCertificatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.certificates = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.certificates && message.certificates.length) { + object.certificates = []; + for (var j = 0; j < message.certificates.length; ++j) + object.certificates[j] = $root.google.cloud.security.privateca.v1.Certificate.toObject(message.certificates[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCertificatesResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCertificatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificatesResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificatesResponse"; + }; + + return ListCertificatesResponse; + })(); + + v1.RevokeCertificateRequest = (function() { + + /** + * Properties of a RevokeCertificateRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IRevokeCertificateRequest + * @property {string|null} [name] RevokeCertificateRequest name + * @property {google.cloud.security.privateca.v1.RevocationReason|null} [reason] RevokeCertificateRequest reason + * @property {string|null} [requestId] RevokeCertificateRequest requestId + */ + + /** + * Constructs a new RevokeCertificateRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a RevokeCertificateRequest. + * @implements IRevokeCertificateRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest=} [properties] Properties to set + */ + function RevokeCertificateRequest(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]]; + } + + /** + * RevokeCertificateRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @instance + */ + RevokeCertificateRequest.prototype.name = ""; + + /** + * RevokeCertificateRequest reason. + * @member {google.cloud.security.privateca.v1.RevocationReason} reason + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @instance + */ + RevokeCertificateRequest.prototype.reason = 0; + + /** + * RevokeCertificateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @instance + */ + RevokeCertificateRequest.prototype.requestId = ""; + + /** + * Creates a new RevokeCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.RevokeCertificateRequest} RevokeCertificateRequest instance + */ + RevokeCertificateRequest.create = function create(properties) { + return new RevokeCertificateRequest(properties); + }; + + /** + * Encodes the specified RevokeCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.RevokeCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest} message RevokeCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevokeCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified RevokeCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.RevokeCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest} message RevokeCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevokeCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RevokeCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.RevokeCertificateRequest} RevokeCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevokeCertificateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.RevokeCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.reason = reader.int32(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RevokeCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.RevokeCertificateRequest} RevokeCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevokeCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RevokeCertificateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RevokeCertificateRequest.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.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a RevokeCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.RevokeCertificateRequest} RevokeCertificateRequest + */ + RevokeCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.RevokeCertificateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.RevokeCertificateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "REVOCATION_REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "KEY_COMPROMISE": + case 1: + message.reason = 1; + break; + case "CERTIFICATE_AUTHORITY_COMPROMISE": + case 2: + message.reason = 2; + break; + case "AFFILIATION_CHANGED": + case 3: + message.reason = 3; + break; + case "SUPERSEDED": + case 4: + message.reason = 4; + break; + case "CESSATION_OF_OPERATION": + case 5: + message.reason = 5; + break; + case "CERTIFICATE_HOLD": + case 6: + message.reason = 6; + break; + case "PRIVILEGE_WITHDRAWN": + case 7: + message.reason = 7; + break; + case "ATTRIBUTE_AUTHORITY_COMPROMISE": + case 8: + message.reason = 8; + break; + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a RevokeCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.RevokeCertificateRequest} message RevokeCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RevokeCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.reason = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.cloud.security.privateca.v1.RevocationReason[message.reason] === undefined ? message.reason : $root.google.cloud.security.privateca.v1.RevocationReason[message.reason] : message.reason; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this RevokeCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + RevokeCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RevokeCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RevokeCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.RevokeCertificateRequest"; + }; + + return RevokeCertificateRequest; + })(); + + v1.UpdateCertificateRequest = (function() { + + /** + * Properties of an UpdateCertificateRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IUpdateCertificateRequest + * @property {google.cloud.security.privateca.v1.ICertificate|null} [certificate] UpdateCertificateRequest certificate + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateRequest updateMask + * @property {string|null} [requestId] UpdateCertificateRequest requestId + */ + + /** + * Constructs a new UpdateCertificateRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an UpdateCertificateRequest. + * @implements IUpdateCertificateRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest=} [properties] Properties to set + */ + function UpdateCertificateRequest(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]]; + } + + /** + * UpdateCertificateRequest certificate. + * @member {google.cloud.security.privateca.v1.ICertificate|null|undefined} certificate + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @instance + */ + UpdateCertificateRequest.prototype.certificate = null; + + /** + * UpdateCertificateRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @instance + */ + UpdateCertificateRequest.prototype.updateMask = null; + + /** + * UpdateCertificateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @instance + */ + UpdateCertificateRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.UpdateCertificateRequest} UpdateCertificateRequest instance + */ + UpdateCertificateRequest.create = function create(properties) { + return new UpdateCertificateRequest(properties); + }; + + /** + * Encodes the specified UpdateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest} message UpdateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + $root.google.cloud.security.privateca.v1.Certificate.encode(message.certificate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest} message UpdateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.UpdateCertificateRequest} UpdateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UpdateCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.certificate = $root.google.cloud.security.privateca.v1.Certificate.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.UpdateCertificateRequest} UpdateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCertificateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificate != null && message.hasOwnProperty("certificate")) { + var error = $root.google.cloud.security.privateca.v1.Certificate.verify(message.certificate); + if (error) + return "certificate." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.UpdateCertificateRequest} UpdateCertificateRequest + */ + UpdateCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.UpdateCertificateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.UpdateCertificateRequest(); + if (object.certificate != null) { + if (typeof object.certificate !== "object") + throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateRequest.certificate: object expected"); + message.certificate = $root.google.cloud.security.privateca.v1.Certificate.fromObject(object.certificate); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1.UpdateCertificateRequest} message UpdateCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificate = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.certificate != null && message.hasOwnProperty("certificate")) + object.certificate = $root.google.cloud.security.privateca.v1.Certificate.toObject(message.certificate, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.UpdateCertificateRequest"; + }; + + return UpdateCertificateRequest; + })(); + + v1.ActivateCertificateAuthorityRequest = (function() { + + /** + * Properties of an ActivateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IActivateCertificateAuthorityRequest + * @property {string|null} [name] ActivateCertificateAuthorityRequest name + * @property {string|null} [pemCaCertificate] ActivateCertificateAuthorityRequest pemCaCertificate + * @property {google.cloud.security.privateca.v1.ISubordinateConfig|null} [subordinateConfig] ActivateCertificateAuthorityRequest subordinateConfig + * @property {string|null} [requestId] ActivateCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new ActivateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an ActivateCertificateAuthorityRequest. + * @implements IActivateCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest=} [properties] Properties to set + */ + function ActivateCertificateAuthorityRequest(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]]; + } + + /** + * ActivateCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @instance + */ + ActivateCertificateAuthorityRequest.prototype.name = ""; + + /** + * ActivateCertificateAuthorityRequest pemCaCertificate. + * @member {string} pemCaCertificate + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @instance + */ + ActivateCertificateAuthorityRequest.prototype.pemCaCertificate = ""; + + /** + * ActivateCertificateAuthorityRequest subordinateConfig. + * @member {google.cloud.security.privateca.v1.ISubordinateConfig|null|undefined} subordinateConfig + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @instance + */ + ActivateCertificateAuthorityRequest.prototype.subordinateConfig = null; + + /** + * ActivateCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @instance + */ + ActivateCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new ActivateCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest instance + */ + ActivateCertificateAuthorityRequest.create = function create(properties) { + return new ActivateCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified ActivateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivateCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pemCaCertificate != null && Object.hasOwnProperty.call(message, "pemCaCertificate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCaCertificate); + if (message.subordinateConfig != null && Object.hasOwnProperty.call(message, "subordinateConfig")) + $root.google.cloud.security.privateca.v1.SubordinateConfig.encode(message.subordinateConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ActivateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivateCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pemCaCertificate = reader.string(); + break; + } + case 3: { + message.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActivateCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActivateCertificateAuthorityRequest.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.pemCaCertificate != null && message.hasOwnProperty("pemCaCertificate")) + if (!$util.isString(message.pemCaCertificate)) + return "pemCaCertificate: string expected"; + if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) { + var error = $root.google.cloud.security.privateca.v1.SubordinateConfig.verify(message.subordinateConfig); + if (error) + return "subordinateConfig." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an ActivateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest + */ + ActivateCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.pemCaCertificate != null) + message.pemCaCertificate = String(object.pemCaCertificate); + if (object.subordinateConfig != null) { + if (typeof object.subordinateConfig !== "object") + throw TypeError(".google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest.subordinateConfig: object expected"); + message.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.fromObject(object.subordinateConfig); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an ActivateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActivateCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pemCaCertificate = ""; + object.subordinateConfig = null; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pemCaCertificate != null && message.hasOwnProperty("pemCaCertificate")) + object.pemCaCertificate = message.pemCaCertificate; + if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) + object.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.toObject(message.subordinateConfig, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ActivateCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + ActivateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActivateCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActivateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest"; + }; + + return ActivateCertificateAuthorityRequest; + })(); + + v1.CreateCertificateAuthorityRequest = (function() { + + /** + * Properties of a CreateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface ICreateCertificateAuthorityRequest + * @property {string|null} [parent] CreateCertificateAuthorityRequest parent + * @property {string|null} [certificateAuthorityId] CreateCertificateAuthorityRequest certificateAuthorityId + * @property {google.cloud.security.privateca.v1.ICertificateAuthority|null} [certificateAuthority] CreateCertificateAuthorityRequest certificateAuthority + * @property {string|null} [requestId] CreateCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new CreateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CreateCertificateAuthorityRequest. + * @implements ICreateCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest=} [properties] Properties to set + */ + function CreateCertificateAuthorityRequest(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]]; + } + + /** + * CreateCertificateAuthorityRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @instance + */ + CreateCertificateAuthorityRequest.prototype.parent = ""; + + /** + * CreateCertificateAuthorityRequest certificateAuthorityId. + * @member {string} certificateAuthorityId + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @instance + */ + CreateCertificateAuthorityRequest.prototype.certificateAuthorityId = ""; + + /** + * CreateCertificateAuthorityRequest certificateAuthority. + * @member {google.cloud.security.privateca.v1.ICertificateAuthority|null|undefined} certificateAuthority + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @instance + */ + CreateCertificateAuthorityRequest.prototype.certificateAuthority = null; + + /** + * CreateCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @instance + */ + CreateCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new CreateCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest instance + */ + CreateCertificateAuthorityRequest.create = function create(properties) { + return new CreateCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified CreateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.certificateAuthorityId != null && Object.hasOwnProperty.call(message, "certificateAuthorityId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateAuthorityId); + if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) + $root.google.cloud.security.privateca.v1.CertificateAuthority.encode(message.certificateAuthority, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.certificateAuthorityId = reader.string(); + break; + } + case 3: { + message.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCertificateAuthorityRequest.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.certificateAuthorityId != null && message.hasOwnProperty("certificateAuthorityId")) + if (!$util.isString(message.certificateAuthorityId)) + return "certificateAuthorityId: string expected"; + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { + var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.verify(message.certificateAuthority); + if (error) + return "certificateAuthority." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest + */ + CreateCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.certificateAuthorityId != null) + message.certificateAuthorityId = String(object.certificateAuthorityId); + if (object.certificateAuthority != null) { + if (typeof object.certificateAuthority !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest.certificateAuthority: object expected"); + message.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.fromObject(object.certificateAuthority); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.certificateAuthorityId = ""; + object.certificateAuthority = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.certificateAuthorityId != null && message.hasOwnProperty("certificateAuthorityId")) + object.certificateAuthorityId = message.certificateAuthorityId; + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) + object.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.toObject(message.certificateAuthority, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest"; + }; + + return CreateCertificateAuthorityRequest; + })(); + + v1.DisableCertificateAuthorityRequest = (function() { + + /** + * Properties of a DisableCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IDisableCertificateAuthorityRequest + * @property {string|null} [name] DisableCertificateAuthorityRequest name + * @property {string|null} [requestId] DisableCertificateAuthorityRequest requestId + * @property {boolean|null} [ignoreDependentResources] DisableCertificateAuthorityRequest ignoreDependentResources + */ + + /** + * Constructs a new DisableCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a DisableCertificateAuthorityRequest. + * @implements IDisableCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest=} [properties] Properties to set + */ + function DisableCertificateAuthorityRequest(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]]; + } + + /** + * DisableCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @instance + */ + DisableCertificateAuthorityRequest.prototype.name = ""; + + /** + * DisableCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @instance + */ + DisableCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * DisableCertificateAuthorityRequest ignoreDependentResources. + * @member {boolean} ignoreDependentResources + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @instance + */ + DisableCertificateAuthorityRequest.prototype.ignoreDependentResources = false; + + /** + * Creates a new DisableCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest instance + */ + DisableCertificateAuthorityRequest.create = function create(properties) { + return new DisableCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified DisableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.ignoreDependentResources != null && Object.hasOwnProperty.call(message, "ignoreDependentResources")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreDependentResources); + return writer; + }; + + /** + * Encodes the specified DisableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.ignoreDependentResources = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableCertificateAuthorityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + if (typeof message.ignoreDependentResources !== "boolean") + return "ignoreDependentResources: boolean expected"; + return null; + }; + + /** + * Creates a DisableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest + */ + DisableCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.ignoreDependentResources != null) + message.ignoreDependentResources = Boolean(object.ignoreDependentResources); + return message; + }; + + /** + * Creates a plain object from a DisableCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.ignoreDependentResources = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + object.ignoreDependentResources = message.ignoreDependentResources; + return object; + }; + + /** + * Converts this DisableCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + DisableCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest"; + }; + + return DisableCertificateAuthorityRequest; + })(); + + v1.EnableCertificateAuthorityRequest = (function() { + + /** + * Properties of an EnableCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IEnableCertificateAuthorityRequest + * @property {string|null} [name] EnableCertificateAuthorityRequest name + * @property {string|null} [requestId] EnableCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new EnableCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an EnableCertificateAuthorityRequest. + * @implements IEnableCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest=} [properties] Properties to set + */ + function EnableCertificateAuthorityRequest(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]]; + } + + /** + * EnableCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @instance + */ + EnableCertificateAuthorityRequest.prototype.name = ""; + + /** + * EnableCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @instance + */ + EnableCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new EnableCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest instance + */ + EnableCertificateAuthorityRequest.create = function create(properties) { + return new EnableCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified EnableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified EnableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableCertificateAuthorityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an EnableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest + */ + EnableCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an EnableCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this EnableCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + EnableCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnableCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnableCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest"; + }; + + return EnableCertificateAuthorityRequest; + })(); + + v1.FetchCertificateAuthorityCsrRequest = (function() { + + /** + * Properties of a FetchCertificateAuthorityCsrRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IFetchCertificateAuthorityCsrRequest + * @property {string|null} [name] FetchCertificateAuthorityCsrRequest name + */ + + /** + * Constructs a new FetchCertificateAuthorityCsrRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a FetchCertificateAuthorityCsrRequest. + * @implements IFetchCertificateAuthorityCsrRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest=} [properties] Properties to set + */ + function FetchCertificateAuthorityCsrRequest(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]]; + } + + /** + * FetchCertificateAuthorityCsrRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest + * @instance + */ + FetchCertificateAuthorityCsrRequest.prototype.name = ""; + + /** + * Creates a new FetchCertificateAuthorityCsrRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest + * @static + * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest instance + */ + FetchCertificateAuthorityCsrRequest.create = function create(properties) { + return new FetchCertificateAuthorityCsrRequest(properties); + }; + + /** + * Encodes the specified FetchCertificateAuthorityCsrRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest + * @static + * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCertificateAuthorityCsrRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified FetchCertificateAuthorityCsrRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest + * @static + * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCertificateAuthorityCsrRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCertificateAuthorityCsrRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCertificateAuthorityCsrRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchCertificateAuthorityCsrRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchCertificateAuthorityCsrRequest.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 FetchCertificateAuthorityCsrRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest + */ + FetchCertificateAuthorityCsrRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a FetchCertificateAuthorityCsrRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest + * @static + * @param {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchCertificateAuthorityCsrRequest.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 FetchCertificateAuthorityCsrRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest + * @instance + * @returns {Object.} JSON object + */ + FetchCertificateAuthorityCsrRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchCertificateAuthorityCsrRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchCertificateAuthorityCsrRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest"; + }; + + return FetchCertificateAuthorityCsrRequest; + })(); + + v1.FetchCertificateAuthorityCsrResponse = (function() { + + /** + * Properties of a FetchCertificateAuthorityCsrResponse. + * @memberof google.cloud.security.privateca.v1 + * @interface IFetchCertificateAuthorityCsrResponse + * @property {string|null} [pemCsr] FetchCertificateAuthorityCsrResponse pemCsr + */ + + /** + * Constructs a new FetchCertificateAuthorityCsrResponse. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a FetchCertificateAuthorityCsrResponse. + * @implements IFetchCertificateAuthorityCsrResponse + * @constructor + * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse=} [properties] Properties to set + */ + function FetchCertificateAuthorityCsrResponse(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]]; + } + + /** + * FetchCertificateAuthorityCsrResponse pemCsr. + * @member {string} pemCsr + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse + * @instance + */ + FetchCertificateAuthorityCsrResponse.prototype.pemCsr = ""; + + /** + * Creates a new FetchCertificateAuthorityCsrResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse + * @static + * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse instance + */ + FetchCertificateAuthorityCsrResponse.create = function create(properties) { + return new FetchCertificateAuthorityCsrResponse(properties); + }; + + /** + * Encodes the specified FetchCertificateAuthorityCsrResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse + * @static + * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCertificateAuthorityCsrResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCsr); + return writer; + }; + + /** + * Encodes the specified FetchCertificateAuthorityCsrResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse + * @static + * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCertificateAuthorityCsrResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCertificateAuthorityCsrResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pemCsr = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCertificateAuthorityCsrResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchCertificateAuthorityCsrResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchCertificateAuthorityCsrResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + if (!$util.isString(message.pemCsr)) + return "pemCsr: string expected"; + return null; + }; + + /** + * Creates a FetchCertificateAuthorityCsrResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse + */ + FetchCertificateAuthorityCsrResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse(); + if (object.pemCsr != null) + message.pemCsr = String(object.pemCsr); + return message; + }; + + /** + * Creates a plain object from a FetchCertificateAuthorityCsrResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse + * @static + * @param {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchCertificateAuthorityCsrResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pemCsr = ""; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + object.pemCsr = message.pemCsr; + return object; + }; + + /** + * Converts this FetchCertificateAuthorityCsrResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse + * @instance + * @returns {Object.} JSON object + */ + FetchCertificateAuthorityCsrResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchCertificateAuthorityCsrResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchCertificateAuthorityCsrResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse"; + }; + + return FetchCertificateAuthorityCsrResponse; + })(); + + v1.GetCertificateAuthorityRequest = (function() { + + /** + * Properties of a GetCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IGetCertificateAuthorityRequest + * @property {string|null} [name] GetCertificateAuthorityRequest name + */ + + /** + * Constructs a new GetCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a GetCertificateAuthorityRequest. + * @implements IGetCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest=} [properties] Properties to set + */ + function GetCertificateAuthorityRequest(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]]; + } + + /** + * GetCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest + * @instance + */ + GetCertificateAuthorityRequest.prototype.name = ""; + + /** + * Creates a new GetCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest instance + */ + GetCertificateAuthorityRequest.create = function create(properties) { + return new GetCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified GetCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest} message GetCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest} message GetCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCertificateAuthorityRequest.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 GetCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest + */ + GetCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.GetCertificateAuthorityRequest} message GetCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCertificateAuthorityRequest.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 GetCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + GetCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.GetCertificateAuthorityRequest"; + }; + + return GetCertificateAuthorityRequest; + })(); + + v1.ListCertificateAuthoritiesRequest = (function() { + + /** + * Properties of a ListCertificateAuthoritiesRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IListCertificateAuthoritiesRequest + * @property {string|null} [parent] ListCertificateAuthoritiesRequest parent + * @property {number|null} [pageSize] ListCertificateAuthoritiesRequest pageSize + * @property {string|null} [pageToken] ListCertificateAuthoritiesRequest pageToken + * @property {string|null} [filter] ListCertificateAuthoritiesRequest filter + * @property {string|null} [orderBy] ListCertificateAuthoritiesRequest orderBy + */ + + /** + * Constructs a new ListCertificateAuthoritiesRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a ListCertificateAuthoritiesRequest. + * @implements IListCertificateAuthoritiesRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest=} [properties] Properties to set + */ + function ListCertificateAuthoritiesRequest(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]]; + } + + /** + * ListCertificateAuthoritiesRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @instance + */ + ListCertificateAuthoritiesRequest.prototype.parent = ""; + + /** + * ListCertificateAuthoritiesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @instance + */ + ListCertificateAuthoritiesRequest.prototype.pageSize = 0; + + /** + * ListCertificateAuthoritiesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @instance + */ + ListCertificateAuthoritiesRequest.prototype.pageToken = ""; + + /** + * ListCertificateAuthoritiesRequest filter. + * @member {string} filter + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @instance + */ + ListCertificateAuthoritiesRequest.prototype.filter = ""; + + /** + * ListCertificateAuthoritiesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @instance + */ + ListCertificateAuthoritiesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCertificateAuthoritiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest instance + */ + ListCertificateAuthoritiesRequest.create = function create(properties) { + return new ListCertificateAuthoritiesRequest(properties); + }; + + /** + * Encodes the specified ListCertificateAuthoritiesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateAuthoritiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCertificateAuthoritiesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateAuthoritiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateAuthoritiesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListCertificateAuthoritiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateAuthoritiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateAuthoritiesRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateAuthoritiesRequest.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 ListCertificateAuthoritiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest + */ + ListCertificateAuthoritiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCertificateAuthoritiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @static + * @param {google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateAuthoritiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCertificateAuthoritiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCertificateAuthoritiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateAuthoritiesRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateAuthoritiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest"; + }; + + return ListCertificateAuthoritiesRequest; + })(); + + v1.ListCertificateAuthoritiesResponse = (function() { + + /** + * Properties of a ListCertificateAuthoritiesResponse. + * @memberof google.cloud.security.privateca.v1 + * @interface IListCertificateAuthoritiesResponse + * @property {Array.|null} [certificateAuthorities] ListCertificateAuthoritiesResponse certificateAuthorities + * @property {string|null} [nextPageToken] ListCertificateAuthoritiesResponse nextPageToken + * @property {Array.|null} [unreachable] ListCertificateAuthoritiesResponse unreachable + */ + + /** + * Constructs a new ListCertificateAuthoritiesResponse. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a ListCertificateAuthoritiesResponse. + * @implements IListCertificateAuthoritiesResponse + * @constructor + * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse=} [properties] Properties to set + */ + function ListCertificateAuthoritiesResponse(properties) { + this.certificateAuthorities = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCertificateAuthoritiesResponse certificateAuthorities. + * @member {Array.} certificateAuthorities + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @instance + */ + ListCertificateAuthoritiesResponse.prototype.certificateAuthorities = $util.emptyArray; + + /** + * ListCertificateAuthoritiesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @instance + */ + ListCertificateAuthoritiesResponse.prototype.nextPageToken = ""; + + /** + * ListCertificateAuthoritiesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @instance + */ + ListCertificateAuthoritiesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCertificateAuthoritiesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse instance + */ + ListCertificateAuthoritiesResponse.create = function create(properties) { + return new ListCertificateAuthoritiesResponse(properties); + }; + + /** + * Encodes the specified ListCertificateAuthoritiesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateAuthoritiesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateAuthorities != null && message.certificateAuthorities.length) + for (var i = 0; i < message.certificateAuthorities.length; ++i) + $root.google.cloud.security.privateca.v1.CertificateAuthority.encode(message.certificateAuthorities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCertificateAuthoritiesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateAuthoritiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateAuthoritiesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.certificateAuthorities && message.certificateAuthorities.length)) + message.certificateAuthorities = []; + message.certificateAuthorities.push($root.google.cloud.security.privateca.v1.CertificateAuthority.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateAuthoritiesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateAuthoritiesResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateAuthoritiesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateAuthorities != null && message.hasOwnProperty("certificateAuthorities")) { + if (!Array.isArray(message.certificateAuthorities)) + return "certificateAuthorities: array expected"; + for (var i = 0; i < message.certificateAuthorities.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.verify(message.certificateAuthorities[i]); + if (error) + return "certificateAuthorities." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCertificateAuthoritiesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse + */ + ListCertificateAuthoritiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse(); + if (object.certificateAuthorities) { + if (!Array.isArray(object.certificateAuthorities)) + throw TypeError(".google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.certificateAuthorities: array expected"); + message.certificateAuthorities = []; + for (var i = 0; i < object.certificateAuthorities.length; ++i) { + if (typeof object.certificateAuthorities[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.certificateAuthorities: object expected"); + message.certificateAuthorities[i] = $root.google.cloud.security.privateca.v1.CertificateAuthority.fromObject(object.certificateAuthorities[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCertificateAuthoritiesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @static + * @param {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateAuthoritiesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.certificateAuthorities = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.certificateAuthorities && message.certificateAuthorities.length) { + object.certificateAuthorities = []; + for (var j = 0; j < message.certificateAuthorities.length; ++j) + object.certificateAuthorities[j] = $root.google.cloud.security.privateca.v1.CertificateAuthority.toObject(message.certificateAuthorities[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCertificateAuthoritiesResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCertificateAuthoritiesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateAuthoritiesResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateAuthoritiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse"; + }; + + return ListCertificateAuthoritiesResponse; + })(); + + v1.UndeleteCertificateAuthorityRequest = (function() { + + /** + * Properties of an UndeleteCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IUndeleteCertificateAuthorityRequest + * @property {string|null} [name] UndeleteCertificateAuthorityRequest name + * @property {string|null} [requestId] UndeleteCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new UndeleteCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an UndeleteCertificateAuthorityRequest. + * @implements IUndeleteCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest=} [properties] Properties to set + */ + function UndeleteCertificateAuthorityRequest(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]]; + } + + /** + * UndeleteCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @instance + */ + UndeleteCertificateAuthorityRequest.prototype.name = ""; + + /** + * UndeleteCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @instance + */ + UndeleteCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new UndeleteCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest} UndeleteCertificateAuthorityRequest instance + */ + UndeleteCertificateAuthorityRequest.create = function create(properties) { + return new UndeleteCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified UndeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest} message UndeleteCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UndeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest} message UndeleteCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest} UndeleteCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest} UndeleteCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteCertificateAuthorityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UndeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest} UndeleteCertificateAuthorityRequest + */ + UndeleteCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UndeleteCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest} message UndeleteCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UndeleteCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + UndeleteCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest"; + }; + + return UndeleteCertificateAuthorityRequest; + })(); + + v1.DeleteCertificateAuthorityRequest = (function() { + + /** + * Properties of a DeleteCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IDeleteCertificateAuthorityRequest + * @property {string|null} [name] DeleteCertificateAuthorityRequest name + * @property {string|null} [requestId] DeleteCertificateAuthorityRequest requestId + * @property {boolean|null} [ignoreActiveCertificates] DeleteCertificateAuthorityRequest ignoreActiveCertificates + * @property {boolean|null} [skipGracePeriod] DeleteCertificateAuthorityRequest skipGracePeriod + * @property {boolean|null} [ignoreDependentResources] DeleteCertificateAuthorityRequest ignoreDependentResources + */ + + /** + * Constructs a new DeleteCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a DeleteCertificateAuthorityRequest. + * @implements IDeleteCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest=} [properties] Properties to set + */ + function DeleteCertificateAuthorityRequest(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]]; + } + + /** + * DeleteCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @instance + */ + DeleteCertificateAuthorityRequest.prototype.name = ""; + + /** + * DeleteCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @instance + */ + DeleteCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * DeleteCertificateAuthorityRequest ignoreActiveCertificates. + * @member {boolean} ignoreActiveCertificates + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @instance + */ + DeleteCertificateAuthorityRequest.prototype.ignoreActiveCertificates = false; + + /** + * DeleteCertificateAuthorityRequest skipGracePeriod. + * @member {boolean} skipGracePeriod + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @instance + */ + DeleteCertificateAuthorityRequest.prototype.skipGracePeriod = false; + + /** + * DeleteCertificateAuthorityRequest ignoreDependentResources. + * @member {boolean} ignoreDependentResources + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @instance + */ + DeleteCertificateAuthorityRequest.prototype.ignoreDependentResources = false; + + /** + * Creates a new DeleteCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest} DeleteCertificateAuthorityRequest instance + */ + DeleteCertificateAuthorityRequest.create = function create(properties) { + return new DeleteCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified DeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest} message DeleteCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.ignoreActiveCertificates != null && Object.hasOwnProperty.call(message, "ignoreActiveCertificates")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreActiveCertificates); + if (message.skipGracePeriod != null && Object.hasOwnProperty.call(message, "skipGracePeriod")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipGracePeriod); + if (message.ignoreDependentResources != null && Object.hasOwnProperty.call(message, "ignoreDependentResources")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.ignoreDependentResources); + return writer; + }; + + /** + * Encodes the specified DeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest} message DeleteCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest} DeleteCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 4: { + message.ignoreActiveCertificates = reader.bool(); + break; + } + case 5: { + message.skipGracePeriod = reader.bool(); + break; + } + case 6: { + message.ignoreDependentResources = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest} DeleteCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCertificateAuthorityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.ignoreActiveCertificates != null && message.hasOwnProperty("ignoreActiveCertificates")) + if (typeof message.ignoreActiveCertificates !== "boolean") + return "ignoreActiveCertificates: boolean expected"; + if (message.skipGracePeriod != null && message.hasOwnProperty("skipGracePeriod")) + if (typeof message.skipGracePeriod !== "boolean") + return "skipGracePeriod: boolean expected"; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + if (typeof message.ignoreDependentResources !== "boolean") + return "ignoreDependentResources: boolean expected"; + return null; + }; + + /** + * Creates a DeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest} DeleteCertificateAuthorityRequest + */ + DeleteCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.ignoreActiveCertificates != null) + message.ignoreActiveCertificates = Boolean(object.ignoreActiveCertificates); + if (object.skipGracePeriod != null) + message.skipGracePeriod = Boolean(object.skipGracePeriod); + if (object.ignoreDependentResources != null) + message.ignoreDependentResources = Boolean(object.ignoreDependentResources); + return message; + }; + + /** + * Creates a plain object from a DeleteCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest} message DeleteCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.ignoreActiveCertificates = false; + object.skipGracePeriod = false; + object.ignoreDependentResources = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.ignoreActiveCertificates != null && message.hasOwnProperty("ignoreActiveCertificates")) + object.ignoreActiveCertificates = message.ignoreActiveCertificates; + if (message.skipGracePeriod != null && message.hasOwnProperty("skipGracePeriod")) + object.skipGracePeriod = message.skipGracePeriod; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + object.ignoreDependentResources = message.ignoreDependentResources; + return object; + }; + + /** + * Converts this DeleteCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest"; + }; + + return DeleteCertificateAuthorityRequest; + })(); + + v1.UpdateCertificateAuthorityRequest = (function() { + + /** + * Properties of an UpdateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IUpdateCertificateAuthorityRequest + * @property {google.cloud.security.privateca.v1.ICertificateAuthority|null} [certificateAuthority] UpdateCertificateAuthorityRequest certificateAuthority + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateAuthorityRequest updateMask + * @property {string|null} [requestId] UpdateCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new UpdateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an UpdateCertificateAuthorityRequest. + * @implements IUpdateCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest=} [properties] Properties to set + */ + function UpdateCertificateAuthorityRequest(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]]; + } + + /** + * UpdateCertificateAuthorityRequest certificateAuthority. + * @member {google.cloud.security.privateca.v1.ICertificateAuthority|null|undefined} certificateAuthority + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @instance + */ + UpdateCertificateAuthorityRequest.prototype.certificateAuthority = null; + + /** + * UpdateCertificateAuthorityRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @instance + */ + UpdateCertificateAuthorityRequest.prototype.updateMask = null; + + /** + * UpdateCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @instance + */ + UpdateCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest instance + */ + UpdateCertificateAuthorityRequest.create = function create(properties) { + return new UpdateCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified UpdateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) + $root.google.cloud.security.privateca.v1.CertificateAuthority.encode(message.certificateAuthority, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCertificateAuthorityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { + var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.verify(message.certificateAuthority); + if (error) + return "certificateAuthority." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest + */ + UpdateCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(); + if (object.certificateAuthority != null) { + if (typeof object.certificateAuthority !== "object") + throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.certificateAuthority: object expected"); + message.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.fromObject(object.certificateAuthority); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificateAuthority = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) + object.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.toObject(message.certificateAuthority, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest"; + }; + + return UpdateCertificateAuthorityRequest; + })(); + + v1.CreateCaPoolRequest = (function() { + + /** + * Properties of a CreateCaPoolRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface ICreateCaPoolRequest + * @property {string|null} [parent] CreateCaPoolRequest parent + * @property {string|null} [caPoolId] CreateCaPoolRequest caPoolId + * @property {google.cloud.security.privateca.v1.ICaPool|null} [caPool] CreateCaPoolRequest caPool + * @property {string|null} [requestId] CreateCaPoolRequest requestId + */ + + /** + * Constructs a new CreateCaPoolRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CreateCaPoolRequest. + * @implements ICreateCaPoolRequest + * @constructor + * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest=} [properties] Properties to set + */ + function CreateCaPoolRequest(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]]; + } + + /** + * CreateCaPoolRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @instance + */ + CreateCaPoolRequest.prototype.parent = ""; + + /** + * CreateCaPoolRequest caPoolId. + * @member {string} caPoolId + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @instance + */ + CreateCaPoolRequest.prototype.caPoolId = ""; + + /** + * CreateCaPoolRequest caPool. + * @member {google.cloud.security.privateca.v1.ICaPool|null|undefined} caPool + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @instance + */ + CreateCaPoolRequest.prototype.caPool = null; + + /** + * CreateCaPoolRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @instance + */ + CreateCaPoolRequest.prototype.requestId = ""; + + /** + * Creates a new CreateCaPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CreateCaPoolRequest} CreateCaPoolRequest instance + */ + CreateCaPoolRequest.create = function create(properties) { + return new CreateCaPoolRequest(properties); + }; + + /** + * Encodes the specified CreateCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCaPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest} message CreateCaPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCaPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.caPoolId != null && Object.hasOwnProperty.call(message, "caPoolId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.caPoolId); + if (message.caPool != null && Object.hasOwnProperty.call(message, "caPool")) + $root.google.cloud.security.privateca.v1.CaPool.encode(message.caPool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCaPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest} message CreateCaPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCaPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCaPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CreateCaPoolRequest} CreateCaPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCaPoolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CreateCaPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.caPoolId = reader.string(); + break; + } + case 3: { + message.caPool = $root.google.cloud.security.privateca.v1.CaPool.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCaPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CreateCaPoolRequest} CreateCaPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCaPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCaPoolRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCaPoolRequest.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.caPoolId != null && message.hasOwnProperty("caPoolId")) + if (!$util.isString(message.caPoolId)) + return "caPoolId: string expected"; + if (message.caPool != null && message.hasOwnProperty("caPool")) { + var error = $root.google.cloud.security.privateca.v1.CaPool.verify(message.caPool); + if (error) + return "caPool." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateCaPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CreateCaPoolRequest} CreateCaPoolRequest + */ + CreateCaPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CreateCaPoolRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.CreateCaPoolRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.caPoolId != null) + message.caPoolId = String(object.caPoolId); + if (object.caPool != null) { + if (typeof object.caPool !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CreateCaPoolRequest.caPool: object expected"); + message.caPool = $root.google.cloud.security.privateca.v1.CaPool.fromObject(object.caPool); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateCaPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.CreateCaPoolRequest} message CreateCaPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCaPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.caPoolId = ""; + object.caPool = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.caPoolId != null && message.hasOwnProperty("caPoolId")) + object.caPoolId = message.caPoolId; + if (message.caPool != null && message.hasOwnProperty("caPool")) + object.caPool = $root.google.cloud.security.privateca.v1.CaPool.toObject(message.caPool, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateCaPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCaPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCaPoolRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCaPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CreateCaPoolRequest"; + }; + + return CreateCaPoolRequest; + })(); + + v1.UpdateCaPoolRequest = (function() { + + /** + * Properties of an UpdateCaPoolRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IUpdateCaPoolRequest + * @property {google.cloud.security.privateca.v1.ICaPool|null} [caPool] UpdateCaPoolRequest caPool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCaPoolRequest updateMask + * @property {string|null} [requestId] UpdateCaPoolRequest requestId + */ + + /** + * Constructs a new UpdateCaPoolRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an UpdateCaPoolRequest. + * @implements IUpdateCaPoolRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest=} [properties] Properties to set + */ + function UpdateCaPoolRequest(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]]; + } + + /** + * UpdateCaPoolRequest caPool. + * @member {google.cloud.security.privateca.v1.ICaPool|null|undefined} caPool + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @instance + */ + UpdateCaPoolRequest.prototype.caPool = null; + + /** + * UpdateCaPoolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @instance + */ + UpdateCaPoolRequest.prototype.updateMask = null; + + /** + * UpdateCaPoolRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @instance + */ + UpdateCaPoolRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateCaPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.UpdateCaPoolRequest} UpdateCaPoolRequest instance + */ + UpdateCaPoolRequest.create = function create(properties) { + return new UpdateCaPoolRequest(properties); + }; + + /** + * Encodes the specified UpdateCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCaPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest} message UpdateCaPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCaPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caPool != null && Object.hasOwnProperty.call(message, "caPool")) + $root.google.cloud.security.privateca.v1.CaPool.encode(message.caPool, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCaPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest} message UpdateCaPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCaPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCaPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.UpdateCaPoolRequest} UpdateCaPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCaPoolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UpdateCaPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.caPool = $root.google.cloud.security.privateca.v1.CaPool.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCaPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.UpdateCaPoolRequest} UpdateCaPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCaPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCaPoolRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCaPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caPool != null && message.hasOwnProperty("caPool")) { + var error = $root.google.cloud.security.privateca.v1.CaPool.verify(message.caPool); + if (error) + return "caPool." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateCaPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.UpdateCaPoolRequest} UpdateCaPoolRequest + */ + UpdateCaPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.UpdateCaPoolRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.UpdateCaPoolRequest(); + if (object.caPool != null) { + if (typeof object.caPool !== "object") + throw TypeError(".google.cloud.security.privateca.v1.UpdateCaPoolRequest.caPool: object expected"); + message.caPool = $root.google.cloud.security.privateca.v1.CaPool.fromObject(object.caPool); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.security.privateca.v1.UpdateCaPoolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateCaPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.UpdateCaPoolRequest} message UpdateCaPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCaPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.caPool = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.caPool != null && message.hasOwnProperty("caPool")) + object.caPool = $root.google.cloud.security.privateca.v1.CaPool.toObject(message.caPool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateCaPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCaPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCaPoolRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCaPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.UpdateCaPoolRequest"; + }; + + return UpdateCaPoolRequest; + })(); + + v1.DeleteCaPoolRequest = (function() { + + /** + * Properties of a DeleteCaPoolRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IDeleteCaPoolRequest + * @property {string|null} [name] DeleteCaPoolRequest name + * @property {string|null} [requestId] DeleteCaPoolRequest requestId + * @property {boolean|null} [ignoreDependentResources] DeleteCaPoolRequest ignoreDependentResources + */ + + /** + * Constructs a new DeleteCaPoolRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a DeleteCaPoolRequest. + * @implements IDeleteCaPoolRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest=} [properties] Properties to set + */ + function DeleteCaPoolRequest(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]]; + } + + /** + * DeleteCaPoolRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @instance + */ + DeleteCaPoolRequest.prototype.name = ""; + + /** + * DeleteCaPoolRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @instance + */ + DeleteCaPoolRequest.prototype.requestId = ""; + + /** + * DeleteCaPoolRequest ignoreDependentResources. + * @member {boolean} ignoreDependentResources + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @instance + */ + DeleteCaPoolRequest.prototype.ignoreDependentResources = false; + + /** + * Creates a new DeleteCaPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.DeleteCaPoolRequest} DeleteCaPoolRequest instance + */ + DeleteCaPoolRequest.create = function create(properties) { + return new DeleteCaPoolRequest(properties); + }; + + /** + * Encodes the specified DeleteCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCaPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest} message DeleteCaPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCaPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.ignoreDependentResources != null && Object.hasOwnProperty.call(message, "ignoreDependentResources")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreDependentResources); + return writer; + }; + + /** + * Encodes the specified DeleteCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCaPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest} message DeleteCaPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCaPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCaPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.DeleteCaPoolRequest} DeleteCaPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCaPoolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.DeleteCaPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 4: { + message.ignoreDependentResources = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCaPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.DeleteCaPoolRequest} DeleteCaPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCaPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCaPoolRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCaPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + if (typeof message.ignoreDependentResources !== "boolean") + return "ignoreDependentResources: boolean expected"; + return null; + }; + + /** + * Creates a DeleteCaPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.DeleteCaPoolRequest} DeleteCaPoolRequest + */ + DeleteCaPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.DeleteCaPoolRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.DeleteCaPoolRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.ignoreDependentResources != null) + message.ignoreDependentResources = Boolean(object.ignoreDependentResources); + return message; + }; + + /** + * Creates a plain object from a DeleteCaPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.DeleteCaPoolRequest} message DeleteCaPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCaPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.ignoreDependentResources = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + object.ignoreDependentResources = message.ignoreDependentResources; + return object; + }; + + /** + * Converts this DeleteCaPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCaPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCaPoolRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCaPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.DeleteCaPoolRequest"; + }; + + return DeleteCaPoolRequest; + })(); + + v1.FetchCaCertsRequest = (function() { + + /** + * Properties of a FetchCaCertsRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IFetchCaCertsRequest + * @property {string|null} [caPool] FetchCaCertsRequest caPool + * @property {string|null} [requestId] FetchCaCertsRequest requestId + */ + + /** + * Constructs a new FetchCaCertsRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a FetchCaCertsRequest. + * @implements IFetchCaCertsRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest=} [properties] Properties to set + */ + function FetchCaCertsRequest(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]]; + } + + /** + * FetchCaCertsRequest caPool. + * @member {string} caPool + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @instance + */ + FetchCaCertsRequest.prototype.caPool = ""; + + /** + * FetchCaCertsRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @instance + */ + FetchCaCertsRequest.prototype.requestId = ""; + + /** + * Creates a new FetchCaCertsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @static + * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.FetchCaCertsRequest} FetchCaCertsRequest instance + */ + FetchCaCertsRequest.create = function create(properties) { + return new FetchCaCertsRequest(properties); + }; + + /** + * Encodes the specified FetchCaCertsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @static + * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest} message FetchCaCertsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCaCertsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caPool != null && Object.hasOwnProperty.call(message, "caPool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.caPool); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified FetchCaCertsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @static + * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest} message FetchCaCertsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCaCertsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchCaCertsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.FetchCaCertsRequest} FetchCaCertsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCaCertsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.FetchCaCertsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.caPool = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchCaCertsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.FetchCaCertsRequest} FetchCaCertsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCaCertsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchCaCertsRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchCaCertsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caPool != null && message.hasOwnProperty("caPool")) + if (!$util.isString(message.caPool)) + return "caPool: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a FetchCaCertsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.FetchCaCertsRequest} FetchCaCertsRequest + */ + FetchCaCertsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.FetchCaCertsRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.FetchCaCertsRequest(); + if (object.caPool != null) + message.caPool = String(object.caPool); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a FetchCaCertsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @static + * @param {google.cloud.security.privateca.v1.FetchCaCertsRequest} message FetchCaCertsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchCaCertsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.caPool = ""; + object.requestId = ""; + } + if (message.caPool != null && message.hasOwnProperty("caPool")) + object.caPool = message.caPool; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this FetchCaCertsRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @instance + * @returns {Object.} JSON object + */ + FetchCaCertsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchCaCertsRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchCaCertsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.FetchCaCertsRequest"; + }; + + return FetchCaCertsRequest; + })(); + + v1.FetchCaCertsResponse = (function() { + + /** + * Properties of a FetchCaCertsResponse. + * @memberof google.cloud.security.privateca.v1 + * @interface IFetchCaCertsResponse + * @property {Array.|null} [caCerts] FetchCaCertsResponse caCerts + */ + + /** + * Constructs a new FetchCaCertsResponse. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a FetchCaCertsResponse. + * @implements IFetchCaCertsResponse + * @constructor + * @param {google.cloud.security.privateca.v1.IFetchCaCertsResponse=} [properties] Properties to set + */ + function FetchCaCertsResponse(properties) { + this.caCerts = []; + 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]]; + } + + /** + * FetchCaCertsResponse caCerts. + * @member {Array.} caCerts + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @instance + */ + FetchCaCertsResponse.prototype.caCerts = $util.emptyArray; + + /** + * Creates a new FetchCaCertsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @static + * @param {google.cloud.security.privateca.v1.IFetchCaCertsResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse} FetchCaCertsResponse instance + */ + FetchCaCertsResponse.create = function create(properties) { + return new FetchCaCertsResponse(properties); + }; + + /** + * Encodes the specified FetchCaCertsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @static + * @param {google.cloud.security.privateca.v1.IFetchCaCertsResponse} message FetchCaCertsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCaCertsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caCerts != null && message.caCerts.length) + for (var i = 0; i < message.caCerts.length; ++i) + $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FetchCaCertsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @static + * @param {google.cloud.security.privateca.v1.IFetchCaCertsResponse} message FetchCaCertsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCaCertsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchCaCertsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse} FetchCaCertsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCaCertsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.FetchCaCertsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.caCerts && message.caCerts.length)) + message.caCerts = []; + message.caCerts.push($root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchCaCertsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse} FetchCaCertsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCaCertsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchCaCertsResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchCaCertsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caCerts != null && message.hasOwnProperty("caCerts")) { + if (!Array.isArray(message.caCerts)) + return "caCerts: array expected"; + for (var i = 0; i < message.caCerts.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.verify(message.caCerts[i]); + if (error) + return "caCerts." + error; + } + } + return null; + }; + + /** + * Creates a FetchCaCertsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse} FetchCaCertsResponse + */ + FetchCaCertsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.FetchCaCertsResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1.FetchCaCertsResponse(); + if (object.caCerts) { + if (!Array.isArray(object.caCerts)) + throw TypeError(".google.cloud.security.privateca.v1.FetchCaCertsResponse.caCerts: array expected"); + message.caCerts = []; + for (var i = 0; i < object.caCerts.length; ++i) { + if (typeof object.caCerts[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.FetchCaCertsResponse.caCerts: object expected"); + message.caCerts[i] = $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.fromObject(object.caCerts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FetchCaCertsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @static + * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse} message FetchCaCertsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchCaCertsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.caCerts = []; + if (message.caCerts && message.caCerts.length) { + object.caCerts = []; + for (var j = 0; j < message.caCerts.length; ++j) + object.caCerts[j] = $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.toObject(message.caCerts[j], options); + } + return object; + }; + + /** + * Converts this FetchCaCertsResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @instance + * @returns {Object.} JSON object + */ + FetchCaCertsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchCaCertsResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchCaCertsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.FetchCaCertsResponse"; + }; + + FetchCaCertsResponse.CertChain = (function() { + + /** + * Properties of a CertChain. + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @interface ICertChain + * @property {Array.|null} [certificates] CertChain certificates + */ + + /** + * Constructs a new CertChain. + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse + * @classdesc Represents a CertChain. + * @implements ICertChain + * @constructor + * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain=} [properties] Properties to set + */ + function CertChain(properties) { + this.certificates = []; + 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]]; + } + + /** + * CertChain certificates. + * @member {Array.} certificates + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain + * @instance + */ + CertChain.prototype.certificates = $util.emptyArray; + + /** + * Creates a new CertChain instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain + * @static + * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain} CertChain instance + */ + CertChain.create = function create(properties) { + return new CertChain(properties); + }; + + /** + * Encodes the specified CertChain message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain + * @static + * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain} message CertChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertChain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificates != null && message.certificates.length) + for (var i = 0; i < message.certificates.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificates[i]); + return writer; + }; + + /** + * Encodes the specified CertChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain + * @static + * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain} message CertChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertChain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertChain message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain} CertChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertChain.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.certificates && message.certificates.length)) + message.certificates = []; + message.certificates.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertChain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain} CertChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertChain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertChain message. + * @function verify + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertChain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificates != null && message.hasOwnProperty("certificates")) { + if (!Array.isArray(message.certificates)) + return "certificates: array expected"; + for (var i = 0; i < message.certificates.length; ++i) + if (!$util.isString(message.certificates[i])) + return "certificates: string[] expected"; + } + return null; + }; + + /** + * Creates a CertChain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain} CertChain + */ + CertChain.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain) + return object; + var message = new $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain(); + if (object.certificates) { + if (!Array.isArray(object.certificates)) + throw TypeError(".google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.certificates: array expected"); + message.certificates = []; + for (var i = 0; i < object.certificates.length; ++i) + message.certificates[i] = String(object.certificates[i]); + } + return message; + }; + + /** + * Creates a plain object from a CertChain message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain + * @static + * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain} message CertChain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertChain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.certificates = []; + if (message.certificates && message.certificates.length) { + object.certificates = []; + for (var j = 0; j < message.certificates.length; ++j) + object.certificates[j] = message.certificates[j]; + } + return object; + }; + + /** + * Converts this CertChain to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain + * @instance + * @returns {Object.} JSON object + */ + CertChain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertChain + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertChain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain"; + }; + + return CertChain; + })(); + + return FetchCaCertsResponse; + })(); + + v1.GetCaPoolRequest = (function() { + + /** + * Properties of a GetCaPoolRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IGetCaPoolRequest + * @property {string|null} [name] GetCaPoolRequest name + */ + + /** + * Constructs a new GetCaPoolRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a GetCaPoolRequest. + * @implements IGetCaPoolRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest=} [properties] Properties to set + */ + function GetCaPoolRequest(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]]; + } + + /** + * GetCaPoolRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest + * @instance + */ + GetCaPoolRequest.prototype.name = ""; + + /** + * Creates a new GetCaPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.GetCaPoolRequest} GetCaPoolRequest instance + */ + GetCaPoolRequest.create = function create(properties) { + return new GetCaPoolRequest(properties); + }; + + /** + * Encodes the specified GetCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCaPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest} message GetCaPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCaPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCaPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest} message GetCaPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCaPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCaPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.GetCaPoolRequest} GetCaPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCaPoolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.GetCaPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCaPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.GetCaPoolRequest} GetCaPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCaPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCaPoolRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCaPoolRequest.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 GetCaPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.GetCaPoolRequest} GetCaPoolRequest + */ + GetCaPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.GetCaPoolRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.GetCaPoolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCaPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest + * @static + * @param {google.cloud.security.privateca.v1.GetCaPoolRequest} message GetCaPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCaPoolRequest.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 GetCaPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest + * @instance + * @returns {Object.} JSON object + */ + GetCaPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCaPoolRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCaPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.GetCaPoolRequest"; + }; + + return GetCaPoolRequest; + })(); + + v1.ListCaPoolsRequest = (function() { + + /** + * Properties of a ListCaPoolsRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IListCaPoolsRequest + * @property {string|null} [parent] ListCaPoolsRequest parent + * @property {number|null} [pageSize] ListCaPoolsRequest pageSize + * @property {string|null} [pageToken] ListCaPoolsRequest pageToken + * @property {string|null} [filter] ListCaPoolsRequest filter + * @property {string|null} [orderBy] ListCaPoolsRequest orderBy + */ + + /** + * Constructs a new ListCaPoolsRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a ListCaPoolsRequest. + * @implements IListCaPoolsRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest=} [properties] Properties to set + */ + function ListCaPoolsRequest(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]]; + } + + /** + * ListCaPoolsRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @instance + */ + ListCaPoolsRequest.prototype.parent = ""; + + /** + * ListCaPoolsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @instance + */ + ListCaPoolsRequest.prototype.pageSize = 0; + + /** + * ListCaPoolsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @instance + */ + ListCaPoolsRequest.prototype.pageToken = ""; + + /** + * ListCaPoolsRequest filter. + * @member {string} filter + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @instance + */ + ListCaPoolsRequest.prototype.filter = ""; + + /** + * ListCaPoolsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @instance + */ + ListCaPoolsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCaPoolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ListCaPoolsRequest} ListCaPoolsRequest instance + */ + ListCaPoolsRequest.create = function create(properties) { + return new ListCaPoolsRequest(properties); + }; + + /** + * Encodes the specified ListCaPoolsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest} message ListCaPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCaPoolsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCaPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest} message ListCaPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCaPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCaPoolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ListCaPoolsRequest} ListCaPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCaPoolsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCaPoolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListCaPoolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ListCaPoolsRequest} ListCaPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCaPoolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCaPoolsRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCaPoolsRequest.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 ListCaPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ListCaPoolsRequest} ListCaPoolsRequest + */ + ListCaPoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ListCaPoolsRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.ListCaPoolsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCaPoolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @static + * @param {google.cloud.security.privateca.v1.ListCaPoolsRequest} message ListCaPoolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCaPoolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCaPoolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCaPoolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCaPoolsRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCaPoolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCaPoolsRequest"; + }; + + return ListCaPoolsRequest; + })(); + + v1.ListCaPoolsResponse = (function() { + + /** + * Properties of a ListCaPoolsResponse. + * @memberof google.cloud.security.privateca.v1 + * @interface IListCaPoolsResponse + * @property {Array.|null} [caPools] ListCaPoolsResponse caPools + * @property {string|null} [nextPageToken] ListCaPoolsResponse nextPageToken + * @property {Array.|null} [unreachable] ListCaPoolsResponse unreachable + */ + + /** + * Constructs a new ListCaPoolsResponse. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a ListCaPoolsResponse. + * @implements IListCaPoolsResponse + * @constructor + * @param {google.cloud.security.privateca.v1.IListCaPoolsResponse=} [properties] Properties to set + */ + function ListCaPoolsResponse(properties) { + this.caPools = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCaPoolsResponse caPools. + * @member {Array.} caPools + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @instance + */ + ListCaPoolsResponse.prototype.caPools = $util.emptyArray; + + /** + * ListCaPoolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @instance + */ + ListCaPoolsResponse.prototype.nextPageToken = ""; + + /** + * ListCaPoolsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @instance + */ + ListCaPoolsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCaPoolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCaPoolsResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ListCaPoolsResponse} ListCaPoolsResponse instance + */ + ListCaPoolsResponse.create = function create(properties) { + return new ListCaPoolsResponse(properties); + }; + + /** + * Encodes the specified ListCaPoolsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCaPoolsResponse} message ListCaPoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCaPoolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caPools != null && message.caPools.length) + for (var i = 0; i < message.caPools.length; ++i) + $root.google.cloud.security.privateca.v1.CaPool.encode(message.caPools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCaPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCaPoolsResponse} message ListCaPoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCaPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCaPoolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ListCaPoolsResponse} ListCaPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCaPoolsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCaPoolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.caPools && message.caPools.length)) + message.caPools = []; + message.caPools.push($root.google.cloud.security.privateca.v1.CaPool.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCaPoolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ListCaPoolsResponse} ListCaPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCaPoolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCaPoolsResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCaPoolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caPools != null && message.hasOwnProperty("caPools")) { + if (!Array.isArray(message.caPools)) + return "caPools: array expected"; + for (var i = 0; i < message.caPools.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.CaPool.verify(message.caPools[i]); + if (error) + return "caPools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCaPoolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ListCaPoolsResponse} ListCaPoolsResponse + */ + ListCaPoolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ListCaPoolsResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1.ListCaPoolsResponse(); + if (object.caPools) { + if (!Array.isArray(object.caPools)) + throw TypeError(".google.cloud.security.privateca.v1.ListCaPoolsResponse.caPools: array expected"); + message.caPools = []; + for (var i = 0; i < object.caPools.length; ++i) { + if (typeof object.caPools[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.ListCaPoolsResponse.caPools: object expected"); + message.caPools[i] = $root.google.cloud.security.privateca.v1.CaPool.fromObject(object.caPools[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.security.privateca.v1.ListCaPoolsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCaPoolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @static + * @param {google.cloud.security.privateca.v1.ListCaPoolsResponse} message ListCaPoolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCaPoolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.caPools = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.caPools && message.caPools.length) { + object.caPools = []; + for (var j = 0; j < message.caPools.length; ++j) + object.caPools[j] = $root.google.cloud.security.privateca.v1.CaPool.toObject(message.caPools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCaPoolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCaPoolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCaPoolsResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCaPoolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCaPoolsResponse"; + }; + + return ListCaPoolsResponse; + })(); + + v1.GetCertificateRevocationListRequest = (function() { + + /** + * Properties of a GetCertificateRevocationListRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IGetCertificateRevocationListRequest + * @property {string|null} [name] GetCertificateRevocationListRequest name + */ + + /** + * Constructs a new GetCertificateRevocationListRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a GetCertificateRevocationListRequest. + * @implements IGetCertificateRevocationListRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest=} [properties] Properties to set + */ + function GetCertificateRevocationListRequest(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]]; + } + + /** + * GetCertificateRevocationListRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest + * @instance + */ + GetCertificateRevocationListRequest.prototype.name = ""; + + /** + * Creates a new GetCertificateRevocationListRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest instance + */ + GetCertificateRevocationListRequest.create = function create(properties) { + return new GetCertificateRevocationListRequest(properties); + }; + + /** + * Encodes the specified GetCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRevocationListRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest} message GetCertificateRevocationListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateRevocationListRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRevocationListRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest} message GetCertificateRevocationListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateRevocationListRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateRevocationListRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateRevocationListRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCertificateRevocationListRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCertificateRevocationListRequest.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 GetCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest + */ + GetCertificateRevocationListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCertificateRevocationListRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1.GetCertificateRevocationListRequest} message GetCertificateRevocationListRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCertificateRevocationListRequest.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 GetCertificateRevocationListRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest + * @instance + * @returns {Object.} JSON object + */ + GetCertificateRevocationListRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCertificateRevocationListRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCertificateRevocationListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.GetCertificateRevocationListRequest"; + }; + + return GetCertificateRevocationListRequest; + })(); + + v1.ListCertificateRevocationListsRequest = (function() { + + /** + * Properties of a ListCertificateRevocationListsRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IListCertificateRevocationListsRequest + * @property {string|null} [parent] ListCertificateRevocationListsRequest parent + * @property {number|null} [pageSize] ListCertificateRevocationListsRequest pageSize + * @property {string|null} [pageToken] ListCertificateRevocationListsRequest pageToken + * @property {string|null} [filter] ListCertificateRevocationListsRequest filter + * @property {string|null} [orderBy] ListCertificateRevocationListsRequest orderBy + */ + + /** + * Constructs a new ListCertificateRevocationListsRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a ListCertificateRevocationListsRequest. + * @implements IListCertificateRevocationListsRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest=} [properties] Properties to set + */ + function ListCertificateRevocationListsRequest(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]]; + } + + /** + * ListCertificateRevocationListsRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @instance + */ + ListCertificateRevocationListsRequest.prototype.parent = ""; + + /** + * ListCertificateRevocationListsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @instance + */ + ListCertificateRevocationListsRequest.prototype.pageSize = 0; + + /** + * ListCertificateRevocationListsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @instance + */ + ListCertificateRevocationListsRequest.prototype.pageToken = ""; + + /** + * ListCertificateRevocationListsRequest filter. + * @member {string} filter + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @instance + */ + ListCertificateRevocationListsRequest.prototype.filter = ""; + + /** + * ListCertificateRevocationListsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @instance + */ + ListCertificateRevocationListsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCertificateRevocationListsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest instance + */ + ListCertificateRevocationListsRequest.create = function create(properties) { + return new ListCertificateRevocationListsRequest(properties); + }; + + /** + * Encodes the specified ListCertificateRevocationListsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateRevocationListsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCertificateRevocationListsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateRevocationListsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateRevocationListsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListCertificateRevocationListsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateRevocationListsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateRevocationListsRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateRevocationListsRequest.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 ListCertificateRevocationListsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest + */ + ListCertificateRevocationListsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCertificateRevocationListsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @static + * @param {google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateRevocationListsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCertificateRevocationListsRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCertificateRevocationListsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateRevocationListsRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateRevocationListsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest"; + }; + + return ListCertificateRevocationListsRequest; + })(); + + v1.ListCertificateRevocationListsResponse = (function() { + + /** + * Properties of a ListCertificateRevocationListsResponse. + * @memberof google.cloud.security.privateca.v1 + * @interface IListCertificateRevocationListsResponse + * @property {Array.|null} [certificateRevocationLists] ListCertificateRevocationListsResponse certificateRevocationLists + * @property {string|null} [nextPageToken] ListCertificateRevocationListsResponse nextPageToken + * @property {Array.|null} [unreachable] ListCertificateRevocationListsResponse unreachable + */ + + /** + * Constructs a new ListCertificateRevocationListsResponse. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a ListCertificateRevocationListsResponse. + * @implements IListCertificateRevocationListsResponse + * @constructor + * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse=} [properties] Properties to set + */ + function ListCertificateRevocationListsResponse(properties) { + this.certificateRevocationLists = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCertificateRevocationListsResponse certificateRevocationLists. + * @member {Array.} certificateRevocationLists + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @instance + */ + ListCertificateRevocationListsResponse.prototype.certificateRevocationLists = $util.emptyArray; + + /** + * ListCertificateRevocationListsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @instance + */ + ListCertificateRevocationListsResponse.prototype.nextPageToken = ""; + + /** + * ListCertificateRevocationListsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @instance + */ + ListCertificateRevocationListsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCertificateRevocationListsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse instance + */ + ListCertificateRevocationListsResponse.create = function create(properties) { + return new ListCertificateRevocationListsResponse(properties); + }; + + /** + * Encodes the specified ListCertificateRevocationListsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateRevocationListsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateRevocationLists != null && message.certificateRevocationLists.length) + for (var i = 0; i < message.certificateRevocationLists.length; ++i) + $root.google.cloud.security.privateca.v1.CertificateRevocationList.encode(message.certificateRevocationLists[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCertificateRevocationListsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateRevocationListsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateRevocationListsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.certificateRevocationLists && message.certificateRevocationLists.length)) + message.certificateRevocationLists = []; + message.certificateRevocationLists.push($root.google.cloud.security.privateca.v1.CertificateRevocationList.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateRevocationListsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateRevocationListsResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateRevocationListsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateRevocationLists != null && message.hasOwnProperty("certificateRevocationLists")) { + if (!Array.isArray(message.certificateRevocationLists)) + return "certificateRevocationLists: array expected"; + for (var i = 0; i < message.certificateRevocationLists.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.CertificateRevocationList.verify(message.certificateRevocationLists[i]); + if (error) + return "certificateRevocationLists." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCertificateRevocationListsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse + */ + ListCertificateRevocationListsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse(); + if (object.certificateRevocationLists) { + if (!Array.isArray(object.certificateRevocationLists)) + throw TypeError(".google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.certificateRevocationLists: array expected"); + message.certificateRevocationLists = []; + for (var i = 0; i < object.certificateRevocationLists.length; ++i) { + if (typeof object.certificateRevocationLists[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.certificateRevocationLists: object expected"); + message.certificateRevocationLists[i] = $root.google.cloud.security.privateca.v1.CertificateRevocationList.fromObject(object.certificateRevocationLists[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCertificateRevocationListsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @static + * @param {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateRevocationListsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.certificateRevocationLists = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.certificateRevocationLists && message.certificateRevocationLists.length) { + object.certificateRevocationLists = []; + for (var j = 0; j < message.certificateRevocationLists.length; ++j) + object.certificateRevocationLists[j] = $root.google.cloud.security.privateca.v1.CertificateRevocationList.toObject(message.certificateRevocationLists[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCertificateRevocationListsResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCertificateRevocationListsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateRevocationListsResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateRevocationListsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse"; + }; + + return ListCertificateRevocationListsResponse; + })(); + + v1.UpdateCertificateRevocationListRequest = (function() { + + /** + * Properties of an UpdateCertificateRevocationListRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IUpdateCertificateRevocationListRequest + * @property {google.cloud.security.privateca.v1.ICertificateRevocationList|null} [certificateRevocationList] UpdateCertificateRevocationListRequest certificateRevocationList + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateRevocationListRequest updateMask + * @property {string|null} [requestId] UpdateCertificateRevocationListRequest requestId + */ + + /** + * Constructs a new UpdateCertificateRevocationListRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an UpdateCertificateRevocationListRequest. + * @implements IUpdateCertificateRevocationListRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest=} [properties] Properties to set + */ + function UpdateCertificateRevocationListRequest(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]]; + } + + /** + * UpdateCertificateRevocationListRequest certificateRevocationList. + * @member {google.cloud.security.privateca.v1.ICertificateRevocationList|null|undefined} certificateRevocationList + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @instance + */ + UpdateCertificateRevocationListRequest.prototype.certificateRevocationList = null; + + /** + * UpdateCertificateRevocationListRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @instance + */ + UpdateCertificateRevocationListRequest.prototype.updateMask = null; + + /** + * UpdateCertificateRevocationListRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @instance + */ + UpdateCertificateRevocationListRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateCertificateRevocationListRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest instance + */ + UpdateCertificateRevocationListRequest.create = function create(properties) { + return new UpdateCertificateRevocationListRequest(properties); + }; + + /** + * Encodes the specified UpdateCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateRevocationListRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateRevocationList != null && Object.hasOwnProperty.call(message, "certificateRevocationList")) + $root.google.cloud.security.privateca.v1.CertificateRevocationList.encode(message.certificateRevocationList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateRevocationListRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateRevocationListRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.certificateRevocationList = $root.google.cloud.security.privateca.v1.CertificateRevocationList.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateRevocationListRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCertificateRevocationListRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCertificateRevocationListRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateRevocationList != null && message.hasOwnProperty("certificateRevocationList")) { + var error = $root.google.cloud.security.privateca.v1.CertificateRevocationList.verify(message.certificateRevocationList); + if (error) + return "certificateRevocationList." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest + */ + UpdateCertificateRevocationListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(); + if (object.certificateRevocationList != null) { + if (typeof object.certificateRevocationList !== "object") + throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.certificateRevocationList: object expected"); + message.certificateRevocationList = $root.google.cloud.security.privateca.v1.CertificateRevocationList.fromObject(object.certificateRevocationList); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateCertificateRevocationListRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCertificateRevocationListRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificateRevocationList = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.certificateRevocationList != null && message.hasOwnProperty("certificateRevocationList")) + object.certificateRevocationList = $root.google.cloud.security.privateca.v1.CertificateRevocationList.toObject(message.certificateRevocationList, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateCertificateRevocationListRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCertificateRevocationListRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCertificateRevocationListRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCertificateRevocationListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest"; + }; + + return UpdateCertificateRevocationListRequest; + })(); + + v1.CreateCertificateTemplateRequest = (function() { + + /** + * Properties of a CreateCertificateTemplateRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface ICreateCertificateTemplateRequest + * @property {string|null} [parent] CreateCertificateTemplateRequest parent + * @property {string|null} [certificateTemplateId] CreateCertificateTemplateRequest certificateTemplateId + * @property {google.cloud.security.privateca.v1.ICertificateTemplate|null} [certificateTemplate] CreateCertificateTemplateRequest certificateTemplate + * @property {string|null} [requestId] CreateCertificateTemplateRequest requestId + */ + + /** + * Constructs a new CreateCertificateTemplateRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a CreateCertificateTemplateRequest. + * @implements ICreateCertificateTemplateRequest + * @constructor + * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest=} [properties] Properties to set + */ + function CreateCertificateTemplateRequest(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]]; + } + + /** + * CreateCertificateTemplateRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @instance + */ + CreateCertificateTemplateRequest.prototype.parent = ""; + + /** + * CreateCertificateTemplateRequest certificateTemplateId. + * @member {string} certificateTemplateId + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @instance + */ + CreateCertificateTemplateRequest.prototype.certificateTemplateId = ""; + + /** + * CreateCertificateTemplateRequest certificateTemplate. + * @member {google.cloud.security.privateca.v1.ICertificateTemplate|null|undefined} certificateTemplate + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @instance + */ + CreateCertificateTemplateRequest.prototype.certificateTemplate = null; + + /** + * CreateCertificateTemplateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @instance + */ + CreateCertificateTemplateRequest.prototype.requestId = ""; + + /** + * Creates a new CreateCertificateTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.CreateCertificateTemplateRequest} CreateCertificateTemplateRequest instance + */ + CreateCertificateTemplateRequest.create = function create(properties) { + return new CreateCertificateTemplateRequest(properties); + }; + + /** + * Encodes the specified CreateCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest} message CreateCertificateTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.certificateTemplateId != null && Object.hasOwnProperty.call(message, "certificateTemplateId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateTemplateId); + if (message.certificateTemplate != null && Object.hasOwnProperty.call(message, "certificateTemplate")) + $root.google.cloud.security.privateca.v1.CertificateTemplate.encode(message.certificateTemplate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest} message CreateCertificateTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCertificateTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.CreateCertificateTemplateRequest} CreateCertificateTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.certificateTemplateId = reader.string(); + break; + } + case 3: { + message.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCertificateTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.CreateCertificateTemplateRequest} CreateCertificateTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCertificateTemplateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCertificateTemplateRequest.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.certificateTemplateId != null && message.hasOwnProperty("certificateTemplateId")) + if (!$util.isString(message.certificateTemplateId)) + return "certificateTemplateId: string expected"; + if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) { + var error = $root.google.cloud.security.privateca.v1.CertificateTemplate.verify(message.certificateTemplate); + if (error) + return "certificateTemplate." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.CreateCertificateTemplateRequest} CreateCertificateTemplateRequest + */ + CreateCertificateTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.certificateTemplateId != null) + message.certificateTemplateId = String(object.certificateTemplateId); + if (object.certificateTemplate != null) { + if (typeof object.certificateTemplate !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CreateCertificateTemplateRequest.certificateTemplate: object expected"); + message.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.fromObject(object.certificateTemplate); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateCertificateTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.CreateCertificateTemplateRequest} message CreateCertificateTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCertificateTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.certificateTemplateId = ""; + object.certificateTemplate = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.certificateTemplateId != null && message.hasOwnProperty("certificateTemplateId")) + object.certificateTemplateId = message.certificateTemplateId; + if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) + object.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.toObject(message.certificateTemplate, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateCertificateTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCertificateTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCertificateTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCertificateTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.CreateCertificateTemplateRequest"; + }; + + return CreateCertificateTemplateRequest; + })(); + + v1.DeleteCertificateTemplateRequest = (function() { + + /** + * Properties of a DeleteCertificateTemplateRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IDeleteCertificateTemplateRequest + * @property {string|null} [name] DeleteCertificateTemplateRequest name + * @property {string|null} [requestId] DeleteCertificateTemplateRequest requestId + */ + + /** + * Constructs a new DeleteCertificateTemplateRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a DeleteCertificateTemplateRequest. + * @implements IDeleteCertificateTemplateRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest=} [properties] Properties to set + */ + function DeleteCertificateTemplateRequest(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]]; + } + + /** + * DeleteCertificateTemplateRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @instance + */ + DeleteCertificateTemplateRequest.prototype.name = ""; + + /** + * DeleteCertificateTemplateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @instance + */ + DeleteCertificateTemplateRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteCertificateTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest} DeleteCertificateTemplateRequest instance + */ + DeleteCertificateTemplateRequest.create = function create(properties) { + return new DeleteCertificateTemplateRequest(properties); + }; + + /** + * Encodes the specified DeleteCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest} message DeleteCertificateTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest} message DeleteCertificateTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCertificateTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest} DeleteCertificateTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCertificateTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest} DeleteCertificateTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCertificateTemplateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCertificateTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest} DeleteCertificateTemplateRequest + */ + DeleteCertificateTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteCertificateTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest} message DeleteCertificateTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCertificateTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteCertificateTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCertificateTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCertificateTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCertificateTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest"; + }; + + return DeleteCertificateTemplateRequest; + })(); + + v1.GetCertificateTemplateRequest = (function() { + + /** + * Properties of a GetCertificateTemplateRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IGetCertificateTemplateRequest + * @property {string|null} [name] GetCertificateTemplateRequest name + */ + + /** + * Constructs a new GetCertificateTemplateRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a GetCertificateTemplateRequest. + * @implements IGetCertificateTemplateRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest=} [properties] Properties to set + */ + function GetCertificateTemplateRequest(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]]; + } + + /** + * GetCertificateTemplateRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest + * @instance + */ + GetCertificateTemplateRequest.prototype.name = ""; + + /** + * Creates a new GetCertificateTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.GetCertificateTemplateRequest} GetCertificateTemplateRequest instance + */ + GetCertificateTemplateRequest.create = function create(properties) { + return new GetCertificateTemplateRequest(properties); + }; + + /** + * Encodes the specified GetCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest} message GetCertificateTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest} message GetCertificateTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCertificateTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.GetCertificateTemplateRequest} GetCertificateTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCertificateTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.GetCertificateTemplateRequest} GetCertificateTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCertificateTemplateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCertificateTemplateRequest.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 GetCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.GetCertificateTemplateRequest} GetCertificateTemplateRequest + */ + GetCertificateTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.GetCertificateTemplateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCertificateTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.GetCertificateTemplateRequest} message GetCertificateTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCertificateTemplateRequest.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 GetCertificateTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + GetCertificateTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCertificateTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCertificateTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.GetCertificateTemplateRequest"; + }; + + return GetCertificateTemplateRequest; + })(); + + v1.ListCertificateTemplatesRequest = (function() { + + /** + * Properties of a ListCertificateTemplatesRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IListCertificateTemplatesRequest + * @property {string|null} [parent] ListCertificateTemplatesRequest parent + * @property {number|null} [pageSize] ListCertificateTemplatesRequest pageSize + * @property {string|null} [pageToken] ListCertificateTemplatesRequest pageToken + * @property {string|null} [filter] ListCertificateTemplatesRequest filter + * @property {string|null} [orderBy] ListCertificateTemplatesRequest orderBy + */ + + /** + * Constructs a new ListCertificateTemplatesRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a ListCertificateTemplatesRequest. + * @implements IListCertificateTemplatesRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest=} [properties] Properties to set + */ + function ListCertificateTemplatesRequest(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]]; + } + + /** + * ListCertificateTemplatesRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @instance + */ + ListCertificateTemplatesRequest.prototype.parent = ""; + + /** + * ListCertificateTemplatesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @instance + */ + ListCertificateTemplatesRequest.prototype.pageSize = 0; + + /** + * ListCertificateTemplatesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @instance + */ + ListCertificateTemplatesRequest.prototype.pageToken = ""; + + /** + * ListCertificateTemplatesRequest filter. + * @member {string} filter + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @instance + */ + ListCertificateTemplatesRequest.prototype.filter = ""; + + /** + * ListCertificateTemplatesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @instance + */ + ListCertificateTemplatesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCertificateTemplatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesRequest} ListCertificateTemplatesRequest instance + */ + ListCertificateTemplatesRequest.create = function create(properties) { + return new ListCertificateTemplatesRequest(properties); + }; + + /** + * Encodes the specified ListCertificateTemplatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest} message ListCertificateTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateTemplatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCertificateTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest} message ListCertificateTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateTemplatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesRequest} ListCertificateTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateTemplatesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListCertificateTemplatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesRequest} ListCertificateTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateTemplatesRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateTemplatesRequest.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 ListCertificateTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesRequest} ListCertificateTemplatesRequest + */ + ListCertificateTemplatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCertificateTemplatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @static + * @param {google.cloud.security.privateca.v1.ListCertificateTemplatesRequest} message ListCertificateTemplatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateTemplatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCertificateTemplatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCertificateTemplatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateTemplatesRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateTemplatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateTemplatesRequest"; + }; + + return ListCertificateTemplatesRequest; + })(); + + v1.ListCertificateTemplatesResponse = (function() { + + /** + * Properties of a ListCertificateTemplatesResponse. + * @memberof google.cloud.security.privateca.v1 + * @interface IListCertificateTemplatesResponse + * @property {Array.|null} [certificateTemplates] ListCertificateTemplatesResponse certificateTemplates + * @property {string|null} [nextPageToken] ListCertificateTemplatesResponse nextPageToken + * @property {Array.|null} [unreachable] ListCertificateTemplatesResponse unreachable + */ + + /** + * Constructs a new ListCertificateTemplatesResponse. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents a ListCertificateTemplatesResponse. + * @implements IListCertificateTemplatesResponse + * @constructor + * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesResponse=} [properties] Properties to set + */ + function ListCertificateTemplatesResponse(properties) { + this.certificateTemplates = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCertificateTemplatesResponse certificateTemplates. + * @member {Array.} certificateTemplates + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @instance + */ + ListCertificateTemplatesResponse.prototype.certificateTemplates = $util.emptyArray; + + /** + * ListCertificateTemplatesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @instance + */ + ListCertificateTemplatesResponse.prototype.nextPageToken = ""; + + /** + * ListCertificateTemplatesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @instance + */ + ListCertificateTemplatesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCertificateTemplatesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} ListCertificateTemplatesResponse instance + */ + ListCertificateTemplatesResponse.create = function create(properties) { + return new ListCertificateTemplatesResponse(properties); + }; + + /** + * Encodes the specified ListCertificateTemplatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesResponse} message ListCertificateTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateTemplatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateTemplates != null && message.certificateTemplates.length) + for (var i = 0; i < message.certificateTemplates.length; ++i) + $root.google.cloud.security.privateca.v1.CertificateTemplate.encode(message.certificateTemplates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCertificateTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @static + * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesResponse} message ListCertificateTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateTemplatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateTemplatesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} ListCertificateTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateTemplatesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.certificateTemplates && message.certificateTemplates.length)) + message.certificateTemplates = []; + message.certificateTemplates.push($root.google.cloud.security.privateca.v1.CertificateTemplate.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificateTemplatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} ListCertificateTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateTemplatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateTemplatesResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateTemplatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateTemplates != null && message.hasOwnProperty("certificateTemplates")) { + if (!Array.isArray(message.certificateTemplates)) + return "certificateTemplates: array expected"; + for (var i = 0; i < message.certificateTemplates.length; ++i) { + var error = $root.google.cloud.security.privateca.v1.CertificateTemplate.verify(message.certificateTemplates[i]); + if (error) + return "certificateTemplates." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCertificateTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} ListCertificateTemplatesResponse + */ + ListCertificateTemplatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse(); + if (object.certificateTemplates) { + if (!Array.isArray(object.certificateTemplates)) + throw TypeError(".google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.certificateTemplates: array expected"); + message.certificateTemplates = []; + for (var i = 0; i < object.certificateTemplates.length; ++i) { + if (typeof object.certificateTemplates[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.certificateTemplates: object expected"); + message.certificateTemplates[i] = $root.google.cloud.security.privateca.v1.CertificateTemplate.fromObject(object.certificateTemplates[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCertificateTemplatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @static + * @param {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} message ListCertificateTemplatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateTemplatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.certificateTemplates = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.certificateTemplates && message.certificateTemplates.length) { + object.certificateTemplates = []; + for (var j = 0; j < message.certificateTemplates.length; ++j) + object.certificateTemplates[j] = $root.google.cloud.security.privateca.v1.CertificateTemplate.toObject(message.certificateTemplates[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCertificateTemplatesResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCertificateTemplatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateTemplatesResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateTemplatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateTemplatesResponse"; + }; + + return ListCertificateTemplatesResponse; + })(); + + v1.UpdateCertificateTemplateRequest = (function() { + + /** + * Properties of an UpdateCertificateTemplateRequest. + * @memberof google.cloud.security.privateca.v1 + * @interface IUpdateCertificateTemplateRequest + * @property {google.cloud.security.privateca.v1.ICertificateTemplate|null} [certificateTemplate] UpdateCertificateTemplateRequest certificateTemplate + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateTemplateRequest updateMask + * @property {string|null} [requestId] UpdateCertificateTemplateRequest requestId + */ + + /** + * Constructs a new UpdateCertificateTemplateRequest. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an UpdateCertificateTemplateRequest. + * @implements IUpdateCertificateTemplateRequest + * @constructor + * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest=} [properties] Properties to set + */ + function UpdateCertificateTemplateRequest(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]]; + } + + /** + * UpdateCertificateTemplateRequest certificateTemplate. + * @member {google.cloud.security.privateca.v1.ICertificateTemplate|null|undefined} certificateTemplate + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @instance + */ + UpdateCertificateTemplateRequest.prototype.certificateTemplate = null; + + /** + * UpdateCertificateTemplateRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @instance + */ + UpdateCertificateTemplateRequest.prototype.updateMask = null; + + /** + * UpdateCertificateTemplateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @instance + */ + UpdateCertificateTemplateRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateCertificateTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest} UpdateCertificateTemplateRequest instance + */ + UpdateCertificateTemplateRequest.create = function create(properties) { + return new UpdateCertificateTemplateRequest(properties); + }; + + /** + * Encodes the specified UpdateCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest} message UpdateCertificateTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateTemplate != null && Object.hasOwnProperty.call(message, "certificateTemplate")) + $root.google.cloud.security.privateca.v1.CertificateTemplate.encode(message.certificateTemplate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest} message UpdateCertificateTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCertificateTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest} UpdateCertificateTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCertificateTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest} UpdateCertificateTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCertificateTemplateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCertificateTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) { + var error = $root.google.cloud.security.privateca.v1.CertificateTemplate.verify(message.certificateTemplate); + if (error) + return "certificateTemplate." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest} UpdateCertificateTemplateRequest + */ + UpdateCertificateTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(); + if (object.certificateTemplate != null) { + if (typeof object.certificateTemplate !== "object") + throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.certificateTemplate: object expected"); + message.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.fromObject(object.certificateTemplate); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateCertificateTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @static + * @param {google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest} message UpdateCertificateTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCertificateTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificateTemplate = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) + object.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.toObject(message.certificateTemplate, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateCertificateTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCertificateTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCertificateTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCertificateTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest"; + }; + + return UpdateCertificateTemplateRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.security.privateca.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.security.privateca.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @static + * @param {google.cloud.security.privateca.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.security.privateca.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @static + * @param {google.cloud.security.privateca.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @static + * @param {google.cloud.security.privateca.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.security.privateca.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @static + * @param {google.cloud.security.privateca.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + return v1; + })(); + + privateca.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.security.privateca + * @namespace + */ + var v1beta1 = {}; + + v1beta1.CertificateAuthority = (function() { + + /** + * Properties of a CertificateAuthority. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface ICertificateAuthority + * @property {string|null} [name] CertificateAuthority name + * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.Type|null} [type] CertificateAuthority type + * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier|null} [tier] CertificateAuthority tier + * @property {google.cloud.security.privateca.v1beta1.ICertificateConfig|null} [config] CertificateAuthority config + * @property {google.protobuf.IDuration|null} [lifetime] CertificateAuthority lifetime + * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec|null} [keySpec] CertificateAuthority keySpec + * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy|null} [certificatePolicy] CertificateAuthority certificatePolicy + * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions|null} [issuingOptions] CertificateAuthority issuingOptions + * @property {google.cloud.security.privateca.v1beta1.ISubordinateConfig|null} [subordinateConfig] CertificateAuthority subordinateConfig + * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.State|null} [state] CertificateAuthority state + * @property {Array.|null} [pemCaCertificates] CertificateAuthority pemCaCertificates + * @property {Array.|null} [caCertificateDescriptions] CertificateAuthority caCertificateDescriptions + * @property {string|null} [gcsBucket] CertificateAuthority gcsBucket + * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls|null} [accessUrls] CertificateAuthority accessUrls + * @property {google.protobuf.ITimestamp|null} [createTime] CertificateAuthority createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateAuthority updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] CertificateAuthority deleteTime + * @property {Object.|null} [labels] CertificateAuthority labels + */ + + /** + * Constructs a new CertificateAuthority. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a CertificateAuthority. + * @implements ICertificateAuthority + * @constructor + * @param {google.cloud.security.privateca.v1beta1.ICertificateAuthority=} [properties] Properties to set + */ + function CertificateAuthority(properties) { + this.pemCaCertificates = []; + this.caCertificateDescriptions = []; + 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]]; + } + + /** + * CertificateAuthority name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.name = ""; + + /** + * CertificateAuthority type. + * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.Type} type + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.type = 0; + + /** + * CertificateAuthority tier. + * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier} tier + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.tier = 0; + + /** + * CertificateAuthority config. + * @member {google.cloud.security.privateca.v1beta1.ICertificateConfig|null|undefined} config + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.config = null; + + /** + * CertificateAuthority lifetime. + * @member {google.protobuf.IDuration|null|undefined} lifetime + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.lifetime = null; + + /** + * CertificateAuthority keySpec. + * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec|null|undefined} keySpec + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.keySpec = null; + + /** + * CertificateAuthority certificatePolicy. + * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy|null|undefined} certificatePolicy + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.certificatePolicy = null; + + /** + * CertificateAuthority issuingOptions. + * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions|null|undefined} issuingOptions + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.issuingOptions = null; + + /** + * CertificateAuthority subordinateConfig. + * @member {google.cloud.security.privateca.v1beta1.ISubordinateConfig|null|undefined} subordinateConfig + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.subordinateConfig = null; + + /** + * CertificateAuthority state. + * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.State} state + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.state = 0; + + /** + * CertificateAuthority pemCaCertificates. + * @member {Array.} pemCaCertificates + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.pemCaCertificates = $util.emptyArray; + + /** + * CertificateAuthority caCertificateDescriptions. + * @member {Array.} caCertificateDescriptions + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.caCertificateDescriptions = $util.emptyArray; + + /** + * CertificateAuthority gcsBucket. + * @member {string} gcsBucket + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.gcsBucket = ""; + + /** + * CertificateAuthority accessUrls. + * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls|null|undefined} accessUrls + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.accessUrls = null; + + /** + * CertificateAuthority createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.createTime = null; + + /** + * CertificateAuthority updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.updateTime = null; + + /** + * CertificateAuthority deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.deleteTime = null; + + /** + * CertificateAuthority labels. + * @member {Object.} labels + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + */ + CertificateAuthority.prototype.labels = $util.emptyObject; + + /** + * Creates a new CertificateAuthority instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateAuthority=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority} CertificateAuthority instance + */ + CertificateAuthority.create = function create(properties) { + return new CertificateAuthority(properties); + }; + + /** + * Encodes the specified CertificateAuthority message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateAuthority} message CertificateAuthority message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateAuthority.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.tier); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.security.privateca.v1beta1.CertificateConfig.encode(message.config, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) + $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.keySpec != null && Object.hasOwnProperty.call(message, "keySpec")) + $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.encode(message.keySpec, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.certificatePolicy != null && Object.hasOwnProperty.call(message, "certificatePolicy")) + $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.encode(message.certificatePolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.issuingOptions != null && Object.hasOwnProperty.call(message, "issuingOptions")) + $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.encode(message.issuingOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.pemCaCertificates != null && message.pemCaCertificates.length) + for (var i = 0; i < message.pemCaCertificates.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.pemCaCertificates[i]); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.caCertificateDescriptions != null && message.caCertificateDescriptions.length) + for (var i = 0; i < message.caCertificateDescriptions.length; ++i) + $root.google.cloud.security.privateca.v1beta1.CertificateDescription.encode(message.caCertificateDescriptions[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.gcsBucket); + if (message.accessUrls != null && Object.hasOwnProperty.call(message, "accessUrls")) + $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.encode(message.accessUrls, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.subordinateConfig != null && Object.hasOwnProperty.call(message, "subordinateConfig")) + $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.encode(message.subordinateConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CertificateAuthority message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateAuthority} message CertificateAuthority message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateAuthority.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateAuthority message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority} CertificateAuthority + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateAuthority.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.tier = reader.int32(); + break; + } + case 4: { + message.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.keySpec = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.decode(reader, reader.uint32()); + break; + } + case 7: { + message.certificatePolicy = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + message.issuingOptions = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.decode(reader, reader.uint32()); + break; + } + case 19: { + message.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 9: { + if (!(message.pemCaCertificates && message.pemCaCertificates.length)) + message.pemCaCertificates = []; + message.pemCaCertificates.push(reader.string()); + break; + } + case 12: { + if (!(message.caCertificateDescriptions && message.caCertificateDescriptions.length)) + message.caCertificateDescriptions = []; + message.caCertificateDescriptions.push($root.google.cloud.security.privateca.v1beta1.CertificateDescription.decode(reader, reader.uint32())); + break; + } + case 13: { + message.gcsBucket = reader.string(); + break; + } + case 14: { + message.accessUrls = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.decode(reader, reader.uint32()); + break; + } + case 15: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 16: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 18: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateAuthority message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority} CertificateAuthority + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateAuthority.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateAuthority message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateAuthority.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.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.tier != null && message.hasOwnProperty("tier")) + switch (message.tier) { + default: + return "tier: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.lifetime != null && message.hasOwnProperty("lifetime")) { + var error = $root.google.protobuf.Duration.verify(message.lifetime); + if (error) + return "lifetime." + error; + } + if (message.keySpec != null && message.hasOwnProperty("keySpec")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.verify(message.keySpec); + if (error) + return "keySpec." + error; + } + if (message.certificatePolicy != null && message.hasOwnProperty("certificatePolicy")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.verify(message.certificatePolicy); + if (error) + return "certificatePolicy." + error; + } + if (message.issuingOptions != null && message.hasOwnProperty("issuingOptions")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.verify(message.issuingOptions); + if (error) + return "issuingOptions." + error; + } + if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) { + var error = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.verify(message.subordinateConfig); + if (error) + return "subordinateConfig." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.pemCaCertificates != null && message.hasOwnProperty("pemCaCertificates")) { + if (!Array.isArray(message.pemCaCertificates)) + return "pemCaCertificates: array expected"; + for (var i = 0; i < message.pemCaCertificates.length; ++i) + if (!$util.isString(message.pemCaCertificates[i])) + return "pemCaCertificates: string[] expected"; + } + if (message.caCertificateDescriptions != null && message.hasOwnProperty("caCertificateDescriptions")) { + if (!Array.isArray(message.caCertificateDescriptions)) + return "caCertificateDescriptions: array expected"; + for (var i = 0; i < message.caCertificateDescriptions.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.verify(message.caCertificateDescriptions[i]); + if (error) + return "caCertificateDescriptions." + error; + } + } + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + if (!$util.isString(message.gcsBucket)) + return "gcsBucket: string expected"; + if (message.accessUrls != null && message.hasOwnProperty("accessUrls")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.verify(message.accessUrls); + if (error) + return "accessUrls." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + 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 CertificateAuthority message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority} CertificateAuthority + */ + CertificateAuthority.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SELF_SIGNED": + case 1: + message.type = 1; + break; + case "SUBORDINATE": + case 2: + message.type = 2; + break; + } + switch (object.tier) { + default: + if (typeof object.tier === "number") { + message.tier = object.tier; + break; + } + break; + case "TIER_UNSPECIFIED": + case 0: + message.tier = 0; + break; + case "ENTERPRISE": + case 1: + message.tier = 1; + break; + case "DEVOPS": + case 2: + message.tier = 2; + break; + } + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.config: object expected"); + message.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.fromObject(object.config); + } + if (object.lifetime != null) { + if (typeof object.lifetime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.lifetime: object expected"); + message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); + } + if (object.keySpec != null) { + if (typeof object.keySpec !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.keySpec: object expected"); + message.keySpec = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.fromObject(object.keySpec); + } + if (object.certificatePolicy != null) { + if (typeof object.certificatePolicy !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.certificatePolicy: object expected"); + message.certificatePolicy = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.fromObject(object.certificatePolicy); + } + if (object.issuingOptions != null) { + if (typeof object.issuingOptions !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.issuingOptions: object expected"); + message.issuingOptions = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.fromObject(object.issuingOptions); + } + if (object.subordinateConfig != null) { + if (typeof object.subordinateConfig !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.subordinateConfig: object expected"); + message.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.fromObject(object.subordinateConfig); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ENABLED": + case 1: + message.state = 1; + break; + case "DISABLED": + case 2: + message.state = 2; + break; + case "PENDING_ACTIVATION": + case 3: + message.state = 3; + break; + case "PENDING_DELETION": + case 4: + message.state = 4; + break; + } + if (object.pemCaCertificates) { + if (!Array.isArray(object.pemCaCertificates)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.pemCaCertificates: array expected"); + message.pemCaCertificates = []; + for (var i = 0; i < object.pemCaCertificates.length; ++i) + message.pemCaCertificates[i] = String(object.pemCaCertificates[i]); + } + if (object.caCertificateDescriptions) { + if (!Array.isArray(object.caCertificateDescriptions)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.caCertificateDescriptions: array expected"); + message.caCertificateDescriptions = []; + for (var i = 0; i < object.caCertificateDescriptions.length; ++i) { + if (typeof object.caCertificateDescriptions[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.caCertificateDescriptions: object expected"); + message.caCertificateDescriptions[i] = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.fromObject(object.caCertificateDescriptions[i]); + } + } + if (object.gcsBucket != null) + message.gcsBucket = String(object.gcsBucket); + if (object.accessUrls != null) { + if (typeof object.accessUrls !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.accessUrls: object expected"); + message.accessUrls = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.fromObject(object.accessUrls); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.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 CertificateAuthority message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority} message CertificateAuthority + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateAuthority.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pemCaCertificates = []; + object.caCertificateDescriptions = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; + object.config = null; + object.lifetime = null; + object.keySpec = null; + object.certificatePolicy = null; + object.issuingOptions = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.gcsBucket = ""; + object.accessUrls = null; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.subordinateConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type[message.type] === undefined ? message.type : $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type[message.type] : message.type; + if (message.tier != null && message.hasOwnProperty("tier")) + object.tier = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier[message.tier] === undefined ? message.tier : $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier[message.tier] : message.tier; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.toObject(message.config, options); + if (message.lifetime != null && message.hasOwnProperty("lifetime")) + object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); + if (message.keySpec != null && message.hasOwnProperty("keySpec")) + object.keySpec = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.toObject(message.keySpec, options); + if (message.certificatePolicy != null && message.hasOwnProperty("certificatePolicy")) + object.certificatePolicy = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.toObject(message.certificatePolicy, options); + if (message.issuingOptions != null && message.hasOwnProperty("issuingOptions")) + object.issuingOptions = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.toObject(message.issuingOptions, options); + if (message.pemCaCertificates && message.pemCaCertificates.length) { + object.pemCaCertificates = []; + for (var j = 0; j < message.pemCaCertificates.length; ++j) + object.pemCaCertificates[j] = message.pemCaCertificates[j]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.State[message.state] === undefined ? message.state : $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.State[message.state] : message.state; + if (message.caCertificateDescriptions && message.caCertificateDescriptions.length) { + object.caCertificateDescriptions = []; + for (var j = 0; j < message.caCertificateDescriptions.length; ++j) + object.caCertificateDescriptions[j] = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.toObject(message.caCertificateDescriptions[j], options); + } + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + object.gcsBucket = message.gcsBucket; + if (message.accessUrls != null && message.hasOwnProperty("accessUrls")) + object.accessUrls = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.toObject(message.accessUrls, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) + object.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.toObject(message.subordinateConfig, options); + return object; + }; + + /** + * Converts this CertificateAuthority to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @instance + * @returns {Object.} JSON object + */ + CertificateAuthority.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateAuthority + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateAuthority.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority"; + }; + + CertificateAuthority.IssuingOptions = (function() { + + /** + * Properties of an IssuingOptions. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @interface IIssuingOptions + * @property {boolean|null} [includeCaCertUrl] IssuingOptions includeCaCertUrl + * @property {boolean|null} [includeCrlAccessUrl] IssuingOptions includeCrlAccessUrl + */ + + /** + * Constructs a new IssuingOptions. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @classdesc Represents an IssuingOptions. + * @implements IIssuingOptions + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions=} [properties] Properties to set + */ + function IssuingOptions(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]]; + } + + /** + * IssuingOptions includeCaCertUrl. + * @member {boolean} includeCaCertUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @instance + */ + IssuingOptions.prototype.includeCaCertUrl = false; + + /** + * IssuingOptions includeCrlAccessUrl. + * @member {boolean} includeCrlAccessUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @instance + */ + IssuingOptions.prototype.includeCrlAccessUrl = false; + + /** + * Creates a new IssuingOptions instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions} IssuingOptions instance + */ + IssuingOptions.create = function create(properties) { + return new IssuingOptions(properties); + }; + + /** + * Encodes the specified IssuingOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions} message IssuingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IssuingOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includeCaCertUrl != null && Object.hasOwnProperty.call(message, "includeCaCertUrl")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.includeCaCertUrl); + if (message.includeCrlAccessUrl != null && Object.hasOwnProperty.call(message, "includeCrlAccessUrl")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeCrlAccessUrl); + return writer; + }; + + /** + * Encodes the specified IssuingOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions} message IssuingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IssuingOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IssuingOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions} IssuingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IssuingOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.includeCaCertUrl = reader.bool(); + break; + } + case 2: { + message.includeCrlAccessUrl = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IssuingOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions} IssuingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IssuingOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IssuingOptions message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IssuingOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.includeCaCertUrl != null && message.hasOwnProperty("includeCaCertUrl")) + if (typeof message.includeCaCertUrl !== "boolean") + return "includeCaCertUrl: boolean expected"; + if (message.includeCrlAccessUrl != null && message.hasOwnProperty("includeCrlAccessUrl")) + if (typeof message.includeCrlAccessUrl !== "boolean") + return "includeCrlAccessUrl: boolean expected"; + return null; + }; + + /** + * Creates an IssuingOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions} IssuingOptions + */ + IssuingOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions(); + if (object.includeCaCertUrl != null) + message.includeCaCertUrl = Boolean(object.includeCaCertUrl); + if (object.includeCrlAccessUrl != null) + message.includeCrlAccessUrl = Boolean(object.includeCrlAccessUrl); + return message; + }; + + /** + * Creates a plain object from an IssuingOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions} message IssuingOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IssuingOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.includeCaCertUrl = false; + object.includeCrlAccessUrl = false; + } + if (message.includeCaCertUrl != null && message.hasOwnProperty("includeCaCertUrl")) + object.includeCaCertUrl = message.includeCaCertUrl; + if (message.includeCrlAccessUrl != null && message.hasOwnProperty("includeCrlAccessUrl")) + object.includeCrlAccessUrl = message.includeCrlAccessUrl; + return object; + }; + + /** + * Converts this IssuingOptions to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @instance + * @returns {Object.} JSON object + */ + IssuingOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IssuingOptions + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IssuingOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions"; + }; + + return IssuingOptions; + })(); + + CertificateAuthority.CertificateAuthorityPolicy = (function() { + + /** + * Properties of a CertificateAuthorityPolicy. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @interface ICertificateAuthorityPolicy + * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList|null} [allowedConfigList] CertificateAuthorityPolicy allowedConfigList + * @property {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null} [overwriteConfigValues] CertificateAuthorityPolicy overwriteConfigValues + * @property {Array.|null} [allowedLocationsAndOrganizations] CertificateAuthorityPolicy allowedLocationsAndOrganizations + * @property {Array.|null} [allowedCommonNames] CertificateAuthorityPolicy allowedCommonNames + * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames|null} [allowedSans] CertificateAuthorityPolicy allowedSans + * @property {google.protobuf.IDuration|null} [maximumLifetime] CertificateAuthorityPolicy maximumLifetime + * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes|null} [allowedIssuanceModes] CertificateAuthorityPolicy allowedIssuanceModes + */ + + /** + * Constructs a new CertificateAuthorityPolicy. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @classdesc Represents a CertificateAuthorityPolicy. + * @implements ICertificateAuthorityPolicy + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy=} [properties] Properties to set + */ + function CertificateAuthorityPolicy(properties) { + this.allowedLocationsAndOrganizations = []; + this.allowedCommonNames = []; + 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]]; + } + + /** + * CertificateAuthorityPolicy allowedConfigList. + * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList|null|undefined} allowedConfigList + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @instance + */ + CertificateAuthorityPolicy.prototype.allowedConfigList = null; + + /** + * CertificateAuthorityPolicy overwriteConfigValues. + * @member {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null|undefined} overwriteConfigValues + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @instance + */ + CertificateAuthorityPolicy.prototype.overwriteConfigValues = null; + + /** + * CertificateAuthorityPolicy allowedLocationsAndOrganizations. + * @member {Array.} allowedLocationsAndOrganizations + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @instance + */ + CertificateAuthorityPolicy.prototype.allowedLocationsAndOrganizations = $util.emptyArray; + + /** + * CertificateAuthorityPolicy allowedCommonNames. + * @member {Array.} allowedCommonNames + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @instance + */ + CertificateAuthorityPolicy.prototype.allowedCommonNames = $util.emptyArray; + + /** + * CertificateAuthorityPolicy allowedSans. + * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames|null|undefined} allowedSans + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @instance + */ + CertificateAuthorityPolicy.prototype.allowedSans = null; + + /** + * CertificateAuthorityPolicy maximumLifetime. + * @member {google.protobuf.IDuration|null|undefined} maximumLifetime + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @instance + */ + CertificateAuthorityPolicy.prototype.maximumLifetime = null; + + /** + * CertificateAuthorityPolicy allowedIssuanceModes. + * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes|null|undefined} allowedIssuanceModes + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @instance + */ + CertificateAuthorityPolicy.prototype.allowedIssuanceModes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CertificateAuthorityPolicy configPolicy. + * @member {"allowedConfigList"|"overwriteConfigValues"|undefined} configPolicy + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @instance + */ + Object.defineProperty(CertificateAuthorityPolicy.prototype, "configPolicy", { + get: $util.oneOfGetter($oneOfFields = ["allowedConfigList", "overwriteConfigValues"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CertificateAuthorityPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy} CertificateAuthorityPolicy instance + */ + CertificateAuthorityPolicy.create = function create(properties) { + return new CertificateAuthorityPolicy(properties); + }; + + /** + * Encodes the specified CertificateAuthorityPolicy message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy} message CertificateAuthorityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateAuthorityPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedConfigList != null && Object.hasOwnProperty.call(message, "allowedConfigList")) + $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.encode(message.allowedConfigList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.overwriteConfigValues != null && Object.hasOwnProperty.call(message, "overwriteConfigValues")) + $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.encode(message.overwriteConfigValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allowedLocationsAndOrganizations != null && message.allowedLocationsAndOrganizations.length) + for (var i = 0; i < message.allowedLocationsAndOrganizations.length; ++i) + $root.google.cloud.security.privateca.v1beta1.Subject.encode(message.allowedLocationsAndOrganizations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowedCommonNames != null && message.allowedCommonNames.length) + for (var i = 0; i < message.allowedCommonNames.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.allowedCommonNames[i]); + if (message.allowedSans != null && Object.hasOwnProperty.call(message, "allowedSans")) + $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.encode(message.allowedSans, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.maximumLifetime != null && Object.hasOwnProperty.call(message, "maximumLifetime")) + $root.google.protobuf.Duration.encode(message.maximumLifetime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.allowedIssuanceModes != null && Object.hasOwnProperty.call(message, "allowedIssuanceModes")) + $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.encode(message.allowedIssuanceModes, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CertificateAuthorityPolicy message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy} message CertificateAuthorityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateAuthorityPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateAuthorityPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy} CertificateAuthorityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateAuthorityPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.allowedConfigList = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.decode(reader, reader.uint32()); + break; + } + case 2: { + message.overwriteConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.allowedLocationsAndOrganizations && message.allowedLocationsAndOrganizations.length)) + message.allowedLocationsAndOrganizations = []; + message.allowedLocationsAndOrganizations.push($root.google.cloud.security.privateca.v1beta1.Subject.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.allowedCommonNames && message.allowedCommonNames.length)) + message.allowedCommonNames = []; + message.allowedCommonNames.push(reader.string()); + break; + } + case 5: { + message.allowedSans = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.decode(reader, reader.uint32()); + break; + } + case 6: { + message.maximumLifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.allowedIssuanceModes = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateAuthorityPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy} CertificateAuthorityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateAuthorityPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateAuthorityPolicy message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateAuthorityPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allowedConfigList != null && message.hasOwnProperty("allowedConfigList")) { + properties.configPolicy = 1; + { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.verify(message.allowedConfigList); + if (error) + return "allowedConfigList." + error; + } + } + if (message.overwriteConfigValues != null && message.hasOwnProperty("overwriteConfigValues")) { + if (properties.configPolicy === 1) + return "configPolicy: multiple values"; + properties.configPolicy = 1; + { + var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify(message.overwriteConfigValues); + if (error) + return "overwriteConfigValues." + error; + } + } + if (message.allowedLocationsAndOrganizations != null && message.hasOwnProperty("allowedLocationsAndOrganizations")) { + if (!Array.isArray(message.allowedLocationsAndOrganizations)) + return "allowedLocationsAndOrganizations: array expected"; + for (var i = 0; i < message.allowedLocationsAndOrganizations.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.Subject.verify(message.allowedLocationsAndOrganizations[i]); + if (error) + return "allowedLocationsAndOrganizations." + error; + } + } + if (message.allowedCommonNames != null && message.hasOwnProperty("allowedCommonNames")) { + if (!Array.isArray(message.allowedCommonNames)) + return "allowedCommonNames: array expected"; + for (var i = 0; i < message.allowedCommonNames.length; ++i) + if (!$util.isString(message.allowedCommonNames[i])) + return "allowedCommonNames: string[] expected"; + } + if (message.allowedSans != null && message.hasOwnProperty("allowedSans")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.verify(message.allowedSans); + if (error) + return "allowedSans." + error; + } + if (message.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) { + var error = $root.google.protobuf.Duration.verify(message.maximumLifetime); + if (error) + return "maximumLifetime." + error; + } + if (message.allowedIssuanceModes != null && message.hasOwnProperty("allowedIssuanceModes")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.verify(message.allowedIssuanceModes); + if (error) + return "allowedIssuanceModes." + error; + } + return null; + }; + + /** + * Creates a CertificateAuthorityPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy} CertificateAuthorityPolicy + */ + CertificateAuthorityPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy(); + if (object.allowedConfigList != null) { + if (typeof object.allowedConfigList !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedConfigList: object expected"); + message.allowedConfigList = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.fromObject(object.allowedConfigList); + } + if (object.overwriteConfigValues != null) { + if (typeof object.overwriteConfigValues !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.overwriteConfigValues: object expected"); + message.overwriteConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.fromObject(object.overwriteConfigValues); + } + if (object.allowedLocationsAndOrganizations) { + if (!Array.isArray(object.allowedLocationsAndOrganizations)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedLocationsAndOrganizations: array expected"); + message.allowedLocationsAndOrganizations = []; + for (var i = 0; i < object.allowedLocationsAndOrganizations.length; ++i) { + if (typeof object.allowedLocationsAndOrganizations[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedLocationsAndOrganizations: object expected"); + message.allowedLocationsAndOrganizations[i] = $root.google.cloud.security.privateca.v1beta1.Subject.fromObject(object.allowedLocationsAndOrganizations[i]); + } + } + if (object.allowedCommonNames) { + if (!Array.isArray(object.allowedCommonNames)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedCommonNames: array expected"); + message.allowedCommonNames = []; + for (var i = 0; i < object.allowedCommonNames.length; ++i) + message.allowedCommonNames[i] = String(object.allowedCommonNames[i]); + } + if (object.allowedSans != null) { + if (typeof object.allowedSans !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedSans: object expected"); + message.allowedSans = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.fromObject(object.allowedSans); + } + if (object.maximumLifetime != null) { + if (typeof object.maximumLifetime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.maximumLifetime: object expected"); + message.maximumLifetime = $root.google.protobuf.Duration.fromObject(object.maximumLifetime); + } + if (object.allowedIssuanceModes != null) { + if (typeof object.allowedIssuanceModes !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedIssuanceModes: object expected"); + message.allowedIssuanceModes = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.fromObject(object.allowedIssuanceModes); + } + return message; + }; + + /** + * Creates a plain object from a CertificateAuthorityPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy} message CertificateAuthorityPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateAuthorityPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedLocationsAndOrganizations = []; + object.allowedCommonNames = []; + } + if (options.defaults) { + object.allowedSans = null; + object.maximumLifetime = null; + object.allowedIssuanceModes = null; + } + if (message.allowedConfigList != null && message.hasOwnProperty("allowedConfigList")) { + object.allowedConfigList = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.toObject(message.allowedConfigList, options); + if (options.oneofs) + object.configPolicy = "allowedConfigList"; + } + if (message.overwriteConfigValues != null && message.hasOwnProperty("overwriteConfigValues")) { + object.overwriteConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.toObject(message.overwriteConfigValues, options); + if (options.oneofs) + object.configPolicy = "overwriteConfigValues"; + } + if (message.allowedLocationsAndOrganizations && message.allowedLocationsAndOrganizations.length) { + object.allowedLocationsAndOrganizations = []; + for (var j = 0; j < message.allowedLocationsAndOrganizations.length; ++j) + object.allowedLocationsAndOrganizations[j] = $root.google.cloud.security.privateca.v1beta1.Subject.toObject(message.allowedLocationsAndOrganizations[j], options); + } + if (message.allowedCommonNames && message.allowedCommonNames.length) { + object.allowedCommonNames = []; + for (var j = 0; j < message.allowedCommonNames.length; ++j) + object.allowedCommonNames[j] = message.allowedCommonNames[j]; + } + if (message.allowedSans != null && message.hasOwnProperty("allowedSans")) + object.allowedSans = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.toObject(message.allowedSans, options); + if (message.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) + object.maximumLifetime = $root.google.protobuf.Duration.toObject(message.maximumLifetime, options); + if (message.allowedIssuanceModes != null && message.hasOwnProperty("allowedIssuanceModes")) + object.allowedIssuanceModes = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.toObject(message.allowedIssuanceModes, options); + return object; + }; + + /** + * Converts this CertificateAuthorityPolicy to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @instance + * @returns {Object.} JSON object + */ + CertificateAuthorityPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateAuthorityPolicy + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateAuthorityPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy"; + }; + + CertificateAuthorityPolicy.AllowedConfigList = (function() { + + /** + * Properties of an AllowedConfigList. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @interface IAllowedConfigList + * @property {Array.|null} [allowedConfigValues] AllowedConfigList allowedConfigValues + */ + + /** + * Constructs a new AllowedConfigList. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @classdesc Represents an AllowedConfigList. + * @implements IAllowedConfigList + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList=} [properties] Properties to set + */ + function AllowedConfigList(properties) { + this.allowedConfigValues = []; + 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]]; + } + + /** + * AllowedConfigList allowedConfigValues. + * @member {Array.} allowedConfigValues + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList + * @instance + */ + AllowedConfigList.prototype.allowedConfigValues = $util.emptyArray; + + /** + * Creates a new AllowedConfigList instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList} AllowedConfigList instance + */ + AllowedConfigList.create = function create(properties) { + return new AllowedConfigList(properties); + }; + + /** + * Encodes the specified AllowedConfigList message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList} message AllowedConfigList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedConfigList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedConfigValues != null && message.allowedConfigValues.length) + for (var i = 0; i < message.allowedConfigValues.length; ++i) + $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.encode(message.allowedConfigValues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AllowedConfigList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList} message AllowedConfigList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedConfigList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllowedConfigList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList} AllowedConfigList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedConfigList.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.allowedConfigValues && message.allowedConfigValues.length)) + message.allowedConfigValues = []; + message.allowedConfigValues.push($root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllowedConfigList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList} AllowedConfigList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedConfigList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllowedConfigList message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllowedConfigList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedConfigValues != null && message.hasOwnProperty("allowedConfigValues")) { + if (!Array.isArray(message.allowedConfigValues)) + return "allowedConfigValues: array expected"; + for (var i = 0; i < message.allowedConfigValues.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify(message.allowedConfigValues[i]); + if (error) + return "allowedConfigValues." + error; + } + } + return null; + }; + + /** + * Creates an AllowedConfigList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList} AllowedConfigList + */ + AllowedConfigList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList(); + if (object.allowedConfigValues) { + if (!Array.isArray(object.allowedConfigValues)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.allowedConfigValues: array expected"); + message.allowedConfigValues = []; + for (var i = 0; i < object.allowedConfigValues.length; ++i) { + if (typeof object.allowedConfigValues[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.allowedConfigValues: object expected"); + message.allowedConfigValues[i] = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.fromObject(object.allowedConfigValues[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AllowedConfigList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList} message AllowedConfigList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllowedConfigList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedConfigValues = []; + if (message.allowedConfigValues && message.allowedConfigValues.length) { + object.allowedConfigValues = []; + for (var j = 0; j < message.allowedConfigValues.length; ++j) + object.allowedConfigValues[j] = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.toObject(message.allowedConfigValues[j], options); + } + return object; + }; + + /** + * Converts this AllowedConfigList to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList + * @instance + * @returns {Object.} JSON object + */ + AllowedConfigList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllowedConfigList + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllowedConfigList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList"; + }; + + return AllowedConfigList; + })(); + + CertificateAuthorityPolicy.AllowedSubjectAltNames = (function() { + + /** + * Properties of an AllowedSubjectAltNames. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @interface IAllowedSubjectAltNames + * @property {Array.|null} [allowedDnsNames] AllowedSubjectAltNames allowedDnsNames + * @property {Array.|null} [allowedUris] AllowedSubjectAltNames allowedUris + * @property {Array.|null} [allowedEmailAddresses] AllowedSubjectAltNames allowedEmailAddresses + * @property {Array.|null} [allowedIps] AllowedSubjectAltNames allowedIps + * @property {boolean|null} [allowGlobbingDnsWildcards] AllowedSubjectAltNames allowGlobbingDnsWildcards + * @property {boolean|null} [allowCustomSans] AllowedSubjectAltNames allowCustomSans + */ + + /** + * Constructs a new AllowedSubjectAltNames. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @classdesc Represents an AllowedSubjectAltNames. + * @implements IAllowedSubjectAltNames + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames=} [properties] Properties to set + */ + function AllowedSubjectAltNames(properties) { + this.allowedDnsNames = []; + this.allowedUris = []; + this.allowedEmailAddresses = []; + this.allowedIps = []; + 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]]; + } + + /** + * AllowedSubjectAltNames allowedDnsNames. + * @member {Array.} allowedDnsNames + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @instance + */ + AllowedSubjectAltNames.prototype.allowedDnsNames = $util.emptyArray; + + /** + * AllowedSubjectAltNames allowedUris. + * @member {Array.} allowedUris + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @instance + */ + AllowedSubjectAltNames.prototype.allowedUris = $util.emptyArray; + + /** + * AllowedSubjectAltNames allowedEmailAddresses. + * @member {Array.} allowedEmailAddresses + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @instance + */ + AllowedSubjectAltNames.prototype.allowedEmailAddresses = $util.emptyArray; + + /** + * AllowedSubjectAltNames allowedIps. + * @member {Array.} allowedIps + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @instance + */ + AllowedSubjectAltNames.prototype.allowedIps = $util.emptyArray; + + /** + * AllowedSubjectAltNames allowGlobbingDnsWildcards. + * @member {boolean} allowGlobbingDnsWildcards + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @instance + */ + AllowedSubjectAltNames.prototype.allowGlobbingDnsWildcards = false; + + /** + * AllowedSubjectAltNames allowCustomSans. + * @member {boolean} allowCustomSans + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @instance + */ + AllowedSubjectAltNames.prototype.allowCustomSans = false; + + /** + * Creates a new AllowedSubjectAltNames instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames} AllowedSubjectAltNames instance + */ + AllowedSubjectAltNames.create = function create(properties) { + return new AllowedSubjectAltNames(properties); + }; + + /** + * Encodes the specified AllowedSubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames} message AllowedSubjectAltNames message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedSubjectAltNames.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedDnsNames != null && message.allowedDnsNames.length) + for (var i = 0; i < message.allowedDnsNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDnsNames[i]); + if (message.allowedUris != null && message.allowedUris.length) + for (var i = 0; i < message.allowedUris.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedUris[i]); + if (message.allowedEmailAddresses != null && message.allowedEmailAddresses.length) + for (var i = 0; i < message.allowedEmailAddresses.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.allowedEmailAddresses[i]); + if (message.allowedIps != null && message.allowedIps.length) + for (var i = 0; i < message.allowedIps.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.allowedIps[i]); + if (message.allowGlobbingDnsWildcards != null && Object.hasOwnProperty.call(message, "allowGlobbingDnsWildcards")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowGlobbingDnsWildcards); + if (message.allowCustomSans != null && Object.hasOwnProperty.call(message, "allowCustomSans")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowCustomSans); + return writer; + }; + + /** + * Encodes the specified AllowedSubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames} message AllowedSubjectAltNames message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedSubjectAltNames.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllowedSubjectAltNames message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames} AllowedSubjectAltNames + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedSubjectAltNames.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.allowedDnsNames && message.allowedDnsNames.length)) + message.allowedDnsNames = []; + message.allowedDnsNames.push(reader.string()); + break; + } + case 2: { + if (!(message.allowedUris && message.allowedUris.length)) + message.allowedUris = []; + message.allowedUris.push(reader.string()); + break; + } + case 3: { + if (!(message.allowedEmailAddresses && message.allowedEmailAddresses.length)) + message.allowedEmailAddresses = []; + message.allowedEmailAddresses.push(reader.string()); + break; + } + case 4: { + if (!(message.allowedIps && message.allowedIps.length)) + message.allowedIps = []; + message.allowedIps.push(reader.string()); + break; + } + case 5: { + message.allowGlobbingDnsWildcards = reader.bool(); + break; + } + case 6: { + message.allowCustomSans = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllowedSubjectAltNames message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames} AllowedSubjectAltNames + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedSubjectAltNames.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllowedSubjectAltNames message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllowedSubjectAltNames.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedDnsNames != null && message.hasOwnProperty("allowedDnsNames")) { + if (!Array.isArray(message.allowedDnsNames)) + return "allowedDnsNames: array expected"; + for (var i = 0; i < message.allowedDnsNames.length; ++i) + if (!$util.isString(message.allowedDnsNames[i])) + return "allowedDnsNames: string[] expected"; + } + if (message.allowedUris != null && message.hasOwnProperty("allowedUris")) { + if (!Array.isArray(message.allowedUris)) + return "allowedUris: array expected"; + for (var i = 0; i < message.allowedUris.length; ++i) + if (!$util.isString(message.allowedUris[i])) + return "allowedUris: string[] expected"; + } + if (message.allowedEmailAddresses != null && message.hasOwnProperty("allowedEmailAddresses")) { + if (!Array.isArray(message.allowedEmailAddresses)) + return "allowedEmailAddresses: array expected"; + for (var i = 0; i < message.allowedEmailAddresses.length; ++i) + if (!$util.isString(message.allowedEmailAddresses[i])) + return "allowedEmailAddresses: string[] expected"; + } + if (message.allowedIps != null && message.hasOwnProperty("allowedIps")) { + if (!Array.isArray(message.allowedIps)) + return "allowedIps: array expected"; + for (var i = 0; i < message.allowedIps.length; ++i) + if (!$util.isString(message.allowedIps[i])) + return "allowedIps: string[] expected"; + } + if (message.allowGlobbingDnsWildcards != null && message.hasOwnProperty("allowGlobbingDnsWildcards")) + if (typeof message.allowGlobbingDnsWildcards !== "boolean") + return "allowGlobbingDnsWildcards: boolean expected"; + if (message.allowCustomSans != null && message.hasOwnProperty("allowCustomSans")) + if (typeof message.allowCustomSans !== "boolean") + return "allowCustomSans: boolean expected"; + return null; + }; + + /** + * Creates an AllowedSubjectAltNames message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames} AllowedSubjectAltNames + */ + AllowedSubjectAltNames.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames(); + if (object.allowedDnsNames) { + if (!Array.isArray(object.allowedDnsNames)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowedDnsNames: array expected"); + message.allowedDnsNames = []; + for (var i = 0; i < object.allowedDnsNames.length; ++i) + message.allowedDnsNames[i] = String(object.allowedDnsNames[i]); + } + if (object.allowedUris) { + if (!Array.isArray(object.allowedUris)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowedUris: array expected"); + message.allowedUris = []; + for (var i = 0; i < object.allowedUris.length; ++i) + message.allowedUris[i] = String(object.allowedUris[i]); + } + if (object.allowedEmailAddresses) { + if (!Array.isArray(object.allowedEmailAddresses)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowedEmailAddresses: array expected"); + message.allowedEmailAddresses = []; + for (var i = 0; i < object.allowedEmailAddresses.length; ++i) + message.allowedEmailAddresses[i] = String(object.allowedEmailAddresses[i]); + } + if (object.allowedIps) { + if (!Array.isArray(object.allowedIps)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowedIps: array expected"); + message.allowedIps = []; + for (var i = 0; i < object.allowedIps.length; ++i) + message.allowedIps[i] = String(object.allowedIps[i]); + } + if (object.allowGlobbingDnsWildcards != null) + message.allowGlobbingDnsWildcards = Boolean(object.allowGlobbingDnsWildcards); + if (object.allowCustomSans != null) + message.allowCustomSans = Boolean(object.allowCustomSans); + return message; + }; + + /** + * Creates a plain object from an AllowedSubjectAltNames message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames} message AllowedSubjectAltNames + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllowedSubjectAltNames.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedDnsNames = []; + object.allowedUris = []; + object.allowedEmailAddresses = []; + object.allowedIps = []; + } + if (options.defaults) { + object.allowGlobbingDnsWildcards = false; + object.allowCustomSans = false; + } + if (message.allowedDnsNames && message.allowedDnsNames.length) { + object.allowedDnsNames = []; + for (var j = 0; j < message.allowedDnsNames.length; ++j) + object.allowedDnsNames[j] = message.allowedDnsNames[j]; + } + if (message.allowedUris && message.allowedUris.length) { + object.allowedUris = []; + for (var j = 0; j < message.allowedUris.length; ++j) + object.allowedUris[j] = message.allowedUris[j]; + } + if (message.allowedEmailAddresses && message.allowedEmailAddresses.length) { + object.allowedEmailAddresses = []; + for (var j = 0; j < message.allowedEmailAddresses.length; ++j) + object.allowedEmailAddresses[j] = message.allowedEmailAddresses[j]; + } + if (message.allowedIps && message.allowedIps.length) { + object.allowedIps = []; + for (var j = 0; j < message.allowedIps.length; ++j) + object.allowedIps[j] = message.allowedIps[j]; + } + if (message.allowGlobbingDnsWildcards != null && message.hasOwnProperty("allowGlobbingDnsWildcards")) + object.allowGlobbingDnsWildcards = message.allowGlobbingDnsWildcards; + if (message.allowCustomSans != null && message.hasOwnProperty("allowCustomSans")) + object.allowCustomSans = message.allowCustomSans; + return object; + }; + + /** + * Converts this AllowedSubjectAltNames to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @instance + * @returns {Object.} JSON object + */ + AllowedSubjectAltNames.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllowedSubjectAltNames + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllowedSubjectAltNames.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames"; + }; + + return AllowedSubjectAltNames; + })(); + + CertificateAuthorityPolicy.IssuanceModes = (function() { + + /** + * Properties of an IssuanceModes. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @interface IIssuanceModes + * @property {boolean|null} [allowCsrBasedIssuance] IssuanceModes allowCsrBasedIssuance + * @property {boolean|null} [allowConfigBasedIssuance] IssuanceModes allowConfigBasedIssuance + */ + + /** + * Constructs a new IssuanceModes. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy + * @classdesc Represents an IssuanceModes. + * @implements IIssuanceModes + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes=} [properties] Properties to set + */ + function IssuanceModes(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]]; + } + + /** + * IssuanceModes allowCsrBasedIssuance. + * @member {boolean} allowCsrBasedIssuance + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @instance + */ + IssuanceModes.prototype.allowCsrBasedIssuance = false; + + /** + * IssuanceModes allowConfigBasedIssuance. + * @member {boolean} allowConfigBasedIssuance + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @instance + */ + IssuanceModes.prototype.allowConfigBasedIssuance = false; + + /** + * Creates a new IssuanceModes instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes} IssuanceModes instance + */ + IssuanceModes.create = function create(properties) { + return new IssuanceModes(properties); + }; + + /** + * Encodes the specified IssuanceModes message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes} message IssuanceModes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IssuanceModes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowCsrBasedIssuance != null && Object.hasOwnProperty.call(message, "allowCsrBasedIssuance")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowCsrBasedIssuance); + if (message.allowConfigBasedIssuance != null && Object.hasOwnProperty.call(message, "allowConfigBasedIssuance")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowConfigBasedIssuance); + return writer; + }; + + /** + * Encodes the specified IssuanceModes message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes} message IssuanceModes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IssuanceModes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IssuanceModes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes} IssuanceModes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IssuanceModes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.allowCsrBasedIssuance = reader.bool(); + break; + } + case 2: { + message.allowConfigBasedIssuance = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IssuanceModes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes} IssuanceModes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IssuanceModes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IssuanceModes message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IssuanceModes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowCsrBasedIssuance != null && message.hasOwnProperty("allowCsrBasedIssuance")) + if (typeof message.allowCsrBasedIssuance !== "boolean") + return "allowCsrBasedIssuance: boolean expected"; + if (message.allowConfigBasedIssuance != null && message.hasOwnProperty("allowConfigBasedIssuance")) + if (typeof message.allowConfigBasedIssuance !== "boolean") + return "allowConfigBasedIssuance: boolean expected"; + return null; + }; + + /** + * Creates an IssuanceModes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes} IssuanceModes + */ + IssuanceModes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes(); + if (object.allowCsrBasedIssuance != null) + message.allowCsrBasedIssuance = Boolean(object.allowCsrBasedIssuance); + if (object.allowConfigBasedIssuance != null) + message.allowConfigBasedIssuance = Boolean(object.allowConfigBasedIssuance); + return message; + }; + + /** + * Creates a plain object from an IssuanceModes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes} message IssuanceModes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IssuanceModes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.allowCsrBasedIssuance = false; + object.allowConfigBasedIssuance = false; + } + if (message.allowCsrBasedIssuance != null && message.hasOwnProperty("allowCsrBasedIssuance")) + object.allowCsrBasedIssuance = message.allowCsrBasedIssuance; + if (message.allowConfigBasedIssuance != null && message.hasOwnProperty("allowConfigBasedIssuance")) + object.allowConfigBasedIssuance = message.allowConfigBasedIssuance; + return object; + }; + + /** + * Converts this IssuanceModes to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @instance + * @returns {Object.} JSON object + */ + IssuanceModes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IssuanceModes + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IssuanceModes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes"; + }; + + return IssuanceModes; + })(); + + return CertificateAuthorityPolicy; + })(); + + CertificateAuthority.AccessUrls = (function() { + + /** + * Properties of an AccessUrls. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @interface IAccessUrls + * @property {string|null} [caCertificateAccessUrl] AccessUrls caCertificateAccessUrl + * @property {string|null} [crlAccessUrl] AccessUrls crlAccessUrl + */ + + /** + * Constructs a new AccessUrls. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @classdesc Represents an AccessUrls. + * @implements IAccessUrls + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls=} [properties] Properties to set + */ + function AccessUrls(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]]; + } + + /** + * AccessUrls caCertificateAccessUrl. + * @member {string} caCertificateAccessUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @instance + */ + AccessUrls.prototype.caCertificateAccessUrl = ""; + + /** + * AccessUrls crlAccessUrl. + * @member {string} crlAccessUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @instance + */ + AccessUrls.prototype.crlAccessUrl = ""; + + /** + * Creates a new AccessUrls instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls} AccessUrls instance + */ + AccessUrls.create = function create(properties) { + return new AccessUrls(properties); + }; + + /** + * Encodes the specified AccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls} message AccessUrls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessUrls.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caCertificateAccessUrl != null && Object.hasOwnProperty.call(message, "caCertificateAccessUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.caCertificateAccessUrl); + if (message.crlAccessUrl != null && Object.hasOwnProperty.call(message, "crlAccessUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.crlAccessUrl); + return writer; + }; + + /** + * Encodes the specified AccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls} message AccessUrls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessUrls.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessUrls message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls} AccessUrls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessUrls.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.caCertificateAccessUrl = reader.string(); + break; + } + case 2: { + message.crlAccessUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessUrls message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls} AccessUrls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessUrls.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessUrls message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessUrls.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caCertificateAccessUrl != null && message.hasOwnProperty("caCertificateAccessUrl")) + if (!$util.isString(message.caCertificateAccessUrl)) + return "caCertificateAccessUrl: string expected"; + if (message.crlAccessUrl != null && message.hasOwnProperty("crlAccessUrl")) + if (!$util.isString(message.crlAccessUrl)) + return "crlAccessUrl: string expected"; + return null; + }; + + /** + * Creates an AccessUrls message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls} AccessUrls + */ + AccessUrls.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls(); + if (object.caCertificateAccessUrl != null) + message.caCertificateAccessUrl = String(object.caCertificateAccessUrl); + if (object.crlAccessUrl != null) + message.crlAccessUrl = String(object.crlAccessUrl); + return message; + }; + + /** + * Creates a plain object from an AccessUrls message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls} message AccessUrls + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessUrls.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.caCertificateAccessUrl = ""; + object.crlAccessUrl = ""; + } + if (message.caCertificateAccessUrl != null && message.hasOwnProperty("caCertificateAccessUrl")) + object.caCertificateAccessUrl = message.caCertificateAccessUrl; + if (message.crlAccessUrl != null && message.hasOwnProperty("crlAccessUrl")) + object.crlAccessUrl = message.crlAccessUrl; + return object; + }; + + /** + * Converts this AccessUrls to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @instance + * @returns {Object.} JSON object + */ + AccessUrls.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessUrls + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessUrls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls"; + }; + + return AccessUrls; + })(); + + CertificateAuthority.KeyVersionSpec = (function() { + + /** + * Properties of a KeyVersionSpec. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @interface IKeyVersionSpec + * @property {string|null} [cloudKmsKeyVersion] KeyVersionSpec cloudKmsKeyVersion + * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|null} [algorithm] KeyVersionSpec algorithm + */ + + /** + * Constructs a new KeyVersionSpec. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority + * @classdesc Represents a KeyVersionSpec. + * @implements IKeyVersionSpec + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec=} [properties] Properties to set + */ + function KeyVersionSpec(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]]; + } + + /** + * KeyVersionSpec cloudKmsKeyVersion. + * @member {string|null|undefined} cloudKmsKeyVersion + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @instance + */ + KeyVersionSpec.prototype.cloudKmsKeyVersion = null; + + /** + * KeyVersionSpec algorithm. + * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|null|undefined} algorithm + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @instance + */ + KeyVersionSpec.prototype.algorithm = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KeyVersionSpec KeyVersion. + * @member {"cloudKmsKeyVersion"|"algorithm"|undefined} KeyVersion + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @instance + */ + Object.defineProperty(KeyVersionSpec.prototype, "KeyVersion", { + get: $util.oneOfGetter($oneOfFields = ["cloudKmsKeyVersion", "algorithm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyVersionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec instance + */ + KeyVersionSpec.create = function create(properties) { + return new KeyVersionSpec(properties); + }; + + /** + * Encodes the specified KeyVersionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec} message KeyVersionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyVersionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudKmsKeyVersion != null && Object.hasOwnProperty.call(message, "cloudKmsKeyVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudKmsKeyVersion); + if (message.algorithm != null && Object.hasOwnProperty.call(message, "algorithm")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.algorithm); + return writer; + }; + + /** + * Encodes the specified KeyVersionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec} message KeyVersionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyVersionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyVersionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyVersionSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cloudKmsKeyVersion = reader.string(); + break; + } + case 2: { + message.algorithm = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyVersionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyVersionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyVersionSpec message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyVersionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cloudKmsKeyVersion != null && message.hasOwnProperty("cloudKmsKeyVersion")) { + properties.KeyVersion = 1; + if (!$util.isString(message.cloudKmsKeyVersion)) + return "cloudKmsKeyVersion: string expected"; + } + if (message.algorithm != null && message.hasOwnProperty("algorithm")) { + if (properties.KeyVersion === 1) + return "KeyVersion: multiple values"; + properties.KeyVersion = 1; + switch (message.algorithm) { + default: + return "algorithm: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 6: + case 7: + case 8: + case 4: + case 5: + break; + } + } + return null; + }; + + /** + * Creates a KeyVersionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec + */ + KeyVersionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec(); + if (object.cloudKmsKeyVersion != null) + message.cloudKmsKeyVersion = String(object.cloudKmsKeyVersion); + switch (object.algorithm) { + default: + if (typeof object.algorithm === "number") { + message.algorithm = object.algorithm; + break; + } + break; + case "SIGN_HASH_ALGORITHM_UNSPECIFIED": + case 0: + message.algorithm = 0; + break; + case "RSA_PSS_2048_SHA256": + case 1: + message.algorithm = 1; + break; + case "RSA_PSS_3072_SHA256": + case 2: + message.algorithm = 2; + break; + case "RSA_PSS_4096_SHA256": + case 3: + message.algorithm = 3; + break; + case "RSA_PKCS1_2048_SHA256": + case 6: + message.algorithm = 6; + break; + case "RSA_PKCS1_3072_SHA256": + case 7: + message.algorithm = 7; + break; + case "RSA_PKCS1_4096_SHA256": + case 8: + message.algorithm = 8; + break; + case "EC_P256_SHA256": + case 4: + message.algorithm = 4; + break; + case "EC_P384_SHA384": + case 5: + message.algorithm = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a KeyVersionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec} message KeyVersionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyVersionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.cloudKmsKeyVersion != null && message.hasOwnProperty("cloudKmsKeyVersion")) { + object.cloudKmsKeyVersion = message.cloudKmsKeyVersion; + if (options.oneofs) + object.KeyVersion = "cloudKmsKeyVersion"; + } + if (message.algorithm != null && message.hasOwnProperty("algorithm")) { + object.algorithm = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm[message.algorithm] === undefined ? message.algorithm : $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm[message.algorithm] : message.algorithm; + if (options.oneofs) + object.KeyVersion = "algorithm"; + } + return object; + }; + + /** + * Converts this KeyVersionSpec to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @instance + * @returns {Object.} JSON object + */ + KeyVersionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyVersionSpec + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyVersionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec"; + }; + + return KeyVersionSpec; + })(); + + /** + * Type enum. + * @name google.cloud.security.privateca.v1beta1.CertificateAuthority.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} SELF_SIGNED=1 SELF_SIGNED value + * @property {number} SUBORDINATE=2 SUBORDINATE value + */ + CertificateAuthority.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SELF_SIGNED"] = 1; + values[valuesById[2] = "SUBORDINATE"] = 2; + return values; + })(); + + /** + * Tier enum. + * @name google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier + * @enum {number} + * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value + * @property {number} ENTERPRISE=1 ENTERPRISE value + * @property {number} DEVOPS=2 DEVOPS value + */ + CertificateAuthority.Tier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENTERPRISE"] = 1; + values[valuesById[2] = "DEVOPS"] = 2; + return values; + })(); + + /** + * State enum. + * @name google.cloud.security.privateca.v1beta1.CertificateAuthority.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + * @property {number} PENDING_ACTIVATION=3 PENDING_ACTIVATION value + * @property {number} PENDING_DELETION=4 PENDING_DELETION value + */ + CertificateAuthority.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "PENDING_ACTIVATION"] = 3; + values[valuesById[4] = "PENDING_DELETION"] = 4; + return values; + })(); + + /** + * SignHashAlgorithm enum. + * @name google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm + * @enum {number} + * @property {number} SIGN_HASH_ALGORITHM_UNSPECIFIED=0 SIGN_HASH_ALGORITHM_UNSPECIFIED value + * @property {number} RSA_PSS_2048_SHA256=1 RSA_PSS_2048_SHA256 value + * @property {number} RSA_PSS_3072_SHA256=2 RSA_PSS_3072_SHA256 value + * @property {number} RSA_PSS_4096_SHA256=3 RSA_PSS_4096_SHA256 value + * @property {number} RSA_PKCS1_2048_SHA256=6 RSA_PKCS1_2048_SHA256 value + * @property {number} RSA_PKCS1_3072_SHA256=7 RSA_PKCS1_3072_SHA256 value + * @property {number} RSA_PKCS1_4096_SHA256=8 RSA_PKCS1_4096_SHA256 value + * @property {number} EC_P256_SHA256=4 EC_P256_SHA256 value + * @property {number} EC_P384_SHA384=5 EC_P384_SHA384 value + */ + CertificateAuthority.SignHashAlgorithm = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SIGN_HASH_ALGORITHM_UNSPECIFIED"] = 0; + values[valuesById[1] = "RSA_PSS_2048_SHA256"] = 1; + values[valuesById[2] = "RSA_PSS_3072_SHA256"] = 2; + values[valuesById[3] = "RSA_PSS_4096_SHA256"] = 3; + values[valuesById[6] = "RSA_PKCS1_2048_SHA256"] = 6; + values[valuesById[7] = "RSA_PKCS1_3072_SHA256"] = 7; + values[valuesById[8] = "RSA_PKCS1_4096_SHA256"] = 8; + values[valuesById[4] = "EC_P256_SHA256"] = 4; + values[valuesById[5] = "EC_P384_SHA384"] = 5; + return values; + })(); + + return CertificateAuthority; + })(); + + v1beta1.CertificateRevocationList = (function() { + + /** + * Properties of a CertificateRevocationList. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface ICertificateRevocationList + * @property {string|null} [name] CertificateRevocationList name + * @property {number|Long|null} [sequenceNumber] CertificateRevocationList sequenceNumber + * @property {Array.|null} [revokedCertificates] CertificateRevocationList revokedCertificates + * @property {string|null} [pemCrl] CertificateRevocationList pemCrl + * @property {string|null} [accessUrl] CertificateRevocationList accessUrl + * @property {google.cloud.security.privateca.v1beta1.CertificateRevocationList.State|null} [state] CertificateRevocationList state + * @property {google.protobuf.ITimestamp|null} [createTime] CertificateRevocationList createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateRevocationList updateTime + * @property {Object.|null} [labels] CertificateRevocationList labels + */ + + /** + * Constructs a new CertificateRevocationList. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a CertificateRevocationList. + * @implements ICertificateRevocationList + * @constructor + * @param {google.cloud.security.privateca.v1beta1.ICertificateRevocationList=} [properties] Properties to set + */ + function CertificateRevocationList(properties) { + this.revokedCertificates = []; + 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]]; + } + + /** + * CertificateRevocationList name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.name = ""; + + /** + * CertificateRevocationList sequenceNumber. + * @member {number|Long} sequenceNumber + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CertificateRevocationList revokedCertificates. + * @member {Array.} revokedCertificates + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.revokedCertificates = $util.emptyArray; + + /** + * CertificateRevocationList pemCrl. + * @member {string} pemCrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.pemCrl = ""; + + /** + * CertificateRevocationList accessUrl. + * @member {string} accessUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.accessUrl = ""; + + /** + * CertificateRevocationList state. + * @member {google.cloud.security.privateca.v1beta1.CertificateRevocationList.State} state + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.state = 0; + + /** + * CertificateRevocationList createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.createTime = null; + + /** + * CertificateRevocationList updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.updateTime = null; + + /** + * CertificateRevocationList labels. + * @member {Object.} labels + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @instance + */ + CertificateRevocationList.prototype.labels = $util.emptyObject; + + /** + * Creates a new CertificateRevocationList instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateRevocationList=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList} CertificateRevocationList instance + */ + CertificateRevocationList.create = function create(properties) { + return new CertificateRevocationList(properties); + }; + + /** + * Encodes the specified CertificateRevocationList message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateRevocationList} message CertificateRevocationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateRevocationList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sequenceNumber); + if (message.revokedCertificates != null && message.revokedCertificates.length) + for (var i = 0; i < message.revokedCertificates.length; ++i) + $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.encode(message.revokedCertificates[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pemCrl != null && Object.hasOwnProperty.call(message, "pemCrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pemCrl); + if (message.accessUrl != null && Object.hasOwnProperty.call(message, "accessUrl")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.accessUrl); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified CertificateRevocationList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateRevocationList} message CertificateRevocationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateRevocationList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateRevocationList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList} CertificateRevocationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateRevocationList.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sequenceNumber = reader.int64(); + break; + } + case 3: { + if (!(message.revokedCertificates && message.revokedCertificates.length)) + message.revokedCertificates = []; + message.revokedCertificates.push($root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.decode(reader, reader.uint32())); + break; + } + case 4: { + message.pemCrl = reader.string(); + break; + } + case 5: { + message.accessUrl = reader.string(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateRevocationList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList} CertificateRevocationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateRevocationList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateRevocationList message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateRevocationList.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.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) + return "sequenceNumber: integer|Long expected"; + if (message.revokedCertificates != null && message.hasOwnProperty("revokedCertificates")) { + if (!Array.isArray(message.revokedCertificates)) + return "revokedCertificates: array expected"; + for (var i = 0; i < message.revokedCertificates.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.verify(message.revokedCertificates[i]); + if (error) + return "revokedCertificates." + error; + } + } + if (message.pemCrl != null && message.hasOwnProperty("pemCrl")) + if (!$util.isString(message.pemCrl)) + return "pemCrl: string expected"; + if (message.accessUrl != null && message.hasOwnProperty("accessUrl")) + if (!$util.isString(message.accessUrl)) + return "accessUrl: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a CertificateRevocationList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList} CertificateRevocationList + */ + CertificateRevocationList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList(); + if (object.name != null) + message.name = String(object.name); + if (object.sequenceNumber != null) + if ($util.Long) + (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; + else if (typeof object.sequenceNumber === "string") + message.sequenceNumber = parseInt(object.sequenceNumber, 10); + else if (typeof object.sequenceNumber === "number") + message.sequenceNumber = object.sequenceNumber; + else if (typeof object.sequenceNumber === "object") + message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); + if (object.revokedCertificates) { + if (!Array.isArray(object.revokedCertificates)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateRevocationList.revokedCertificates: array expected"); + message.revokedCertificates = []; + for (var i = 0; i < object.revokedCertificates.length; ++i) { + if (typeof object.revokedCertificates[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateRevocationList.revokedCertificates: object expected"); + message.revokedCertificates[i] = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.fromObject(object.revokedCertificates[i]); + } + } + if (object.pemCrl != null) + message.pemCrl = String(object.pemCrl); + if (object.accessUrl != null) + message.accessUrl = String(object.accessUrl); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateRevocationList.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateRevocationList.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateRevocationList.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 CertificateRevocationList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList} message CertificateRevocationList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateRevocationList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.revokedCertificates = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequenceNumber = options.longs === String ? "0" : 0; + object.pemCrl = ""; + object.accessUrl = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (typeof message.sequenceNumber === "number") + object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; + else + object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; + if (message.revokedCertificates && message.revokedCertificates.length) { + object.revokedCertificates = []; + for (var j = 0; j < message.revokedCertificates.length; ++j) + object.revokedCertificates[j] = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.toObject(message.revokedCertificates[j], options); + } + if (message.pemCrl != null && message.hasOwnProperty("pemCrl")) + object.pemCrl = message.pemCrl; + if (message.accessUrl != null && message.hasOwnProperty("accessUrl")) + object.accessUrl = message.accessUrl; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.State[message.state] === undefined ? message.state : $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this CertificateRevocationList to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @instance + * @returns {Object.} JSON object + */ + CertificateRevocationList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateRevocationList + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateRevocationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateRevocationList"; + }; + + CertificateRevocationList.RevokedCertificate = (function() { + + /** + * Properties of a RevokedCertificate. + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @interface IRevokedCertificate + * @property {string|null} [certificate] RevokedCertificate certificate + * @property {string|null} [hexSerialNumber] RevokedCertificate hexSerialNumber + * @property {google.cloud.security.privateca.v1beta1.RevocationReason|null} [revocationReason] RevokedCertificate revocationReason + */ + + /** + * Constructs a new RevokedCertificate. + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList + * @classdesc Represents a RevokedCertificate. + * @implements IRevokedCertificate + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate=} [properties] Properties to set + */ + function RevokedCertificate(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]]; + } + + /** + * RevokedCertificate certificate. + * @member {string} certificate + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @instance + */ + RevokedCertificate.prototype.certificate = ""; + + /** + * RevokedCertificate hexSerialNumber. + * @member {string} hexSerialNumber + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @instance + */ + RevokedCertificate.prototype.hexSerialNumber = ""; + + /** + * RevokedCertificate revocationReason. + * @member {google.cloud.security.privateca.v1beta1.RevocationReason} revocationReason + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @instance + */ + RevokedCertificate.prototype.revocationReason = 0; + + /** + * Creates a new RevokedCertificate instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate} RevokedCertificate instance + */ + RevokedCertificate.create = function create(properties) { + return new RevokedCertificate(properties); + }; + + /** + * Encodes the specified RevokedCertificate message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate} message RevokedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevokedCertificate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificate); + if (message.hexSerialNumber != null && Object.hasOwnProperty.call(message, "hexSerialNumber")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.hexSerialNumber); + if (message.revocationReason != null && Object.hasOwnProperty.call(message, "revocationReason")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.revocationReason); + return writer; + }; + + /** + * Encodes the specified RevokedCertificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate} message RevokedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevokedCertificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RevokedCertificate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate} RevokedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevokedCertificate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.certificate = reader.string(); + break; + } + case 2: { + message.hexSerialNumber = reader.string(); + break; + } + case 3: { + message.revocationReason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RevokedCertificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate} RevokedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevokedCertificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RevokedCertificate message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RevokedCertificate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificate != null && message.hasOwnProperty("certificate")) + if (!$util.isString(message.certificate)) + return "certificate: string expected"; + if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) + if (!$util.isString(message.hexSerialNumber)) + return "hexSerialNumber: string expected"; + if (message.revocationReason != null && message.hasOwnProperty("revocationReason")) + switch (message.revocationReason) { + default: + return "revocationReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + return null; + }; + + /** + * Creates a RevokedCertificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate} RevokedCertificate + */ + RevokedCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate(); + if (object.certificate != null) + message.certificate = String(object.certificate); + if (object.hexSerialNumber != null) + message.hexSerialNumber = String(object.hexSerialNumber); + switch (object.revocationReason) { + default: + if (typeof object.revocationReason === "number") { + message.revocationReason = object.revocationReason; + break; + } + break; + case "REVOCATION_REASON_UNSPECIFIED": + case 0: + message.revocationReason = 0; + break; + case "KEY_COMPROMISE": + case 1: + message.revocationReason = 1; + break; + case "CERTIFICATE_AUTHORITY_COMPROMISE": + case 2: + message.revocationReason = 2; + break; + case "AFFILIATION_CHANGED": + case 3: + message.revocationReason = 3; + break; + case "SUPERSEDED": + case 4: + message.revocationReason = 4; + break; + case "CESSATION_OF_OPERATION": + case 5: + message.revocationReason = 5; + break; + case "CERTIFICATE_HOLD": + case 6: + message.revocationReason = 6; + break; + case "PRIVILEGE_WITHDRAWN": + case 7: + message.revocationReason = 7; + break; + case "ATTRIBUTE_AUTHORITY_COMPROMISE": + case 8: + message.revocationReason = 8; + break; + } + return message; + }; + + /** + * Creates a plain object from a RevokedCertificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate} message RevokedCertificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RevokedCertificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificate = ""; + object.hexSerialNumber = ""; + object.revocationReason = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; + } + if (message.certificate != null && message.hasOwnProperty("certificate")) + object.certificate = message.certificate; + if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) + object.hexSerialNumber = message.hexSerialNumber; + if (message.revocationReason != null && message.hasOwnProperty("revocationReason")) + object.revocationReason = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.revocationReason] === undefined ? message.revocationReason : $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.revocationReason] : message.revocationReason; + return object; + }; + + /** + * Converts this RevokedCertificate to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @instance + * @returns {Object.} JSON object + */ + RevokedCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RevokedCertificate + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RevokedCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate"; + }; + + return RevokedCertificate; + })(); + + /** + * State enum. + * @name google.cloud.security.privateca.v1beta1.CertificateRevocationList.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} SUPERSEDED=2 SUPERSEDED value + */ + CertificateRevocationList.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + return values; + })(); + + return CertificateRevocationList; + })(); + + v1beta1.Certificate = (function() { + + /** + * Properties of a Certificate. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface ICertificate + * @property {string|null} [name] Certificate name + * @property {string|null} [pemCsr] Certificate pemCsr + * @property {google.cloud.security.privateca.v1beta1.ICertificateConfig|null} [config] Certificate config + * @property {google.protobuf.IDuration|null} [lifetime] Certificate lifetime + * @property {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails|null} [revocationDetails] Certificate revocationDetails + * @property {string|null} [pemCertificate] Certificate pemCertificate + * @property {google.cloud.security.privateca.v1beta1.ICertificateDescription|null} [certificateDescription] Certificate certificateDescription + * @property {Array.|null} [pemCertificateChain] Certificate pemCertificateChain + * @property {google.protobuf.ITimestamp|null} [createTime] Certificate createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Certificate updateTime + * @property {Object.|null} [labels] Certificate labels + */ + + /** + * Constructs a new Certificate. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a Certificate. + * @implements ICertificate + * @constructor + * @param {google.cloud.security.privateca.v1beta1.ICertificate=} [properties] Properties to set + */ + function Certificate(properties) { + this.pemCertificateChain = []; + 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]]; + } + + /** + * Certificate name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Certificate.prototype.name = ""; + + /** + * Certificate pemCsr. + * @member {string|null|undefined} pemCsr + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Certificate.prototype.pemCsr = null; + + /** + * Certificate config. + * @member {google.cloud.security.privateca.v1beta1.ICertificateConfig|null|undefined} config + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Certificate.prototype.config = null; + + /** + * Certificate lifetime. + * @member {google.protobuf.IDuration|null|undefined} lifetime + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Certificate.prototype.lifetime = null; + + /** + * Certificate revocationDetails. + * @member {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails|null|undefined} revocationDetails + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Certificate.prototype.revocationDetails = null; + + /** + * Certificate pemCertificate. + * @member {string} pemCertificate + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Certificate.prototype.pemCertificate = ""; + + /** + * Certificate certificateDescription. + * @member {google.cloud.security.privateca.v1beta1.ICertificateDescription|null|undefined} certificateDescription + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Certificate.prototype.certificateDescription = null; + + /** + * Certificate pemCertificateChain. + * @member {Array.} pemCertificateChain + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Certificate.prototype.pemCertificateChain = $util.emptyArray; + + /** + * Certificate createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Certificate.prototype.createTime = null; + + /** + * Certificate updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Certificate.prototype.updateTime = null; + + /** + * Certificate labels. + * @member {Object.} labels + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Certificate.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Certificate certificateConfig. + * @member {"pemCsr"|"config"|undefined} certificateConfig + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + */ + Object.defineProperty(Certificate.prototype, "certificateConfig", { + get: $util.oneOfGetter($oneOfFields = ["pemCsr", "config"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Certificate instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificate=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.Certificate} Certificate instance + */ + Certificate.create = function create(properties) { + return new Certificate(properties); + }; + + /** + * Encodes the specified Certificate message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificate} message Certificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Certificate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCsr); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.security.privateca.v1beta1.CertificateConfig.encode(message.config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) + $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.revocationDetails != null && Object.hasOwnProperty.call(message, "revocationDetails")) + $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.encode(message.revocationDetails, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pemCertificate); + if (message.certificateDescription != null && Object.hasOwnProperty.call(message, "certificateDescription")) + $root.google.cloud.security.privateca.v1beta1.CertificateDescription.encode(message.certificateDescription, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pemCertificateChain != null && message.pemCertificateChain.length) + for (var i = 0; i < message.pemCertificateChain.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pemCertificateChain[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Certificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificate} message Certificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Certificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Certificate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.Certificate} Certificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Certificate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.Certificate(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pemCsr = reader.string(); + break; + } + case 3: { + message.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.revocationDetails = $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.decode(reader, reader.uint32()); + break; + } + case 6: { + message.pemCertificate = reader.string(); + break; + } + case 7: { + message.certificateDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.pemCertificateChain && message.pemCertificateChain.length)) + message.pemCertificateChain = []; + message.pemCertificateChain.push(reader.string()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Certificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.Certificate} Certificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Certificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Certificate message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Certificate.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.pemCsr != null && message.hasOwnProperty("pemCsr")) { + properties.certificateConfig = 1; + if (!$util.isString(message.pemCsr)) + return "pemCsr: string expected"; + } + if (message.config != null && message.hasOwnProperty("config")) { + if (properties.certificateConfig === 1) + return "certificateConfig: multiple values"; + properties.certificateConfig = 1; + { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.verify(message.config); + if (error) + return "config." + error; + } + } + if (message.lifetime != null && message.hasOwnProperty("lifetime")) { + var error = $root.google.protobuf.Duration.verify(message.lifetime); + if (error) + return "lifetime." + error; + } + if (message.revocationDetails != null && message.hasOwnProperty("revocationDetails")) { + var error = $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.verify(message.revocationDetails); + if (error) + return "revocationDetails." + error; + } + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + if (!$util.isString(message.pemCertificate)) + return "pemCertificate: string expected"; + if (message.certificateDescription != null && message.hasOwnProperty("certificateDescription")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.verify(message.certificateDescription); + if (error) + return "certificateDescription." + error; + } + if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { + if (!Array.isArray(message.pemCertificateChain)) + return "pemCertificateChain: array expected"; + for (var i = 0; i < message.pemCertificateChain.length; ++i) + if (!$util.isString(message.pemCertificateChain[i])) + return "pemCertificateChain: string[] expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.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 Certificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.Certificate} Certificate + */ + Certificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.Certificate) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.Certificate(); + if (object.name != null) + message.name = String(object.name); + if (object.pemCsr != null) + message.pemCsr = String(object.pemCsr); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.config: object expected"); + message.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.fromObject(object.config); + } + if (object.lifetime != null) { + if (typeof object.lifetime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.lifetime: object expected"); + message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); + } + if (object.revocationDetails != null) { + if (typeof object.revocationDetails !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.revocationDetails: object expected"); + message.revocationDetails = $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.fromObject(object.revocationDetails); + } + if (object.pemCertificate != null) + message.pemCertificate = String(object.pemCertificate); + if (object.certificateDescription != null) { + if (typeof object.certificateDescription !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.certificateDescription: object expected"); + message.certificateDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.fromObject(object.certificateDescription); + } + if (object.pemCertificateChain) { + if (!Array.isArray(object.pemCertificateChain)) + throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.pemCertificateChain: array expected"); + message.pemCertificateChain = []; + for (var i = 0; i < object.pemCertificateChain.length; ++i) + message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.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 Certificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @static + * @param {google.cloud.security.privateca.v1beta1.Certificate} message Certificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Certificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pemCertificateChain = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.lifetime = null; + object.revocationDetails = null; + object.pemCertificate = ""; + object.certificateDescription = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) { + object.pemCsr = message.pemCsr; + if (options.oneofs) + object.certificateConfig = "pemCsr"; + } + if (message.config != null && message.hasOwnProperty("config")) { + object.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.toObject(message.config, options); + if (options.oneofs) + object.certificateConfig = "config"; + } + if (message.lifetime != null && message.hasOwnProperty("lifetime")) + object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); + if (message.revocationDetails != null && message.hasOwnProperty("revocationDetails")) + object.revocationDetails = $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.toObject(message.revocationDetails, options); + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + object.pemCertificate = message.pemCertificate; + if (message.certificateDescription != null && message.hasOwnProperty("certificateDescription")) + object.certificateDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.toObject(message.certificateDescription, options); + if (message.pemCertificateChain && message.pemCertificateChain.length) { + object.pemCertificateChain = []; + for (var j = 0; j < message.pemCertificateChain.length; ++j) + object.pemCertificateChain[j] = message.pemCertificateChain[j]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Certificate to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @instance + * @returns {Object.} JSON object + */ + Certificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Certificate + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Certificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.Certificate"; + }; + + Certificate.RevocationDetails = (function() { + + /** + * Properties of a RevocationDetails. + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @interface IRevocationDetails + * @property {google.cloud.security.privateca.v1beta1.RevocationReason|null} [revocationState] RevocationDetails revocationState + * @property {google.protobuf.ITimestamp|null} [revocationTime] RevocationDetails revocationTime + */ + + /** + * Constructs a new RevocationDetails. + * @memberof google.cloud.security.privateca.v1beta1.Certificate + * @classdesc Represents a RevocationDetails. + * @implements IRevocationDetails + * @constructor + * @param {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails=} [properties] Properties to set + */ + function RevocationDetails(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]]; + } + + /** + * RevocationDetails revocationState. + * @member {google.cloud.security.privateca.v1beta1.RevocationReason} revocationState + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @instance + */ + RevocationDetails.prototype.revocationState = 0; + + /** + * RevocationDetails revocationTime. + * @member {google.protobuf.ITimestamp|null|undefined} revocationTime + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @instance + */ + RevocationDetails.prototype.revocationTime = null; + + /** + * Creates a new RevocationDetails instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @static + * @param {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails} RevocationDetails instance + */ + RevocationDetails.create = function create(properties) { + return new RevocationDetails(properties); + }; + + /** + * Encodes the specified RevocationDetails message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @static + * @param {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails} message RevocationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevocationDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revocationState != null && Object.hasOwnProperty.call(message, "revocationState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revocationState); + if (message.revocationTime != null && Object.hasOwnProperty.call(message, "revocationTime")) + $root.google.protobuf.Timestamp.encode(message.revocationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RevocationDetails message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @static + * @param {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails} message RevocationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevocationDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RevocationDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails} RevocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevocationDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.revocationState = reader.int32(); + break; + } + case 2: { + message.revocationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RevocationDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails} RevocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevocationDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RevocationDetails message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RevocationDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revocationState != null && message.hasOwnProperty("revocationState")) + switch (message.revocationState) { + default: + return "revocationState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.revocationTime != null && message.hasOwnProperty("revocationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revocationTime); + if (error) + return "revocationTime." + error; + } + return null; + }; + + /** + * Creates a RevocationDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails} RevocationDetails + */ + RevocationDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails(); + switch (object.revocationState) { + default: + if (typeof object.revocationState === "number") { + message.revocationState = object.revocationState; + break; + } + break; + case "REVOCATION_REASON_UNSPECIFIED": + case 0: + message.revocationState = 0; + break; + case "KEY_COMPROMISE": + case 1: + message.revocationState = 1; + break; + case "CERTIFICATE_AUTHORITY_COMPROMISE": + case 2: + message.revocationState = 2; + break; + case "AFFILIATION_CHANGED": + case 3: + message.revocationState = 3; + break; + case "SUPERSEDED": + case 4: + message.revocationState = 4; + break; + case "CESSATION_OF_OPERATION": + case 5: + message.revocationState = 5; + break; + case "CERTIFICATE_HOLD": + case 6: + message.revocationState = 6; + break; + case "PRIVILEGE_WITHDRAWN": + case 7: + message.revocationState = 7; + break; + case "ATTRIBUTE_AUTHORITY_COMPROMISE": + case 8: + message.revocationState = 8; + break; + } + if (object.revocationTime != null) { + if (typeof object.revocationTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.revocationTime: object expected"); + message.revocationTime = $root.google.protobuf.Timestamp.fromObject(object.revocationTime); + } + return message; + }; + + /** + * Creates a plain object from a RevocationDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @static + * @param {google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails} message RevocationDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RevocationDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.revocationState = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; + object.revocationTime = null; + } + if (message.revocationState != null && message.hasOwnProperty("revocationState")) + object.revocationState = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.revocationState] === undefined ? message.revocationState : $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.revocationState] : message.revocationState; + if (message.revocationTime != null && message.hasOwnProperty("revocationTime")) + object.revocationTime = $root.google.protobuf.Timestamp.toObject(message.revocationTime, options); + return object; + }; + + /** + * Converts this RevocationDetails to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @instance + * @returns {Object.} JSON object + */ + RevocationDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RevocationDetails + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RevocationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails"; + }; + + return RevocationDetails; + })(); + + return Certificate; + })(); + + v1beta1.ReusableConfig = (function() { + + /** + * Properties of a ReusableConfig. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IReusableConfig + * @property {string|null} [name] ReusableConfig name + * @property {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null} [values] ReusableConfig values + * @property {string|null} [description] ReusableConfig description + * @property {google.protobuf.ITimestamp|null} [createTime] ReusableConfig createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ReusableConfig updateTime + * @property {Object.|null} [labels] ReusableConfig labels + */ + + /** + * Constructs a new ReusableConfig. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ReusableConfig. + * @implements IReusableConfig + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IReusableConfig=} [properties] Properties to set + */ + function ReusableConfig(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]]; + } + + /** + * ReusableConfig name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @instance + */ + ReusableConfig.prototype.name = ""; + + /** + * ReusableConfig values. + * @member {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null|undefined} values + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @instance + */ + ReusableConfig.prototype.values = null; + + /** + * ReusableConfig description. + * @member {string} description + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @instance + */ + ReusableConfig.prototype.description = ""; + + /** + * ReusableConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @instance + */ + ReusableConfig.prototype.createTime = null; + + /** + * ReusableConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @instance + */ + ReusableConfig.prototype.updateTime = null; + + /** + * ReusableConfig labels. + * @member {Object.} labels + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @instance + */ + ReusableConfig.prototype.labels = $util.emptyObject; + + /** + * Creates a new ReusableConfig instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.IReusableConfig=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfig} ReusableConfig instance + */ + ReusableConfig.create = function create(properties) { + return new ReusableConfig(properties); + }; + + /** + * Encodes the specified ReusableConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.IReusableConfig} message ReusableConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReusableConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.values != null && Object.hasOwnProperty.call(message, "values")) + $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.encode(message.values, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReusableConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.IReusableConfig} message ReusableConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReusableConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReusableConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfig} ReusableConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReusableConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.values = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.decode(reader, reader.uint32()); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReusableConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfig} ReusableConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReusableConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReusableConfig message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReusableConfig.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.values != null && message.hasOwnProperty("values")) { + var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify(message.values); + if (error) + return "values." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.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 ReusableConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfig} ReusableConfig + */ + ReusableConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ReusableConfig) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.values != null) { + if (typeof object.values !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfig.values: object expected"); + message.values = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.fromObject(object.values); + } + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfig.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfig.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 ReusableConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.ReusableConfig} message ReusableConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReusableConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.values = null; + object.description = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.values != null && message.hasOwnProperty("values")) + object.values = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.toObject(message.values, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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]]; + } + return object; + }; + + /** + * Converts this ReusableConfig to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @instance + * @returns {Object.} JSON object + */ + ReusableConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReusableConfig + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReusableConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ReusableConfig"; + }; + + return ReusableConfig; + })(); + + v1beta1.ReusableConfigValues = (function() { + + /** + * Properties of a ReusableConfigValues. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IReusableConfigValues + * @property {google.cloud.security.privateca.v1beta1.IKeyUsage|null} [keyUsage] ReusableConfigValues keyUsage + * @property {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions|null} [caOptions] ReusableConfigValues caOptions + * @property {Array.|null} [policyIds] ReusableConfigValues policyIds + * @property {Array.|null} [aiaOcspServers] ReusableConfigValues aiaOcspServers + * @property {Array.|null} [additionalExtensions] ReusableConfigValues additionalExtensions + */ + + /** + * Constructs a new ReusableConfigValues. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ReusableConfigValues. + * @implements IReusableConfigValues + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IReusableConfigValues=} [properties] Properties to set + */ + function ReusableConfigValues(properties) { + this.policyIds = []; + this.aiaOcspServers = []; + this.additionalExtensions = []; + 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]]; + } + + /** + * ReusableConfigValues keyUsage. + * @member {google.cloud.security.privateca.v1beta1.IKeyUsage|null|undefined} keyUsage + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @instance + */ + ReusableConfigValues.prototype.keyUsage = null; + + /** + * ReusableConfigValues caOptions. + * @member {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions|null|undefined} caOptions + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @instance + */ + ReusableConfigValues.prototype.caOptions = null; + + /** + * ReusableConfigValues policyIds. + * @member {Array.} policyIds + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @instance + */ + ReusableConfigValues.prototype.policyIds = $util.emptyArray; + + /** + * ReusableConfigValues aiaOcspServers. + * @member {Array.} aiaOcspServers + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @instance + */ + ReusableConfigValues.prototype.aiaOcspServers = $util.emptyArray; + + /** + * ReusableConfigValues additionalExtensions. + * @member {Array.} additionalExtensions + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @instance + */ + ReusableConfigValues.prototype.additionalExtensions = $util.emptyArray; + + /** + * Creates a new ReusableConfigValues instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @static + * @param {google.cloud.security.privateca.v1beta1.IReusableConfigValues=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues} ReusableConfigValues instance + */ + ReusableConfigValues.create = function create(properties) { + return new ReusableConfigValues(properties); + }; + + /** + * Encodes the specified ReusableConfigValues message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @static + * @param {google.cloud.security.privateca.v1beta1.IReusableConfigValues} message ReusableConfigValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReusableConfigValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyUsage != null && Object.hasOwnProperty.call(message, "keyUsage")) + $root.google.cloud.security.privateca.v1beta1.KeyUsage.encode(message.keyUsage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.caOptions != null && Object.hasOwnProperty.call(message, "caOptions")) + $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.encode(message.caOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.policyIds != null && message.policyIds.length) + for (var i = 0; i < message.policyIds.length; ++i) + $root.google.cloud.security.privateca.v1beta1.ObjectId.encode(message.policyIds[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.aiaOcspServers != null && message.aiaOcspServers.length) + for (var i = 0; i < message.aiaOcspServers.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.aiaOcspServers[i]); + if (message.additionalExtensions != null && message.additionalExtensions.length) + for (var i = 0; i < message.additionalExtensions.length; ++i) + $root.google.cloud.security.privateca.v1beta1.X509Extension.encode(message.additionalExtensions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReusableConfigValues message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @static + * @param {google.cloud.security.privateca.v1beta1.IReusableConfigValues} message ReusableConfigValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReusableConfigValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReusableConfigValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues} ReusableConfigValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReusableConfigValues.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.decode(reader, reader.uint32()); + break; + } + case 2: { + message.caOptions = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.policyIds && message.policyIds.length)) + message.policyIds = []; + message.policyIds.push($root.google.cloud.security.privateca.v1beta1.ObjectId.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.aiaOcspServers && message.aiaOcspServers.length)) + message.aiaOcspServers = []; + message.aiaOcspServers.push(reader.string()); + break; + } + case 5: { + if (!(message.additionalExtensions && message.additionalExtensions.length)) + message.additionalExtensions = []; + message.additionalExtensions.push($root.google.cloud.security.privateca.v1beta1.X509Extension.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReusableConfigValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues} ReusableConfigValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReusableConfigValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReusableConfigValues message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReusableConfigValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyUsage != null && message.hasOwnProperty("keyUsage")) { + var error = $root.google.cloud.security.privateca.v1beta1.KeyUsage.verify(message.keyUsage); + if (error) + return "keyUsage." + error; + } + if (message.caOptions != null && message.hasOwnProperty("caOptions")) { + var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.verify(message.caOptions); + if (error) + return "caOptions." + error; + } + if (message.policyIds != null && message.hasOwnProperty("policyIds")) { + if (!Array.isArray(message.policyIds)) + return "policyIds: array expected"; + for (var i = 0; i < message.policyIds.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.ObjectId.verify(message.policyIds[i]); + if (error) + return "policyIds." + error; + } + } + if (message.aiaOcspServers != null && message.hasOwnProperty("aiaOcspServers")) { + if (!Array.isArray(message.aiaOcspServers)) + return "aiaOcspServers: array expected"; + for (var i = 0; i < message.aiaOcspServers.length; ++i) + if (!$util.isString(message.aiaOcspServers[i])) + return "aiaOcspServers: string[] expected"; + } + if (message.additionalExtensions != null && message.hasOwnProperty("additionalExtensions")) { + if (!Array.isArray(message.additionalExtensions)) + return "additionalExtensions: array expected"; + for (var i = 0; i < message.additionalExtensions.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.X509Extension.verify(message.additionalExtensions[i]); + if (error) + return "additionalExtensions." + error; + } + } + return null; + }; + + /** + * Creates a ReusableConfigValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues} ReusableConfigValues + */ + ReusableConfigValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues(); + if (object.keyUsage != null) { + if (typeof object.keyUsage !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.keyUsage: object expected"); + message.keyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.fromObject(object.keyUsage); + } + if (object.caOptions != null) { + if (typeof object.caOptions !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.caOptions: object expected"); + message.caOptions = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.fromObject(object.caOptions); + } + if (object.policyIds) { + if (!Array.isArray(object.policyIds)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.policyIds: array expected"); + message.policyIds = []; + for (var i = 0; i < object.policyIds.length; ++i) { + if (typeof object.policyIds[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.policyIds: object expected"); + message.policyIds[i] = $root.google.cloud.security.privateca.v1beta1.ObjectId.fromObject(object.policyIds[i]); + } + } + if (object.aiaOcspServers) { + if (!Array.isArray(object.aiaOcspServers)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.aiaOcspServers: array expected"); + message.aiaOcspServers = []; + for (var i = 0; i < object.aiaOcspServers.length; ++i) + message.aiaOcspServers[i] = String(object.aiaOcspServers[i]); + } + if (object.additionalExtensions) { + if (!Array.isArray(object.additionalExtensions)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.additionalExtensions: array expected"); + message.additionalExtensions = []; + for (var i = 0; i < object.additionalExtensions.length; ++i) { + if (typeof object.additionalExtensions[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.additionalExtensions: object expected"); + message.additionalExtensions[i] = $root.google.cloud.security.privateca.v1beta1.X509Extension.fromObject(object.additionalExtensions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ReusableConfigValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @static + * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues} message ReusableConfigValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReusableConfigValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.policyIds = []; + object.aiaOcspServers = []; + object.additionalExtensions = []; + } + if (options.defaults) { + object.keyUsage = null; + object.caOptions = null; + } + if (message.keyUsage != null && message.hasOwnProperty("keyUsage")) + object.keyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.toObject(message.keyUsage, options); + if (message.caOptions != null && message.hasOwnProperty("caOptions")) + object.caOptions = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.toObject(message.caOptions, options); + if (message.policyIds && message.policyIds.length) { + object.policyIds = []; + for (var j = 0; j < message.policyIds.length; ++j) + object.policyIds[j] = $root.google.cloud.security.privateca.v1beta1.ObjectId.toObject(message.policyIds[j], options); + } + if (message.aiaOcspServers && message.aiaOcspServers.length) { + object.aiaOcspServers = []; + for (var j = 0; j < message.aiaOcspServers.length; ++j) + object.aiaOcspServers[j] = message.aiaOcspServers[j]; + } + if (message.additionalExtensions && message.additionalExtensions.length) { + object.additionalExtensions = []; + for (var j = 0; j < message.additionalExtensions.length; ++j) + object.additionalExtensions[j] = $root.google.cloud.security.privateca.v1beta1.X509Extension.toObject(message.additionalExtensions[j], options); + } + return object; + }; + + /** + * Converts this ReusableConfigValues to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @instance + * @returns {Object.} JSON object + */ + ReusableConfigValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReusableConfigValues + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReusableConfigValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ReusableConfigValues"; + }; + + ReusableConfigValues.CaOptions = (function() { + + /** + * Properties of a CaOptions. + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @interface ICaOptions + * @property {google.protobuf.IBoolValue|null} [isCa] CaOptions isCa + * @property {google.protobuf.IInt32Value|null} [maxIssuerPathLength] CaOptions maxIssuerPathLength + */ + + /** + * Constructs a new CaOptions. + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues + * @classdesc Represents a CaOptions. + * @implements ICaOptions + * @constructor + * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions=} [properties] Properties to set + */ + function CaOptions(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]]; + } + + /** + * CaOptions isCa. + * @member {google.protobuf.IBoolValue|null|undefined} isCa + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @instance + */ + CaOptions.prototype.isCa = null; + + /** + * CaOptions maxIssuerPathLength. + * @member {google.protobuf.IInt32Value|null|undefined} maxIssuerPathLength + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @instance + */ + CaOptions.prototype.maxIssuerPathLength = null; + + /** + * Creates a new CaOptions instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions} CaOptions instance + */ + CaOptions.create = function create(properties) { + return new CaOptions(properties); + }; + + /** + * Encodes the specified CaOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions} message CaOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.isCa != null && Object.hasOwnProperty.call(message, "isCa")) + $root.google.protobuf.BoolValue.encode(message.isCa, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxIssuerPathLength != null && Object.hasOwnProperty.call(message, "maxIssuerPathLength")) + $root.google.protobuf.Int32Value.encode(message.maxIssuerPathLength, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CaOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions} message CaOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions} CaOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.isCa = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maxIssuerPathLength = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions} CaOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaOptions message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.isCa != null && message.hasOwnProperty("isCa")) { + var error = $root.google.protobuf.BoolValue.verify(message.isCa); + if (error) + return "isCa." + error; + } + if (message.maxIssuerPathLength != null && message.hasOwnProperty("maxIssuerPathLength")) { + var error = $root.google.protobuf.Int32Value.verify(message.maxIssuerPathLength); + if (error) + return "maxIssuerPathLength." + error; + } + return null; + }; + + /** + * Creates a CaOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions} CaOptions + */ + CaOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions(); + if (object.isCa != null) { + if (typeof object.isCa !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.isCa: object expected"); + message.isCa = $root.google.protobuf.BoolValue.fromObject(object.isCa); + } + if (object.maxIssuerPathLength != null) { + if (typeof object.maxIssuerPathLength !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.maxIssuerPathLength: object expected"); + message.maxIssuerPathLength = $root.google.protobuf.Int32Value.fromObject(object.maxIssuerPathLength); + } + return message; + }; + + /** + * Creates a plain object from a CaOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions} message CaOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.isCa = null; + object.maxIssuerPathLength = null; + } + if (message.isCa != null && message.hasOwnProperty("isCa")) + object.isCa = $root.google.protobuf.BoolValue.toObject(message.isCa, options); + if (message.maxIssuerPathLength != null && message.hasOwnProperty("maxIssuerPathLength")) + object.maxIssuerPathLength = $root.google.protobuf.Int32Value.toObject(message.maxIssuerPathLength, options); + return object; + }; + + /** + * Converts this CaOptions to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @instance + * @returns {Object.} JSON object + */ + CaOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaOptions + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions"; + }; + + return CaOptions; + })(); + + return ReusableConfigValues; + })(); + + v1beta1.ReusableConfigWrapper = (function() { + + /** + * Properties of a ReusableConfigWrapper. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IReusableConfigWrapper + * @property {string|null} [reusableConfig] ReusableConfigWrapper reusableConfig + * @property {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null} [reusableConfigValues] ReusableConfigWrapper reusableConfigValues + */ + + /** + * Constructs a new ReusableConfigWrapper. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ReusableConfigWrapper. + * @implements IReusableConfigWrapper + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper=} [properties] Properties to set + */ + function ReusableConfigWrapper(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]]; + } + + /** + * ReusableConfigWrapper reusableConfig. + * @member {string|null|undefined} reusableConfig + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @instance + */ + ReusableConfigWrapper.prototype.reusableConfig = null; + + /** + * ReusableConfigWrapper reusableConfigValues. + * @member {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null|undefined} reusableConfigValues + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @instance + */ + ReusableConfigWrapper.prototype.reusableConfigValues = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReusableConfigWrapper configValues. + * @member {"reusableConfig"|"reusableConfigValues"|undefined} configValues + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @instance + */ + Object.defineProperty(ReusableConfigWrapper.prototype, "configValues", { + get: $util.oneOfGetter($oneOfFields = ["reusableConfig", "reusableConfigValues"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReusableConfigWrapper instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @static + * @param {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigWrapper} ReusableConfigWrapper instance + */ + ReusableConfigWrapper.create = function create(properties) { + return new ReusableConfigWrapper(properties); + }; + + /** + * Encodes the specified ReusableConfigWrapper message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @static + * @param {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper} message ReusableConfigWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReusableConfigWrapper.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reusableConfig != null && Object.hasOwnProperty.call(message, "reusableConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.reusableConfig); + if (message.reusableConfigValues != null && Object.hasOwnProperty.call(message, "reusableConfigValues")) + $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.encode(message.reusableConfigValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReusableConfigWrapper message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @static + * @param {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper} message ReusableConfigWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReusableConfigWrapper.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReusableConfigWrapper message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigWrapper} ReusableConfigWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReusableConfigWrapper.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.reusableConfig = reader.string(); + break; + } + case 2: { + message.reusableConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReusableConfigWrapper message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigWrapper} ReusableConfigWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReusableConfigWrapper.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReusableConfigWrapper message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReusableConfigWrapper.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.reusableConfig != null && message.hasOwnProperty("reusableConfig")) { + properties.configValues = 1; + if (!$util.isString(message.reusableConfig)) + return "reusableConfig: string expected"; + } + if (message.reusableConfigValues != null && message.hasOwnProperty("reusableConfigValues")) { + if (properties.configValues === 1) + return "configValues: multiple values"; + properties.configValues = 1; + { + var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify(message.reusableConfigValues); + if (error) + return "reusableConfigValues." + error; + } + } + return null; + }; + + /** + * Creates a ReusableConfigWrapper message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigWrapper} ReusableConfigWrapper + */ + ReusableConfigWrapper.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper(); + if (object.reusableConfig != null) + message.reusableConfig = String(object.reusableConfig); + if (object.reusableConfigValues != null) { + if (typeof object.reusableConfigValues !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.reusableConfigValues: object expected"); + message.reusableConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.fromObject(object.reusableConfigValues); + } + return message; + }; + + /** + * Creates a plain object from a ReusableConfigWrapper message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @static + * @param {google.cloud.security.privateca.v1beta1.ReusableConfigWrapper} message ReusableConfigWrapper + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReusableConfigWrapper.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.reusableConfig != null && message.hasOwnProperty("reusableConfig")) { + object.reusableConfig = message.reusableConfig; + if (options.oneofs) + object.configValues = "reusableConfig"; + } + if (message.reusableConfigValues != null && message.hasOwnProperty("reusableConfigValues")) { + object.reusableConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.toObject(message.reusableConfigValues, options); + if (options.oneofs) + object.configValues = "reusableConfigValues"; + } + return object; + }; + + /** + * Converts this ReusableConfigWrapper to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @instance + * @returns {Object.} JSON object + */ + ReusableConfigWrapper.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReusableConfigWrapper + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReusableConfigWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ReusableConfigWrapper"; + }; + + return ReusableConfigWrapper; + })(); + + v1beta1.SubordinateConfig = (function() { + + /** + * Properties of a SubordinateConfig. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface ISubordinateConfig + * @property {string|null} [certificateAuthority] SubordinateConfig certificateAuthority + * @property {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain|null} [pemIssuerChain] SubordinateConfig pemIssuerChain + */ + + /** + * Constructs a new SubordinateConfig. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a SubordinateConfig. + * @implements ISubordinateConfig + * @constructor + * @param {google.cloud.security.privateca.v1beta1.ISubordinateConfig=} [properties] Properties to set + */ + function SubordinateConfig(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]]; + } + + /** + * SubordinateConfig certificateAuthority. + * @member {string|null|undefined} certificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @instance + */ + SubordinateConfig.prototype.certificateAuthority = null; + + /** + * SubordinateConfig pemIssuerChain. + * @member {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain|null|undefined} pemIssuerChain + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @instance + */ + SubordinateConfig.prototype.pemIssuerChain = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubordinateConfig subordinateConfig. + * @member {"certificateAuthority"|"pemIssuerChain"|undefined} subordinateConfig + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @instance + */ + Object.defineProperty(SubordinateConfig.prototype, "subordinateConfig", { + get: $util.oneOfGetter($oneOfFields = ["certificateAuthority", "pemIssuerChain"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubordinateConfig instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.ISubordinateConfig=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig} SubordinateConfig instance + */ + SubordinateConfig.create = function create(properties) { + return new SubordinateConfig(properties); + }; + + /** + * Encodes the specified SubordinateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.ISubordinateConfig} message SubordinateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubordinateConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificateAuthority); + if (message.pemIssuerChain != null && Object.hasOwnProperty.call(message, "pemIssuerChain")) + $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.encode(message.pemIssuerChain, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubordinateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.ISubordinateConfig} message SubordinateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubordinateConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubordinateConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig} SubordinateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubordinateConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.SubordinateConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.certificateAuthority = reader.string(); + break; + } + case 2: { + message.pemIssuerChain = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubordinateConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig} SubordinateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubordinateConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubordinateConfig message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubordinateConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { + properties.subordinateConfig = 1; + if (!$util.isString(message.certificateAuthority)) + return "certificateAuthority: string expected"; + } + if (message.pemIssuerChain != null && message.hasOwnProperty("pemIssuerChain")) { + if (properties.subordinateConfig === 1) + return "subordinateConfig: multiple values"; + properties.subordinateConfig = 1; + { + var error = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.verify(message.pemIssuerChain); + if (error) + return "pemIssuerChain." + error; + } + } + return null; + }; + + /** + * Creates a SubordinateConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig} SubordinateConfig + */ + SubordinateConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.SubordinateConfig) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.SubordinateConfig(); + if (object.certificateAuthority != null) + message.certificateAuthority = String(object.certificateAuthority); + if (object.pemIssuerChain != null) { + if (typeof object.pemIssuerChain !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.SubordinateConfig.pemIssuerChain: object expected"); + message.pemIssuerChain = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.fromObject(object.pemIssuerChain); + } + return message; + }; + + /** + * Creates a plain object from a SubordinateConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig} message SubordinateConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubordinateConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { + object.certificateAuthority = message.certificateAuthority; + if (options.oneofs) + object.subordinateConfig = "certificateAuthority"; + } + if (message.pemIssuerChain != null && message.hasOwnProperty("pemIssuerChain")) { + object.pemIssuerChain = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.toObject(message.pemIssuerChain, options); + if (options.oneofs) + object.subordinateConfig = "pemIssuerChain"; + } + return object; + }; + + /** + * Converts this SubordinateConfig to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @instance + * @returns {Object.} JSON object + */ + SubordinateConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubordinateConfig + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubordinateConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.SubordinateConfig"; + }; + + SubordinateConfig.SubordinateConfigChain = (function() { + + /** + * Properties of a SubordinateConfigChain. + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @interface ISubordinateConfigChain + * @property {Array.|null} [pemCertificates] SubordinateConfigChain pemCertificates + */ + + /** + * Constructs a new SubordinateConfigChain. + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig + * @classdesc Represents a SubordinateConfigChain. + * @implements ISubordinateConfigChain + * @constructor + * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain=} [properties] Properties to set + */ + function SubordinateConfigChain(properties) { + this.pemCertificates = []; + 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]]; + } + + /** + * SubordinateConfigChain pemCertificates. + * @member {Array.} pemCertificates + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain + * @instance + */ + SubordinateConfigChain.prototype.pemCertificates = $util.emptyArray; + + /** + * Creates a new SubordinateConfigChain instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain instance + */ + SubordinateConfigChain.create = function create(properties) { + return new SubordinateConfigChain(properties); + }; + + /** + * Encodes the specified SubordinateConfigChain message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain} message SubordinateConfigChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubordinateConfigChain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pemCertificates != null && message.pemCertificates.length) + for (var i = 0; i < message.pemCertificates.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificates[i]); + return writer; + }; + + /** + * Encodes the specified SubordinateConfigChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain} message SubordinateConfigChain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubordinateConfigChain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubordinateConfigChain message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubordinateConfigChain.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.pemCertificates && message.pemCertificates.length)) + message.pemCertificates = []; + message.pemCertificates.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubordinateConfigChain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubordinateConfigChain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubordinateConfigChain message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubordinateConfigChain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pemCertificates != null && message.hasOwnProperty("pemCertificates")) { + if (!Array.isArray(message.pemCertificates)) + return "pemCertificates: array expected"; + for (var i = 0; i < message.pemCertificates.length; ++i) + if (!$util.isString(message.pemCertificates[i])) + return "pemCertificates: string[] expected"; + } + return null; + }; + + /** + * Creates a SubordinateConfigChain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain + */ + SubordinateConfigChain.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain(); + if (object.pemCertificates) { + if (!Array.isArray(object.pemCertificates)) + throw TypeError(".google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.pemCertificates: array expected"); + message.pemCertificates = []; + for (var i = 0; i < object.pemCertificates.length; ++i) + message.pemCertificates[i] = String(object.pemCertificates[i]); + } + return message; + }; + + /** + * Creates a plain object from a SubordinateConfigChain message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain} message SubordinateConfigChain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubordinateConfigChain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pemCertificates = []; + if (message.pemCertificates && message.pemCertificates.length) { + object.pemCertificates = []; + for (var j = 0; j < message.pemCertificates.length; ++j) + object.pemCertificates[j] = message.pemCertificates[j]; + } + return object; + }; + + /** + * Converts this SubordinateConfigChain to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain + * @instance + * @returns {Object.} JSON object + */ + SubordinateConfigChain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubordinateConfigChain + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubordinateConfigChain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain"; + }; + + return SubordinateConfigChain; + })(); + + return SubordinateConfig; + })(); + + v1beta1.PublicKey = (function() { + + /** + * Properties of a PublicKey. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IPublicKey + * @property {google.cloud.security.privateca.v1beta1.PublicKey.KeyType|null} [type] PublicKey type + * @property {Uint8Array|null} [key] PublicKey key + */ + + /** + * Constructs a new PublicKey. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a PublicKey. + * @implements IPublicKey + * @constructor + * @param {google.cloud.security.privateca.v1beta1.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]]; + } + + /** + * PublicKey type. + * @member {google.cloud.security.privateca.v1beta1.PublicKey.KeyType} type + * @memberof google.cloud.security.privateca.v1beta1.PublicKey + * @instance + */ + PublicKey.prototype.type = 0; + + /** + * PublicKey key. + * @member {Uint8Array} key + * @memberof google.cloud.security.privateca.v1beta1.PublicKey + * @instance + */ + PublicKey.prototype.key = $util.newBuffer([]); + + /** + * Creates a new PublicKey instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.PublicKey + * @static + * @param {google.cloud.security.privateca.v1beta1.IPublicKey=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.PublicKey} PublicKey instance + */ + PublicKey.create = function create(properties) { + return new PublicKey(properties); + }; + + /** + * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.PublicKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.PublicKey + * @static + * @param {google.cloud.security.privateca.v1beta1.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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); + return writer; + }; + + /** + * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.PublicKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.PublicKey + * @static + * @param {google.cloud.security.privateca.v1beta1.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(); + }; + + /** + * Decodes a PublicKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.PublicKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.key = reader.bytes(); + 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.security.privateca.v1beta1.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.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()); + }; + + /** + * Verifies a PublicKey message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.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.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + return null; + }; + + /** + * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.PublicKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.PublicKey} PublicKey + */ + PublicKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.PublicKey) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.PublicKey(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "KEY_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PEM_RSA_KEY": + case 1: + message.type = 1; + break; + case "PEM_EC_KEY": + case 2: + message.type = 2; + break; + } + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length >= 0) + message.key = object.key; + return message; + }; + + /** + * Creates a plain object from a PublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.PublicKey + * @static + * @param {google.cloud.security.privateca.v1beta1.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.type = options.enums === String ? "KEY_TYPE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.PublicKey.KeyType[message.type] === undefined ? message.type : $root.google.cloud.security.privateca.v1beta1.PublicKey.KeyType[message.type] : message.type; + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + return object; + }; + + /** + * Converts this PublicKey to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.PublicKey + * @instance + * @returns {Object.} JSON object + */ + PublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PublicKey + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.PublicKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PublicKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.PublicKey"; + }; + + /** + * KeyType enum. + * @name google.cloud.security.privateca.v1beta1.PublicKey.KeyType + * @enum {number} + * @property {number} KEY_TYPE_UNSPECIFIED=0 KEY_TYPE_UNSPECIFIED value + * @property {number} PEM_RSA_KEY=1 PEM_RSA_KEY value + * @property {number} PEM_EC_KEY=2 PEM_EC_KEY value + */ + PublicKey.KeyType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KEY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PEM_RSA_KEY"] = 1; + values[valuesById[2] = "PEM_EC_KEY"] = 2; + return values; + })(); + + return PublicKey; + })(); + + v1beta1.CertificateConfig = (function() { + + /** + * Properties of a CertificateConfig. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface ICertificateConfig + * @property {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig|null} [subjectConfig] CertificateConfig subjectConfig + * @property {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null} [reusableConfig] CertificateConfig reusableConfig + * @property {google.cloud.security.privateca.v1beta1.IPublicKey|null} [publicKey] CertificateConfig publicKey + */ + + /** + * Constructs a new CertificateConfig. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a CertificateConfig. + * @implements ICertificateConfig + * @constructor + * @param {google.cloud.security.privateca.v1beta1.ICertificateConfig=} [properties] Properties to set + */ + function CertificateConfig(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]]; + } + + /** + * CertificateConfig subjectConfig. + * @member {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig|null|undefined} subjectConfig + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @instance + */ + CertificateConfig.prototype.subjectConfig = null; + + /** + * CertificateConfig reusableConfig. + * @member {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null|undefined} reusableConfig + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @instance + */ + CertificateConfig.prototype.reusableConfig = null; + + /** + * CertificateConfig publicKey. + * @member {google.cloud.security.privateca.v1beta1.IPublicKey|null|undefined} publicKey + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @instance + */ + CertificateConfig.prototype.publicKey = null; + + /** + * Creates a new CertificateConfig instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateConfig=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig} CertificateConfig instance + */ + CertificateConfig.create = function create(properties) { + return new CertificateConfig(properties); + }; + + /** + * Encodes the specified CertificateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateConfig} message CertificateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subjectConfig != null && Object.hasOwnProperty.call(message, "subjectConfig")) + $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.encode(message.subjectConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.reusableConfig != null && Object.hasOwnProperty.call(message, "reusableConfig")) + $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.encode(message.reusableConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + $root.google.cloud.security.privateca.v1beta1.PublicKey.encode(message.publicKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CertificateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateConfig} message CertificateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig} CertificateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subjectConfig = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.reusableConfig = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.decode(reader, reader.uint32()); + break; + } + case 3: { + message.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig} CertificateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateConfig message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subjectConfig != null && message.hasOwnProperty("subjectConfig")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.verify(message.subjectConfig); + if (error) + return "subjectConfig." + error; + } + if (message.reusableConfig != null && message.hasOwnProperty("reusableConfig")) { + var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify(message.reusableConfig); + if (error) + return "reusableConfig." + error; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) { + var error = $root.google.cloud.security.privateca.v1beta1.PublicKey.verify(message.publicKey); + if (error) + return "publicKey." + error; + } + return null; + }; + + /** + * Creates a CertificateConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig} CertificateConfig + */ + CertificateConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateConfig) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateConfig(); + if (object.subjectConfig != null) { + if (typeof object.subjectConfig !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateConfig.subjectConfig: object expected"); + message.subjectConfig = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.fromObject(object.subjectConfig); + } + if (object.reusableConfig != null) { + if (typeof object.reusableConfig !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateConfig.reusableConfig: object expected"); + message.reusableConfig = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.fromObject(object.reusableConfig); + } + if (object.publicKey != null) { + if (typeof object.publicKey !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateConfig.publicKey: object expected"); + message.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.fromObject(object.publicKey); + } + return message; + }; + + /** + * Creates a plain object from a CertificateConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateConfig} message CertificateConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subjectConfig = null; + object.reusableConfig = null; + object.publicKey = null; + } + if (message.subjectConfig != null && message.hasOwnProperty("subjectConfig")) + object.subjectConfig = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.toObject(message.subjectConfig, options); + if (message.reusableConfig != null && message.hasOwnProperty("reusableConfig")) + object.reusableConfig = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.toObject(message.reusableConfig, options); + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.toObject(message.publicKey, options); + return object; + }; + + /** + * Converts this CertificateConfig to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @instance + * @returns {Object.} JSON object + */ + CertificateConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateConfig + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateConfig"; + }; + + CertificateConfig.SubjectConfig = (function() { + + /** + * Properties of a SubjectConfig. + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @interface ISubjectConfig + * @property {google.cloud.security.privateca.v1beta1.ISubject|null} [subject] SubjectConfig subject + * @property {string|null} [commonName] SubjectConfig commonName + * @property {google.cloud.security.privateca.v1beta1.ISubjectAltNames|null} [subjectAltName] SubjectConfig subjectAltName + */ + + /** + * Constructs a new SubjectConfig. + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig + * @classdesc Represents a SubjectConfig. + * @implements ISubjectConfig + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig=} [properties] Properties to set + */ + function SubjectConfig(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]]; + } + + /** + * SubjectConfig subject. + * @member {google.cloud.security.privateca.v1beta1.ISubject|null|undefined} subject + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @instance + */ + SubjectConfig.prototype.subject = null; + + /** + * SubjectConfig commonName. + * @member {string} commonName + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @instance + */ + SubjectConfig.prototype.commonName = ""; + + /** + * SubjectConfig subjectAltName. + * @member {google.cloud.security.privateca.v1beta1.ISubjectAltNames|null|undefined} subjectAltName + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @instance + */ + SubjectConfig.prototype.subjectAltName = null; + + /** + * Creates a new SubjectConfig instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig} SubjectConfig instance + */ + SubjectConfig.create = function create(properties) { + return new SubjectConfig(properties); + }; + + /** + * Encodes the specified SubjectConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig} message SubjectConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + $root.google.cloud.security.privateca.v1beta1.Subject.encode(message.subject, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commonName); + if (message.subjectAltName != null && Object.hasOwnProperty.call(message, "subjectAltName")) + $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.encode(message.subjectAltName, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubjectConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig} message SubjectConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubjectConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig} SubjectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subject = $root.google.cloud.security.privateca.v1beta1.Subject.decode(reader, reader.uint32()); + break; + } + case 2: { + message.commonName = reader.string(); + break; + } + case 3: { + message.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubjectConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig} SubjectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubjectConfig message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubjectConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subject != null && message.hasOwnProperty("subject")) { + var error = $root.google.cloud.security.privateca.v1beta1.Subject.verify(message.subject); + if (error) + return "subject." + error; + } + if (message.commonName != null && message.hasOwnProperty("commonName")) + if (!$util.isString(message.commonName)) + return "commonName: string expected"; + if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) { + var error = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.verify(message.subjectAltName); + if (error) + return "subjectAltName." + error; + } + return null; + }; + + /** + * Creates a SubjectConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig} SubjectConfig + */ + SubjectConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig(); + if (object.subject != null) { + if (typeof object.subject !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.subject: object expected"); + message.subject = $root.google.cloud.security.privateca.v1beta1.Subject.fromObject(object.subject); + } + if (object.commonName != null) + message.commonName = String(object.commonName); + if (object.subjectAltName != null) { + if (typeof object.subjectAltName !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.subjectAltName: object expected"); + message.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.fromObject(object.subjectAltName); + } + return message; + }; + + /** + * Creates a plain object from a SubjectConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig} message SubjectConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubjectConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subject = null; + object.commonName = ""; + object.subjectAltName = null; + } + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = $root.google.cloud.security.privateca.v1beta1.Subject.toObject(message.subject, options); + if (message.commonName != null && message.hasOwnProperty("commonName")) + object.commonName = message.commonName; + if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) + object.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.toObject(message.subjectAltName, options); + return object; + }; + + /** + * Converts this SubjectConfig to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @instance + * @returns {Object.} JSON object + */ + SubjectConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubjectConfig + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubjectConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig"; + }; + + return SubjectConfig; + })(); + + return CertificateConfig; + })(); + + v1beta1.CertificateDescription = (function() { + + /** + * Properties of a CertificateDescription. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface ICertificateDescription + * @property {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription|null} [subjectDescription] CertificateDescription subjectDescription + * @property {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null} [configValues] CertificateDescription configValues + * @property {google.cloud.security.privateca.v1beta1.IPublicKey|null} [publicKey] CertificateDescription publicKey + * @property {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null} [subjectKeyId] CertificateDescription subjectKeyId + * @property {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null} [authorityKeyId] CertificateDescription authorityKeyId + * @property {Array.|null} [crlDistributionPoints] CertificateDescription crlDistributionPoints + * @property {Array.|null} [aiaIssuingCertificateUrls] CertificateDescription aiaIssuingCertificateUrls + * @property {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint|null} [certFingerprint] CertificateDescription certFingerprint + */ + + /** + * Constructs a new CertificateDescription. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a CertificateDescription. + * @implements ICertificateDescription + * @constructor + * @param {google.cloud.security.privateca.v1beta1.ICertificateDescription=} [properties] Properties to set + */ + function CertificateDescription(properties) { + this.crlDistributionPoints = []; + this.aiaIssuingCertificateUrls = []; + 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]]; + } + + /** + * CertificateDescription subjectDescription. + * @member {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription|null|undefined} subjectDescription + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.subjectDescription = null; + + /** + * CertificateDescription configValues. + * @member {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null|undefined} configValues + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.configValues = null; + + /** + * CertificateDescription publicKey. + * @member {google.cloud.security.privateca.v1beta1.IPublicKey|null|undefined} publicKey + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.publicKey = null; + + /** + * CertificateDescription subjectKeyId. + * @member {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null|undefined} subjectKeyId + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.subjectKeyId = null; + + /** + * CertificateDescription authorityKeyId. + * @member {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null|undefined} authorityKeyId + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.authorityKeyId = null; + + /** + * CertificateDescription crlDistributionPoints. + * @member {Array.} crlDistributionPoints + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.crlDistributionPoints = $util.emptyArray; + + /** + * CertificateDescription aiaIssuingCertificateUrls. + * @member {Array.} aiaIssuingCertificateUrls + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.aiaIssuingCertificateUrls = $util.emptyArray; + + /** + * CertificateDescription certFingerprint. + * @member {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint|null|undefined} certFingerprint + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @instance + */ + CertificateDescription.prototype.certFingerprint = null; + + /** + * Creates a new CertificateDescription instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateDescription=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription} CertificateDescription instance + */ + CertificateDescription.create = function create(properties) { + return new CertificateDescription(properties); + }; + + /** + * Encodes the specified CertificateDescription message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateDescription} message CertificateDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateDescription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subjectDescription != null && Object.hasOwnProperty.call(message, "subjectDescription")) + $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.encode(message.subjectDescription, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.configValues != null && Object.hasOwnProperty.call(message, "configValues")) + $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.encode(message.configValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + $root.google.cloud.security.privateca.v1beta1.PublicKey.encode(message.publicKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.subjectKeyId != null && Object.hasOwnProperty.call(message, "subjectKeyId")) + $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.encode(message.subjectKeyId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.authorityKeyId != null && Object.hasOwnProperty.call(message, "authorityKeyId")) + $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.encode(message.authorityKeyId, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.crlDistributionPoints != null && message.crlDistributionPoints.length) + for (var i = 0; i < message.crlDistributionPoints.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.crlDistributionPoints[i]); + if (message.aiaIssuingCertificateUrls != null && message.aiaIssuingCertificateUrls.length) + for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.aiaIssuingCertificateUrls[i]); + if (message.certFingerprint != null && Object.hasOwnProperty.call(message, "certFingerprint")) + $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.encode(message.certFingerprint, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CertificateDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @static + * @param {google.cloud.security.privateca.v1beta1.ICertificateDescription} message CertificateDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateDescription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateDescription message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription} CertificateDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateDescription.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subjectDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.decode(reader, reader.uint32()); + break; + } + case 2: { + message.configValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.decode(reader, reader.uint32()); + break; + } + case 3: { + message.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.decode(reader, reader.uint32()); + break; + } + case 4: { + message.subjectKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.decode(reader, reader.uint32()); + break; + } + case 5: { + message.authorityKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.crlDistributionPoints && message.crlDistributionPoints.length)) + message.crlDistributionPoints = []; + message.crlDistributionPoints.push(reader.string()); + break; + } + case 7: { + if (!(message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length)) + message.aiaIssuingCertificateUrls = []; + message.aiaIssuingCertificateUrls.push(reader.string()); + break; + } + case 8: { + message.certFingerprint = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateDescription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription} CertificateDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateDescription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateDescription message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateDescription.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subjectDescription != null && message.hasOwnProperty("subjectDescription")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.verify(message.subjectDescription); + if (error) + return "subjectDescription." + error; + } + if (message.configValues != null && message.hasOwnProperty("configValues")) { + var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify(message.configValues); + if (error) + return "configValues." + error; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) { + var error = $root.google.cloud.security.privateca.v1beta1.PublicKey.verify(message.publicKey); + if (error) + return "publicKey." + error; + } + if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify(message.subjectKeyId); + if (error) + return "subjectKeyId." + error; + } + if (message.authorityKeyId != null && message.hasOwnProperty("authorityKeyId")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify(message.authorityKeyId); + if (error) + return "authorityKeyId." + error; + } + if (message.crlDistributionPoints != null && message.hasOwnProperty("crlDistributionPoints")) { + if (!Array.isArray(message.crlDistributionPoints)) + return "crlDistributionPoints: array expected"; + for (var i = 0; i < message.crlDistributionPoints.length; ++i) + if (!$util.isString(message.crlDistributionPoints[i])) + return "crlDistributionPoints: string[] expected"; + } + if (message.aiaIssuingCertificateUrls != null && message.hasOwnProperty("aiaIssuingCertificateUrls")) { + if (!Array.isArray(message.aiaIssuingCertificateUrls)) + return "aiaIssuingCertificateUrls: array expected"; + for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) + if (!$util.isString(message.aiaIssuingCertificateUrls[i])) + return "aiaIssuingCertificateUrls: string[] expected"; + } + if (message.certFingerprint != null && message.hasOwnProperty("certFingerprint")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.verify(message.certFingerprint); + if (error) + return "certFingerprint." + error; + } + return null; + }; + + /** + * Creates a CertificateDescription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription} CertificateDescription + */ + CertificateDescription.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateDescription) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription(); + if (object.subjectDescription != null) { + if (typeof object.subjectDescription !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.subjectDescription: object expected"); + message.subjectDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.fromObject(object.subjectDescription); + } + if (object.configValues != null) { + if (typeof object.configValues !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.configValues: object expected"); + message.configValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.fromObject(object.configValues); + } + if (object.publicKey != null) { + if (typeof object.publicKey !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.publicKey: object expected"); + message.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.fromObject(object.publicKey); + } + if (object.subjectKeyId != null) { + if (typeof object.subjectKeyId !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.subjectKeyId: object expected"); + message.subjectKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.fromObject(object.subjectKeyId); + } + if (object.authorityKeyId != null) { + if (typeof object.authorityKeyId !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.authorityKeyId: object expected"); + message.authorityKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.fromObject(object.authorityKeyId); + } + if (object.crlDistributionPoints) { + if (!Array.isArray(object.crlDistributionPoints)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.crlDistributionPoints: array expected"); + message.crlDistributionPoints = []; + for (var i = 0; i < object.crlDistributionPoints.length; ++i) + message.crlDistributionPoints[i] = String(object.crlDistributionPoints[i]); + } + if (object.aiaIssuingCertificateUrls) { + if (!Array.isArray(object.aiaIssuingCertificateUrls)) + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.aiaIssuingCertificateUrls: array expected"); + message.aiaIssuingCertificateUrls = []; + for (var i = 0; i < object.aiaIssuingCertificateUrls.length; ++i) + message.aiaIssuingCertificateUrls[i] = String(object.aiaIssuingCertificateUrls[i]); + } + if (object.certFingerprint != null) { + if (typeof object.certFingerprint !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.certFingerprint: object expected"); + message.certFingerprint = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.fromObject(object.certFingerprint); + } + return message; + }; + + /** + * Creates a plain object from a CertificateDescription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription} message CertificateDescription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateDescription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.crlDistributionPoints = []; + object.aiaIssuingCertificateUrls = []; + } + if (options.defaults) { + object.subjectDescription = null; + object.configValues = null; + object.publicKey = null; + object.subjectKeyId = null; + object.authorityKeyId = null; + object.certFingerprint = null; + } + if (message.subjectDescription != null && message.hasOwnProperty("subjectDescription")) + object.subjectDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.toObject(message.subjectDescription, options); + if (message.configValues != null && message.hasOwnProperty("configValues")) + object.configValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.toObject(message.configValues, options); + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.toObject(message.publicKey, options); + if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) + object.subjectKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.toObject(message.subjectKeyId, options); + if (message.authorityKeyId != null && message.hasOwnProperty("authorityKeyId")) + object.authorityKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.toObject(message.authorityKeyId, options); + if (message.crlDistributionPoints && message.crlDistributionPoints.length) { + object.crlDistributionPoints = []; + for (var j = 0; j < message.crlDistributionPoints.length; ++j) + object.crlDistributionPoints[j] = message.crlDistributionPoints[j]; + } + if (message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length) { + object.aiaIssuingCertificateUrls = []; + for (var j = 0; j < message.aiaIssuingCertificateUrls.length; ++j) + object.aiaIssuingCertificateUrls[j] = message.aiaIssuingCertificateUrls[j]; + } + if (message.certFingerprint != null && message.hasOwnProperty("certFingerprint")) + object.certFingerprint = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.toObject(message.certFingerprint, options); + return object; + }; + + /** + * Converts this CertificateDescription to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @instance + * @returns {Object.} JSON object + */ + CertificateDescription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateDescription + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateDescription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateDescription"; + }; + + CertificateDescription.SubjectDescription = (function() { + + /** + * Properties of a SubjectDescription. + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @interface ISubjectDescription + * @property {google.cloud.security.privateca.v1beta1.ISubject|null} [subject] SubjectDescription subject + * @property {string|null} [commonName] SubjectDescription commonName + * @property {google.cloud.security.privateca.v1beta1.ISubjectAltNames|null} [subjectAltName] SubjectDescription subjectAltName + * @property {string|null} [hexSerialNumber] SubjectDescription hexSerialNumber + * @property {google.protobuf.IDuration|null} [lifetime] SubjectDescription lifetime + * @property {google.protobuf.ITimestamp|null} [notBeforeTime] SubjectDescription notBeforeTime + * @property {google.protobuf.ITimestamp|null} [notAfterTime] SubjectDescription notAfterTime + */ + + /** + * Constructs a new SubjectDescription. + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @classdesc Represents a SubjectDescription. + * @implements ISubjectDescription + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription=} [properties] Properties to set + */ + function SubjectDescription(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]]; + } + + /** + * SubjectDescription subject. + * @member {google.cloud.security.privateca.v1beta1.ISubject|null|undefined} subject + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.subject = null; + + /** + * SubjectDescription commonName. + * @member {string} commonName + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.commonName = ""; + + /** + * SubjectDescription subjectAltName. + * @member {google.cloud.security.privateca.v1beta1.ISubjectAltNames|null|undefined} subjectAltName + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.subjectAltName = null; + + /** + * SubjectDescription hexSerialNumber. + * @member {string} hexSerialNumber + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.hexSerialNumber = ""; + + /** + * SubjectDescription lifetime. + * @member {google.protobuf.IDuration|null|undefined} lifetime + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.lifetime = null; + + /** + * SubjectDescription notBeforeTime. + * @member {google.protobuf.ITimestamp|null|undefined} notBeforeTime + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.notBeforeTime = null; + + /** + * SubjectDescription notAfterTime. + * @member {google.protobuf.ITimestamp|null|undefined} notAfterTime + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @instance + */ + SubjectDescription.prototype.notAfterTime = null; + + /** + * Creates a new SubjectDescription instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription} SubjectDescription instance + */ + SubjectDescription.create = function create(properties) { + return new SubjectDescription(properties); + }; + + /** + * Encodes the specified SubjectDescription message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription} message SubjectDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectDescription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + $root.google.cloud.security.privateca.v1beta1.Subject.encode(message.subject, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commonName); + if (message.subjectAltName != null && Object.hasOwnProperty.call(message, "subjectAltName")) + $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.encode(message.subjectAltName, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hexSerialNumber != null && Object.hasOwnProperty.call(message, "hexSerialNumber")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.hexSerialNumber); + if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) + $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.notBeforeTime != null && Object.hasOwnProperty.call(message, "notBeforeTime")) + $root.google.protobuf.Timestamp.encode(message.notBeforeTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.notAfterTime != null && Object.hasOwnProperty.call(message, "notAfterTime")) + $root.google.protobuf.Timestamp.encode(message.notAfterTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubjectDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription} message SubjectDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectDescription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubjectDescription message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription} SubjectDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectDescription.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subject = $root.google.cloud.security.privateca.v1beta1.Subject.decode(reader, reader.uint32()); + break; + } + case 2: { + message.commonName = reader.string(); + break; + } + case 3: { + message.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.decode(reader, reader.uint32()); + break; + } + case 4: { + message.hexSerialNumber = reader.string(); + break; + } + case 5: { + message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.notBeforeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.notAfterTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubjectDescription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription} SubjectDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectDescription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubjectDescription message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubjectDescription.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subject != null && message.hasOwnProperty("subject")) { + var error = $root.google.cloud.security.privateca.v1beta1.Subject.verify(message.subject); + if (error) + return "subject." + error; + } + if (message.commonName != null && message.hasOwnProperty("commonName")) + if (!$util.isString(message.commonName)) + return "commonName: string expected"; + if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) { + var error = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.verify(message.subjectAltName); + if (error) + return "subjectAltName." + error; + } + if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) + if (!$util.isString(message.hexSerialNumber)) + return "hexSerialNumber: string expected"; + if (message.lifetime != null && message.hasOwnProperty("lifetime")) { + var error = $root.google.protobuf.Duration.verify(message.lifetime); + if (error) + return "lifetime." + error; + } + if (message.notBeforeTime != null && message.hasOwnProperty("notBeforeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.notBeforeTime); + if (error) + return "notBeforeTime." + error; + } + if (message.notAfterTime != null && message.hasOwnProperty("notAfterTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.notAfterTime); + if (error) + return "notAfterTime." + error; + } + return null; + }; + + /** + * Creates a SubjectDescription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription} SubjectDescription + */ + SubjectDescription.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription(); + if (object.subject != null) { + if (typeof object.subject !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.subject: object expected"); + message.subject = $root.google.cloud.security.privateca.v1beta1.Subject.fromObject(object.subject); + } + if (object.commonName != null) + message.commonName = String(object.commonName); + if (object.subjectAltName != null) { + if (typeof object.subjectAltName !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.subjectAltName: object expected"); + message.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.fromObject(object.subjectAltName); + } + if (object.hexSerialNumber != null) + message.hexSerialNumber = String(object.hexSerialNumber); + if (object.lifetime != null) { + if (typeof object.lifetime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.lifetime: object expected"); + message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); + } + if (object.notBeforeTime != null) { + if (typeof object.notBeforeTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.notBeforeTime: object expected"); + message.notBeforeTime = $root.google.protobuf.Timestamp.fromObject(object.notBeforeTime); + } + if (object.notAfterTime != null) { + if (typeof object.notAfterTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.notAfterTime: object expected"); + message.notAfterTime = $root.google.protobuf.Timestamp.fromObject(object.notAfterTime); + } + return message; + }; + + /** + * Creates a plain object from a SubjectDescription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription} message SubjectDescription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubjectDescription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subject = null; + object.commonName = ""; + object.subjectAltName = null; + object.hexSerialNumber = ""; + object.lifetime = null; + object.notBeforeTime = null; + object.notAfterTime = null; + } + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = $root.google.cloud.security.privateca.v1beta1.Subject.toObject(message.subject, options); + if (message.commonName != null && message.hasOwnProperty("commonName")) + object.commonName = message.commonName; + if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) + object.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.toObject(message.subjectAltName, options); + if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) + object.hexSerialNumber = message.hexSerialNumber; + if (message.lifetime != null && message.hasOwnProperty("lifetime")) + object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); + if (message.notBeforeTime != null && message.hasOwnProperty("notBeforeTime")) + object.notBeforeTime = $root.google.protobuf.Timestamp.toObject(message.notBeforeTime, options); + if (message.notAfterTime != null && message.hasOwnProperty("notAfterTime")) + object.notAfterTime = $root.google.protobuf.Timestamp.toObject(message.notAfterTime, options); + return object; + }; + + /** + * Converts this SubjectDescription to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @instance + * @returns {Object.} JSON object + */ + SubjectDescription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubjectDescription + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubjectDescription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription"; + }; + + return SubjectDescription; + })(); + + CertificateDescription.KeyId = (function() { + + /** + * Properties of a KeyId. + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @interface IKeyId + * @property {string|null} [keyId] KeyId keyId + */ + + /** + * Constructs a new KeyId. + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @classdesc Represents a KeyId. + * @implements IKeyId + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId=} [properties] Properties to set + */ + function KeyId(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]]; + } + + /** + * KeyId keyId. + * @member {string} keyId + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId + * @instance + */ + KeyId.prototype.keyId = ""; + + /** + * Creates a new KeyId instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId} KeyId instance + */ + KeyId.create = function create(properties) { + return new KeyId(properties); + }; + + /** + * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId} message KeyId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyId); + return writer; + }; + + /** + * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId} message KeyId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyId message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId} KeyId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyId.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId} KeyId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyId message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyId != null && message.hasOwnProperty("keyId")) + if (!$util.isString(message.keyId)) + return "keyId: string expected"; + return null; + }; + + /** + * Creates a KeyId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId} KeyId + */ + KeyId.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId(); + if (object.keyId != null) + message.keyId = String(object.keyId); + return message; + }; + + /** + * Creates a plain object from a KeyId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId} message KeyId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.keyId = ""; + if (message.keyId != null && message.hasOwnProperty("keyId")) + object.keyId = message.keyId; + return object; + }; + + /** + * Converts this KeyId to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId + * @instance + * @returns {Object.} JSON object + */ + KeyId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyId + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId"; + }; + + return KeyId; + })(); + + CertificateDescription.CertificateFingerprint = (function() { + + /** + * Properties of a CertificateFingerprint. + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @interface ICertificateFingerprint + * @property {string|null} [sha256Hash] CertificateFingerprint sha256Hash + */ + + /** + * Constructs a new CertificateFingerprint. + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription + * @classdesc Represents a CertificateFingerprint. + * @implements ICertificateFingerprint + * @constructor + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint=} [properties] Properties to set + */ + function CertificateFingerprint(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]]; + } + + /** + * CertificateFingerprint sha256Hash. + * @member {string} sha256Hash + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint + * @instance + */ + CertificateFingerprint.prototype.sha256Hash = ""; + + /** + * Creates a new CertificateFingerprint instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint} CertificateFingerprint instance + */ + CertificateFingerprint.create = function create(properties) { + return new CertificateFingerprint(properties); + }; + + /** + * Encodes the specified CertificateFingerprint message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint} message CertificateFingerprint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateFingerprint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sha256Hash != null && Object.hasOwnProperty.call(message, "sha256Hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sha256Hash); + return writer; + }; + + /** + * Encodes the specified CertificateFingerprint message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint} message CertificateFingerprint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateFingerprint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateFingerprint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint} CertificateFingerprint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateFingerprint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sha256Hash = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateFingerprint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint} CertificateFingerprint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateFingerprint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateFingerprint message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateFingerprint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash")) + if (!$util.isString(message.sha256Hash)) + return "sha256Hash: string expected"; + return null; + }; + + /** + * Creates a CertificateFingerprint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint} CertificateFingerprint + */ + CertificateFingerprint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint(); + if (object.sha256Hash != null) + message.sha256Hash = String(object.sha256Hash); + return message; + }; + + /** + * Creates a plain object from a CertificateFingerprint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint + * @static + * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint} message CertificateFingerprint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateFingerprint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sha256Hash = ""; + if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash")) + object.sha256Hash = message.sha256Hash; + return object; + }; + + /** + * Converts this CertificateFingerprint to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint + * @instance + * @returns {Object.} JSON object + */ + CertificateFingerprint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateFingerprint + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateFingerprint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint"; + }; + + return CertificateFingerprint; + })(); + + return CertificateDescription; + })(); + + v1beta1.ObjectId = (function() { + + /** + * Properties of an ObjectId. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IObjectId + * @property {Array.|null} [objectIdPath] ObjectId objectIdPath + */ + + /** + * Constructs a new ObjectId. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents an ObjectId. + * @implements IObjectId + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IObjectId=} [properties] Properties to set + */ + function ObjectId(properties) { + this.objectIdPath = []; + 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]]; + } + + /** + * ObjectId objectIdPath. + * @member {Array.} objectIdPath + * @memberof google.cloud.security.privateca.v1beta1.ObjectId + * @instance + */ + ObjectId.prototype.objectIdPath = $util.emptyArray; + + /** + * Creates a new ObjectId instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ObjectId + * @static + * @param {google.cloud.security.privateca.v1beta1.IObjectId=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ObjectId} ObjectId instance + */ + ObjectId.create = function create(properties) { + return new ObjectId(properties); + }; + + /** + * Encodes the specified ObjectId message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ObjectId.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ObjectId + * @static + * @param {google.cloud.security.privateca.v1beta1.IObjectId} message ObjectId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objectIdPath != null && message.objectIdPath.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.objectIdPath.length; ++i) + writer.int32(message.objectIdPath[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ObjectId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ObjectId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ObjectId + * @static + * @param {google.cloud.security.privateca.v1beta1.IObjectId} message ObjectId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectId message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ObjectId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ObjectId} ObjectId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectId.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ObjectId(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.objectIdPath && message.objectIdPath.length)) + message.objectIdPath = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.objectIdPath.push(reader.int32()); + } else + message.objectIdPath.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ObjectId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ObjectId} ObjectId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectId message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ObjectId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objectIdPath != null && message.hasOwnProperty("objectIdPath")) { + if (!Array.isArray(message.objectIdPath)) + return "objectIdPath: array expected"; + for (var i = 0; i < message.objectIdPath.length; ++i) + if (!$util.isInteger(message.objectIdPath[i])) + return "objectIdPath: integer[] expected"; + } + return null; + }; + + /** + * Creates an ObjectId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ObjectId + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ObjectId} ObjectId + */ + ObjectId.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ObjectId) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ObjectId(); + if (object.objectIdPath) { + if (!Array.isArray(object.objectIdPath)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ObjectId.objectIdPath: array expected"); + message.objectIdPath = []; + for (var i = 0; i < object.objectIdPath.length; ++i) + message.objectIdPath[i] = object.objectIdPath[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an ObjectId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ObjectId + * @static + * @param {google.cloud.security.privateca.v1beta1.ObjectId} message ObjectId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.objectIdPath = []; + if (message.objectIdPath && message.objectIdPath.length) { + object.objectIdPath = []; + for (var j = 0; j < message.objectIdPath.length; ++j) + object.objectIdPath[j] = message.objectIdPath[j]; + } + return object; + }; + + /** + * Converts this ObjectId to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ObjectId + * @instance + * @returns {Object.} JSON object + */ + ObjectId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectId + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ObjectId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ObjectId"; + }; + + return ObjectId; + })(); + + v1beta1.X509Extension = (function() { + + /** + * Properties of a X509Extension. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IX509Extension + * @property {google.cloud.security.privateca.v1beta1.IObjectId|null} [objectId] X509Extension objectId + * @property {boolean|null} [critical] X509Extension critical + * @property {Uint8Array|null} [value] X509Extension value + */ + + /** + * Constructs a new X509Extension. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a X509Extension. + * @implements IX509Extension + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IX509Extension=} [properties] Properties to set + */ + function X509Extension(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]]; + } + + /** + * X509Extension objectId. + * @member {google.cloud.security.privateca.v1beta1.IObjectId|null|undefined} objectId + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @instance + */ + X509Extension.prototype.objectId = null; + + /** + * X509Extension critical. + * @member {boolean} critical + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @instance + */ + X509Extension.prototype.critical = false; + + /** + * X509Extension value. + * @member {Uint8Array} value + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @instance + */ + X509Extension.prototype.value = $util.newBuffer([]); + + /** + * Creates a new X509Extension instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @static + * @param {google.cloud.security.privateca.v1beta1.IX509Extension=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.X509Extension} X509Extension instance + */ + X509Extension.create = function create(properties) { + return new X509Extension(properties); + }; + + /** + * Encodes the specified X509Extension message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.X509Extension.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @static + * @param {google.cloud.security.privateca.v1beta1.IX509Extension} message X509Extension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + X509Extension.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objectId != null && Object.hasOwnProperty.call(message, "objectId")) + $root.google.cloud.security.privateca.v1beta1.ObjectId.encode(message.objectId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.critical != null && Object.hasOwnProperty.call(message, "critical")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.critical); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified X509Extension message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.X509Extension.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @static + * @param {google.cloud.security.privateca.v1beta1.IX509Extension} message X509Extension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + X509Extension.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a X509Extension message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.X509Extension} X509Extension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + X509Extension.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.X509Extension(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.objectId = $root.google.cloud.security.privateca.v1beta1.ObjectId.decode(reader, reader.uint32()); + break; + } + case 2: { + message.critical = reader.bool(); + break; + } + case 3: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a X509Extension message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.X509Extension} X509Extension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + X509Extension.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a X509Extension message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + X509Extension.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objectId != null && message.hasOwnProperty("objectId")) { + var error = $root.google.cloud.security.privateca.v1beta1.ObjectId.verify(message.objectId); + if (error) + return "objectId." + error; + } + if (message.critical != null && message.hasOwnProperty("critical")) + if (typeof message.critical !== "boolean") + return "critical: boolean expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a X509Extension message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.X509Extension} X509Extension + */ + X509Extension.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.X509Extension) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.X509Extension(); + if (object.objectId != null) { + if (typeof object.objectId !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.X509Extension.objectId: object expected"); + message.objectId = $root.google.cloud.security.privateca.v1beta1.ObjectId.fromObject(object.objectId); + } + if (object.critical != null) + message.critical = Boolean(object.critical); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a X509Extension message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @static + * @param {google.cloud.security.privateca.v1beta1.X509Extension} message X509Extension + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + X509Extension.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.objectId = null; + object.critical = false; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.objectId != null && message.hasOwnProperty("objectId")) + object.objectId = $root.google.cloud.security.privateca.v1beta1.ObjectId.toObject(message.objectId, options); + if (message.critical != null && message.hasOwnProperty("critical")) + object.critical = message.critical; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this X509Extension to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @instance + * @returns {Object.} JSON object + */ + X509Extension.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for X509Extension + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.X509Extension + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + X509Extension.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.X509Extension"; + }; + + return X509Extension; + })(); + + v1beta1.KeyUsage = (function() { + + /** + * Properties of a KeyUsage. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IKeyUsage + * @property {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions|null} [baseKeyUsage] KeyUsage baseKeyUsage + * @property {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions|null} [extendedKeyUsage] KeyUsage extendedKeyUsage + * @property {Array.|null} [unknownExtendedKeyUsages] KeyUsage unknownExtendedKeyUsages + */ + + /** + * Constructs a new KeyUsage. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a KeyUsage. + * @implements IKeyUsage + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IKeyUsage=} [properties] Properties to set + */ + function KeyUsage(properties) { + this.unknownExtendedKeyUsages = []; + 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]]; + } + + /** + * KeyUsage baseKeyUsage. + * @member {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions|null|undefined} baseKeyUsage + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @instance + */ + KeyUsage.prototype.baseKeyUsage = null; + + /** + * KeyUsage extendedKeyUsage. + * @member {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions|null|undefined} extendedKeyUsage + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @instance + */ + KeyUsage.prototype.extendedKeyUsage = null; + + /** + * KeyUsage unknownExtendedKeyUsages. + * @member {Array.} unknownExtendedKeyUsages + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @instance + */ + KeyUsage.prototype.unknownExtendedKeyUsages = $util.emptyArray; + + /** + * Creates a new KeyUsage instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @static + * @param {google.cloud.security.privateca.v1beta1.IKeyUsage=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage} KeyUsage instance + */ + KeyUsage.create = function create(properties) { + return new KeyUsage(properties); + }; + + /** + * Encodes the specified KeyUsage message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @static + * @param {google.cloud.security.privateca.v1beta1.IKeyUsage} message KeyUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyUsage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseKeyUsage != null && Object.hasOwnProperty.call(message, "baseKeyUsage")) + $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.encode(message.baseKeyUsage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.extendedKeyUsage != null && Object.hasOwnProperty.call(message, "extendedKeyUsage")) + $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.encode(message.extendedKeyUsage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.unknownExtendedKeyUsages != null && message.unknownExtendedKeyUsages.length) + for (var i = 0; i < message.unknownExtendedKeyUsages.length; ++i) + $root.google.cloud.security.privateca.v1beta1.ObjectId.encode(message.unknownExtendedKeyUsages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KeyUsage message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @static + * @param {google.cloud.security.privateca.v1beta1.IKeyUsage} message KeyUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyUsage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyUsage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage} KeyUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyUsage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.decode(reader, reader.uint32()); + break; + } + case 2: { + message.extendedKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.unknownExtendedKeyUsages && message.unknownExtendedKeyUsages.length)) + message.unknownExtendedKeyUsages = []; + message.unknownExtendedKeyUsages.push($root.google.cloud.security.privateca.v1beta1.ObjectId.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyUsage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage} KeyUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyUsage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyUsage message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyUsage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseKeyUsage != null && message.hasOwnProperty("baseKeyUsage")) { + var error = $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.verify(message.baseKeyUsage); + if (error) + return "baseKeyUsage." + error; + } + if (message.extendedKeyUsage != null && message.hasOwnProperty("extendedKeyUsage")) { + var error = $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.verify(message.extendedKeyUsage); + if (error) + return "extendedKeyUsage." + error; + } + if (message.unknownExtendedKeyUsages != null && message.hasOwnProperty("unknownExtendedKeyUsages")) { + if (!Array.isArray(message.unknownExtendedKeyUsages)) + return "unknownExtendedKeyUsages: array expected"; + for (var i = 0; i < message.unknownExtendedKeyUsages.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.ObjectId.verify(message.unknownExtendedKeyUsages[i]); + if (error) + return "unknownExtendedKeyUsages." + error; + } + } + return null; + }; + + /** + * Creates a KeyUsage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage} KeyUsage + */ + KeyUsage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.KeyUsage) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage(); + if (object.baseKeyUsage != null) { + if (typeof object.baseKeyUsage !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.KeyUsage.baseKeyUsage: object expected"); + message.baseKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.fromObject(object.baseKeyUsage); + } + if (object.extendedKeyUsage != null) { + if (typeof object.extendedKeyUsage !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.KeyUsage.extendedKeyUsage: object expected"); + message.extendedKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.fromObject(object.extendedKeyUsage); + } + if (object.unknownExtendedKeyUsages) { + if (!Array.isArray(object.unknownExtendedKeyUsages)) + throw TypeError(".google.cloud.security.privateca.v1beta1.KeyUsage.unknownExtendedKeyUsages: array expected"); + message.unknownExtendedKeyUsages = []; + for (var i = 0; i < object.unknownExtendedKeyUsages.length; ++i) { + if (typeof object.unknownExtendedKeyUsages[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.KeyUsage.unknownExtendedKeyUsages: object expected"); + message.unknownExtendedKeyUsages[i] = $root.google.cloud.security.privateca.v1beta1.ObjectId.fromObject(object.unknownExtendedKeyUsages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a KeyUsage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @static + * @param {google.cloud.security.privateca.v1beta1.KeyUsage} message KeyUsage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyUsage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unknownExtendedKeyUsages = []; + if (options.defaults) { + object.baseKeyUsage = null; + object.extendedKeyUsage = null; + } + if (message.baseKeyUsage != null && message.hasOwnProperty("baseKeyUsage")) + object.baseKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.toObject(message.baseKeyUsage, options); + if (message.extendedKeyUsage != null && message.hasOwnProperty("extendedKeyUsage")) + object.extendedKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.toObject(message.extendedKeyUsage, options); + if (message.unknownExtendedKeyUsages && message.unknownExtendedKeyUsages.length) { + object.unknownExtendedKeyUsages = []; + for (var j = 0; j < message.unknownExtendedKeyUsages.length; ++j) + object.unknownExtendedKeyUsages[j] = $root.google.cloud.security.privateca.v1beta1.ObjectId.toObject(message.unknownExtendedKeyUsages[j], options); + } + return object; + }; + + /** + * Converts this KeyUsage to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @instance + * @returns {Object.} JSON object + */ + KeyUsage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyUsage + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.KeyUsage"; + }; + + KeyUsage.KeyUsageOptions = (function() { + + /** + * Properties of a KeyUsageOptions. + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @interface IKeyUsageOptions + * @property {boolean|null} [digitalSignature] KeyUsageOptions digitalSignature + * @property {boolean|null} [contentCommitment] KeyUsageOptions contentCommitment + * @property {boolean|null} [keyEncipherment] KeyUsageOptions keyEncipherment + * @property {boolean|null} [dataEncipherment] KeyUsageOptions dataEncipherment + * @property {boolean|null} [keyAgreement] KeyUsageOptions keyAgreement + * @property {boolean|null} [certSign] KeyUsageOptions certSign + * @property {boolean|null} [crlSign] KeyUsageOptions crlSign + * @property {boolean|null} [encipherOnly] KeyUsageOptions encipherOnly + * @property {boolean|null} [decipherOnly] KeyUsageOptions decipherOnly + */ + + /** + * Constructs a new KeyUsageOptions. + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @classdesc Represents a KeyUsageOptions. + * @implements IKeyUsageOptions + * @constructor + * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions=} [properties] Properties to set + */ + function KeyUsageOptions(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]]; + } + + /** + * KeyUsageOptions digitalSignature. + * @member {boolean} digitalSignature + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.digitalSignature = false; + + /** + * KeyUsageOptions contentCommitment. + * @member {boolean} contentCommitment + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.contentCommitment = false; + + /** + * KeyUsageOptions keyEncipherment. + * @member {boolean} keyEncipherment + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.keyEncipherment = false; + + /** + * KeyUsageOptions dataEncipherment. + * @member {boolean} dataEncipherment + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.dataEncipherment = false; + + /** + * KeyUsageOptions keyAgreement. + * @member {boolean} keyAgreement + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.keyAgreement = false; + + /** + * KeyUsageOptions certSign. + * @member {boolean} certSign + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.certSign = false; + + /** + * KeyUsageOptions crlSign. + * @member {boolean} crlSign + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.crlSign = false; + + /** + * KeyUsageOptions encipherOnly. + * @member {boolean} encipherOnly + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.encipherOnly = false; + + /** + * KeyUsageOptions decipherOnly. + * @member {boolean} decipherOnly + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @instance + */ + KeyUsageOptions.prototype.decipherOnly = false; + + /** + * Creates a new KeyUsageOptions instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions} KeyUsageOptions instance + */ + KeyUsageOptions.create = function create(properties) { + return new KeyUsageOptions(properties); + }; + + /** + * Encodes the specified KeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions} message KeyUsageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyUsageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.digitalSignature != null && Object.hasOwnProperty.call(message, "digitalSignature")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.digitalSignature); + if (message.contentCommitment != null && Object.hasOwnProperty.call(message, "contentCommitment")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.contentCommitment); + if (message.keyEncipherment != null && Object.hasOwnProperty.call(message, "keyEncipherment")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.keyEncipherment); + if (message.dataEncipherment != null && Object.hasOwnProperty.call(message, "dataEncipherment")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.dataEncipherment); + if (message.keyAgreement != null && Object.hasOwnProperty.call(message, "keyAgreement")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.keyAgreement); + if (message.certSign != null && Object.hasOwnProperty.call(message, "certSign")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.certSign); + if (message.crlSign != null && Object.hasOwnProperty.call(message, "crlSign")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.crlSign); + if (message.encipherOnly != null && Object.hasOwnProperty.call(message, "encipherOnly")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.encipherOnly); + if (message.decipherOnly != null && Object.hasOwnProperty.call(message, "decipherOnly")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.decipherOnly); + return writer; + }; + + /** + * Encodes the specified KeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions} message KeyUsageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyUsageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyUsageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions} KeyUsageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyUsageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.digitalSignature = reader.bool(); + break; + } + case 2: { + message.contentCommitment = reader.bool(); + break; + } + case 3: { + message.keyEncipherment = reader.bool(); + break; + } + case 4: { + message.dataEncipherment = reader.bool(); + break; + } + case 5: { + message.keyAgreement = reader.bool(); + break; + } + case 6: { + message.certSign = reader.bool(); + break; + } + case 7: { + message.crlSign = reader.bool(); + break; + } + case 8: { + message.encipherOnly = reader.bool(); + break; + } + case 9: { + message.decipherOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyUsageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions} KeyUsageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyUsageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyUsageOptions message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyUsageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.digitalSignature != null && message.hasOwnProperty("digitalSignature")) + if (typeof message.digitalSignature !== "boolean") + return "digitalSignature: boolean expected"; + if (message.contentCommitment != null && message.hasOwnProperty("contentCommitment")) + if (typeof message.contentCommitment !== "boolean") + return "contentCommitment: boolean expected"; + if (message.keyEncipherment != null && message.hasOwnProperty("keyEncipherment")) + if (typeof message.keyEncipherment !== "boolean") + return "keyEncipherment: boolean expected"; + if (message.dataEncipherment != null && message.hasOwnProperty("dataEncipherment")) + if (typeof message.dataEncipherment !== "boolean") + return "dataEncipherment: boolean expected"; + if (message.keyAgreement != null && message.hasOwnProperty("keyAgreement")) + if (typeof message.keyAgreement !== "boolean") + return "keyAgreement: boolean expected"; + if (message.certSign != null && message.hasOwnProperty("certSign")) + if (typeof message.certSign !== "boolean") + return "certSign: boolean expected"; + if (message.crlSign != null && message.hasOwnProperty("crlSign")) + if (typeof message.crlSign !== "boolean") + return "crlSign: boolean expected"; + if (message.encipherOnly != null && message.hasOwnProperty("encipherOnly")) + if (typeof message.encipherOnly !== "boolean") + return "encipherOnly: boolean expected"; + if (message.decipherOnly != null && message.hasOwnProperty("decipherOnly")) + if (typeof message.decipherOnly !== "boolean") + return "decipherOnly: boolean expected"; + return null; + }; + + /** + * Creates a KeyUsageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions} KeyUsageOptions + */ + KeyUsageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions(); + if (object.digitalSignature != null) + message.digitalSignature = Boolean(object.digitalSignature); + if (object.contentCommitment != null) + message.contentCommitment = Boolean(object.contentCommitment); + if (object.keyEncipherment != null) + message.keyEncipherment = Boolean(object.keyEncipherment); + if (object.dataEncipherment != null) + message.dataEncipherment = Boolean(object.dataEncipherment); + if (object.keyAgreement != null) + message.keyAgreement = Boolean(object.keyAgreement); + if (object.certSign != null) + message.certSign = Boolean(object.certSign); + if (object.crlSign != null) + message.crlSign = Boolean(object.crlSign); + if (object.encipherOnly != null) + message.encipherOnly = Boolean(object.encipherOnly); + if (object.decipherOnly != null) + message.decipherOnly = Boolean(object.decipherOnly); + return message; + }; + + /** + * Creates a plain object from a KeyUsageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions} message KeyUsageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyUsageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.digitalSignature = false; + object.contentCommitment = false; + object.keyEncipherment = false; + object.dataEncipherment = false; + object.keyAgreement = false; + object.certSign = false; + object.crlSign = false; + object.encipherOnly = false; + object.decipherOnly = false; + } + if (message.digitalSignature != null && message.hasOwnProperty("digitalSignature")) + object.digitalSignature = message.digitalSignature; + if (message.contentCommitment != null && message.hasOwnProperty("contentCommitment")) + object.contentCommitment = message.contentCommitment; + if (message.keyEncipherment != null && message.hasOwnProperty("keyEncipherment")) + object.keyEncipherment = message.keyEncipherment; + if (message.dataEncipherment != null && message.hasOwnProperty("dataEncipherment")) + object.dataEncipherment = message.dataEncipherment; + if (message.keyAgreement != null && message.hasOwnProperty("keyAgreement")) + object.keyAgreement = message.keyAgreement; + if (message.certSign != null && message.hasOwnProperty("certSign")) + object.certSign = message.certSign; + if (message.crlSign != null && message.hasOwnProperty("crlSign")) + object.crlSign = message.crlSign; + if (message.encipherOnly != null && message.hasOwnProperty("encipherOnly")) + object.encipherOnly = message.encipherOnly; + if (message.decipherOnly != null && message.hasOwnProperty("decipherOnly")) + object.decipherOnly = message.decipherOnly; + return object; + }; + + /** + * Converts this KeyUsageOptions to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @instance + * @returns {Object.} JSON object + */ + KeyUsageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyUsageOptions + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyUsageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions"; + }; + + return KeyUsageOptions; + })(); + + KeyUsage.ExtendedKeyUsageOptions = (function() { + + /** + * Properties of an ExtendedKeyUsageOptions. + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @interface IExtendedKeyUsageOptions + * @property {boolean|null} [serverAuth] ExtendedKeyUsageOptions serverAuth + * @property {boolean|null} [clientAuth] ExtendedKeyUsageOptions clientAuth + * @property {boolean|null} [codeSigning] ExtendedKeyUsageOptions codeSigning + * @property {boolean|null} [emailProtection] ExtendedKeyUsageOptions emailProtection + * @property {boolean|null} [timeStamping] ExtendedKeyUsageOptions timeStamping + * @property {boolean|null} [ocspSigning] ExtendedKeyUsageOptions ocspSigning + */ + + /** + * Constructs a new ExtendedKeyUsageOptions. + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage + * @classdesc Represents an ExtendedKeyUsageOptions. + * @implements IExtendedKeyUsageOptions + * @constructor + * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions=} [properties] Properties to set + */ + function ExtendedKeyUsageOptions(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]]; + } + + /** + * ExtendedKeyUsageOptions serverAuth. + * @member {boolean} serverAuth + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.serverAuth = false; + + /** + * ExtendedKeyUsageOptions clientAuth. + * @member {boolean} clientAuth + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.clientAuth = false; + + /** + * ExtendedKeyUsageOptions codeSigning. + * @member {boolean} codeSigning + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.codeSigning = false; + + /** + * ExtendedKeyUsageOptions emailProtection. + * @member {boolean} emailProtection + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.emailProtection = false; + + /** + * ExtendedKeyUsageOptions timeStamping. + * @member {boolean} timeStamping + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.timeStamping = false; + + /** + * ExtendedKeyUsageOptions ocspSigning. + * @member {boolean} ocspSigning + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @instance + */ + ExtendedKeyUsageOptions.prototype.ocspSigning = false; + + /** + * Creates a new ExtendedKeyUsageOptions instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions instance + */ + ExtendedKeyUsageOptions.create = function create(properties) { + return new ExtendedKeyUsageOptions(properties); + }; + + /** + * Encodes the specified ExtendedKeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions} message ExtendedKeyUsageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtendedKeyUsageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serverAuth != null && Object.hasOwnProperty.call(message, "serverAuth")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.serverAuth); + if (message.clientAuth != null && Object.hasOwnProperty.call(message, "clientAuth")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.clientAuth); + if (message.codeSigning != null && Object.hasOwnProperty.call(message, "codeSigning")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.codeSigning); + if (message.emailProtection != null && Object.hasOwnProperty.call(message, "emailProtection")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.emailProtection); + if (message.timeStamping != null && Object.hasOwnProperty.call(message, "timeStamping")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.timeStamping); + if (message.ocspSigning != null && Object.hasOwnProperty.call(message, "ocspSigning")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.ocspSigning); + return writer; + }; + + /** + * Encodes the specified ExtendedKeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions} message ExtendedKeyUsageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtendedKeyUsageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtendedKeyUsageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serverAuth = reader.bool(); + break; + } + case 2: { + message.clientAuth = reader.bool(); + break; + } + case 3: { + message.codeSigning = reader.bool(); + break; + } + case 4: { + message.emailProtection = reader.bool(); + break; + } + case 5: { + message.timeStamping = reader.bool(); + break; + } + case 6: { + message.ocspSigning = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtendedKeyUsageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtendedKeyUsageOptions message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtendedKeyUsageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serverAuth != null && message.hasOwnProperty("serverAuth")) + if (typeof message.serverAuth !== "boolean") + return "serverAuth: boolean expected"; + if (message.clientAuth != null && message.hasOwnProperty("clientAuth")) + if (typeof message.clientAuth !== "boolean") + return "clientAuth: boolean expected"; + if (message.codeSigning != null && message.hasOwnProperty("codeSigning")) + if (typeof message.codeSigning !== "boolean") + return "codeSigning: boolean expected"; + if (message.emailProtection != null && message.hasOwnProperty("emailProtection")) + if (typeof message.emailProtection !== "boolean") + return "emailProtection: boolean expected"; + if (message.timeStamping != null && message.hasOwnProperty("timeStamping")) + if (typeof message.timeStamping !== "boolean") + return "timeStamping: boolean expected"; + if (message.ocspSigning != null && message.hasOwnProperty("ocspSigning")) + if (typeof message.ocspSigning !== "boolean") + return "ocspSigning: boolean expected"; + return null; + }; + + /** + * Creates an ExtendedKeyUsageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions + */ + ExtendedKeyUsageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions(); + if (object.serverAuth != null) + message.serverAuth = Boolean(object.serverAuth); + if (object.clientAuth != null) + message.clientAuth = Boolean(object.clientAuth); + if (object.codeSigning != null) + message.codeSigning = Boolean(object.codeSigning); + if (object.emailProtection != null) + message.emailProtection = Boolean(object.emailProtection); + if (object.timeStamping != null) + message.timeStamping = Boolean(object.timeStamping); + if (object.ocspSigning != null) + message.ocspSigning = Boolean(object.ocspSigning); + return message; + }; + + /** + * Creates a plain object from an ExtendedKeyUsageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions} message ExtendedKeyUsageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtendedKeyUsageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serverAuth = false; + object.clientAuth = false; + object.codeSigning = false; + object.emailProtection = false; + object.timeStamping = false; + object.ocspSigning = false; + } + if (message.serverAuth != null && message.hasOwnProperty("serverAuth")) + object.serverAuth = message.serverAuth; + if (message.clientAuth != null && message.hasOwnProperty("clientAuth")) + object.clientAuth = message.clientAuth; + if (message.codeSigning != null && message.hasOwnProperty("codeSigning")) + object.codeSigning = message.codeSigning; + if (message.emailProtection != null && message.hasOwnProperty("emailProtection")) + object.emailProtection = message.emailProtection; + if (message.timeStamping != null && message.hasOwnProperty("timeStamping")) + object.timeStamping = message.timeStamping; + if (message.ocspSigning != null && message.hasOwnProperty("ocspSigning")) + object.ocspSigning = message.ocspSigning; + return object; + }; + + /** + * Converts this ExtendedKeyUsageOptions to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @instance + * @returns {Object.} JSON object + */ + ExtendedKeyUsageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtendedKeyUsageOptions + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtendedKeyUsageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions"; + }; + + return ExtendedKeyUsageOptions; + })(); + + return KeyUsage; + })(); + + v1beta1.Subject = (function() { + + /** + * Properties of a Subject. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface ISubject + * @property {string|null} [countryCode] Subject countryCode + * @property {string|null} [organization] Subject organization + * @property {string|null} [organizationalUnit] Subject organizationalUnit + * @property {string|null} [locality] Subject locality + * @property {string|null} [province] Subject province + * @property {string|null} [streetAddress] Subject streetAddress + * @property {string|null} [postalCode] Subject postalCode + */ + + /** + * Constructs a new Subject. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a Subject. + * @implements ISubject + * @constructor + * @param {google.cloud.security.privateca.v1beta1.ISubject=} [properties] Properties to set + */ + function Subject(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]]; + } + + /** + * Subject countryCode. + * @member {string} countryCode + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @instance + */ + Subject.prototype.countryCode = ""; + + /** + * Subject organization. + * @member {string} organization + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @instance + */ + Subject.prototype.organization = ""; + + /** + * Subject organizationalUnit. + * @member {string} organizationalUnit + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @instance + */ + Subject.prototype.organizationalUnit = ""; + + /** + * Subject locality. + * @member {string} locality + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @instance + */ + Subject.prototype.locality = ""; + + /** + * Subject province. + * @member {string} province + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @instance + */ + Subject.prototype.province = ""; + + /** + * Subject streetAddress. + * @member {string} streetAddress + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @instance + */ + Subject.prototype.streetAddress = ""; + + /** + * Subject postalCode. + * @member {string} postalCode + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @instance + */ + Subject.prototype.postalCode = ""; + + /** + * Creates a new Subject instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @static + * @param {google.cloud.security.privateca.v1beta1.ISubject=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.Subject} Subject instance + */ + Subject.create = function create(properties) { + return new Subject(properties); + }; + + /** + * Encodes the specified Subject message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Subject.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @static + * @param {google.cloud.security.privateca.v1beta1.ISubject} message Subject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.countryCode != null && Object.hasOwnProperty.call(message, "countryCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.countryCode); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.organization); + if (message.organizationalUnit != null && Object.hasOwnProperty.call(message, "organizationalUnit")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.organizationalUnit); + if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.locality); + if (message.province != null && Object.hasOwnProperty.call(message, "province")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.province); + if (message.streetAddress != null && Object.hasOwnProperty.call(message, "streetAddress")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.streetAddress); + if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.postalCode); + return writer; + }; + + /** + * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Subject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @static + * @param {google.cloud.security.privateca.v1beta1.ISubject} message Subject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Subject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.Subject} Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subject.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.Subject(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.countryCode = reader.string(); + break; + } + case 2: { + message.organization = reader.string(); + break; + } + case 3: { + message.organizationalUnit = reader.string(); + break; + } + case 4: { + message.locality = reader.string(); + break; + } + case 5: { + message.province = reader.string(); + break; + } + case 6: { + message.streetAddress = reader.string(); + break; + } + case 7: { + message.postalCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Subject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.Subject} Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Subject message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Subject.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.countryCode != null && message.hasOwnProperty("countryCode")) + if (!$util.isString(message.countryCode)) + return "countryCode: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) + if (!$util.isString(message.organizationalUnit)) + return "organizationalUnit: string expected"; + if (message.locality != null && message.hasOwnProperty("locality")) + if (!$util.isString(message.locality)) + return "locality: string expected"; + if (message.province != null && message.hasOwnProperty("province")) + if (!$util.isString(message.province)) + return "province: string expected"; + if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) + if (!$util.isString(message.streetAddress)) + return "streetAddress: string expected"; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + if (!$util.isString(message.postalCode)) + return "postalCode: string expected"; + return null; + }; + + /** + * Creates a Subject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.Subject} Subject + */ + Subject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.Subject) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.Subject(); + if (object.countryCode != null) + message.countryCode = String(object.countryCode); + if (object.organization != null) + message.organization = String(object.organization); + if (object.organizationalUnit != null) + message.organizationalUnit = String(object.organizationalUnit); + if (object.locality != null) + message.locality = String(object.locality); + if (object.province != null) + message.province = String(object.province); + if (object.streetAddress != null) + message.streetAddress = String(object.streetAddress); + if (object.postalCode != null) + message.postalCode = String(object.postalCode); + return message; + }; + + /** + * Creates a plain object from a Subject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @static + * @param {google.cloud.security.privateca.v1beta1.Subject} message Subject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Subject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.countryCode = ""; + object.organization = ""; + object.organizationalUnit = ""; + object.locality = ""; + object.province = ""; + object.streetAddress = ""; + object.postalCode = ""; + } + if (message.countryCode != null && message.hasOwnProperty("countryCode")) + object.countryCode = message.countryCode; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) + object.organizationalUnit = message.organizationalUnit; + if (message.locality != null && message.hasOwnProperty("locality")) + object.locality = message.locality; + if (message.province != null && message.hasOwnProperty("province")) + object.province = message.province; + if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) + object.streetAddress = message.streetAddress; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + object.postalCode = message.postalCode; + return object; + }; + + /** + * Converts this Subject to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @instance + * @returns {Object.} JSON object + */ + Subject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Subject + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.Subject + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Subject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.Subject"; + }; + + return Subject; + })(); + + v1beta1.SubjectAltNames = (function() { + + /** + * Properties of a SubjectAltNames. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface ISubjectAltNames + * @property {Array.|null} [dnsNames] SubjectAltNames dnsNames + * @property {Array.|null} [uris] SubjectAltNames uris + * @property {Array.|null} [emailAddresses] SubjectAltNames emailAddresses + * @property {Array.|null} [ipAddresses] SubjectAltNames ipAddresses + * @property {Array.|null} [customSans] SubjectAltNames customSans + */ + + /** + * Constructs a new SubjectAltNames. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a SubjectAltNames. + * @implements ISubjectAltNames + * @constructor + * @param {google.cloud.security.privateca.v1beta1.ISubjectAltNames=} [properties] Properties to set + */ + function SubjectAltNames(properties) { + this.dnsNames = []; + this.uris = []; + this.emailAddresses = []; + this.ipAddresses = []; + this.customSans = []; + 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]]; + } + + /** + * SubjectAltNames dnsNames. + * @member {Array.} dnsNames + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @instance + */ + SubjectAltNames.prototype.dnsNames = $util.emptyArray; + + /** + * SubjectAltNames uris. + * @member {Array.} uris + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @instance + */ + SubjectAltNames.prototype.uris = $util.emptyArray; + + /** + * SubjectAltNames emailAddresses. + * @member {Array.} emailAddresses + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @instance + */ + SubjectAltNames.prototype.emailAddresses = $util.emptyArray; + + /** + * SubjectAltNames ipAddresses. + * @member {Array.} ipAddresses + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @instance + */ + SubjectAltNames.prototype.ipAddresses = $util.emptyArray; + + /** + * SubjectAltNames customSans. + * @member {Array.} customSans + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @instance + */ + SubjectAltNames.prototype.customSans = $util.emptyArray; + + /** + * Creates a new SubjectAltNames instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1beta1.ISubjectAltNames=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.SubjectAltNames} SubjectAltNames instance + */ + SubjectAltNames.create = function create(properties) { + return new SubjectAltNames(properties); + }; + + /** + * Encodes the specified SubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubjectAltNames.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1beta1.ISubjectAltNames} message SubjectAltNames message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectAltNames.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dnsNames != null && message.dnsNames.length) + for (var i = 0; i < message.dnsNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dnsNames[i]); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uris[i]); + if (message.emailAddresses != null && message.emailAddresses.length) + for (var i = 0; i < message.emailAddresses.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.emailAddresses[i]); + if (message.ipAddresses != null && message.ipAddresses.length) + for (var i = 0; i < message.ipAddresses.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ipAddresses[i]); + if (message.customSans != null && message.customSans.length) + for (var i = 0; i < message.customSans.length; ++i) + $root.google.cloud.security.privateca.v1beta1.X509Extension.encode(message.customSans[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubjectAltNames.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1beta1.ISubjectAltNames} message SubjectAltNames message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubjectAltNames.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubjectAltNames message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.SubjectAltNames} SubjectAltNames + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectAltNames.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.SubjectAltNames(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dnsNames && message.dnsNames.length)) + message.dnsNames = []; + message.dnsNames.push(reader.string()); + break; + } + case 2: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } + case 3: { + if (!(message.emailAddresses && message.emailAddresses.length)) + message.emailAddresses = []; + message.emailAddresses.push(reader.string()); + break; + } + case 4: { + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(reader.string()); + break; + } + case 5: { + if (!(message.customSans && message.customSans.length)) + message.customSans = []; + message.customSans.push($root.google.cloud.security.privateca.v1beta1.X509Extension.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubjectAltNames message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.SubjectAltNames} SubjectAltNames + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubjectAltNames.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubjectAltNames message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubjectAltNames.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { + if (!Array.isArray(message.dnsNames)) + return "dnsNames: array expected"; + for (var i = 0; i < message.dnsNames.length; ++i) + if (!$util.isString(message.dnsNames[i])) + return "dnsNames: string[] expected"; + } + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + if (message.emailAddresses != null && message.hasOwnProperty("emailAddresses")) { + if (!Array.isArray(message.emailAddresses)) + return "emailAddresses: array expected"; + for (var i = 0; i < message.emailAddresses.length; ++i) + if (!$util.isString(message.emailAddresses[i])) + return "emailAddresses: string[] expected"; + } + if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (!Array.isArray(message.ipAddresses)) + return "ipAddresses: array expected"; + for (var i = 0; i < message.ipAddresses.length; ++i) + if (!$util.isString(message.ipAddresses[i])) + return "ipAddresses: string[] expected"; + } + if (message.customSans != null && message.hasOwnProperty("customSans")) { + if (!Array.isArray(message.customSans)) + return "customSans: array expected"; + for (var i = 0; i < message.customSans.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.X509Extension.verify(message.customSans[i]); + if (error) + return "customSans." + error; + } + } + return null; + }; + + /** + * Creates a SubjectAltNames message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.SubjectAltNames} SubjectAltNames + */ + SubjectAltNames.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.SubjectAltNames) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.SubjectAltNames(); + if (object.dnsNames) { + if (!Array.isArray(object.dnsNames)) + throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.dnsNames: array expected"); + message.dnsNames = []; + for (var i = 0; i < object.dnsNames.length; ++i) + message.dnsNames[i] = String(object.dnsNames[i]); + } + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + if (object.emailAddresses) { + if (!Array.isArray(object.emailAddresses)) + throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.emailAddresses: array expected"); + message.emailAddresses = []; + for (var i = 0; i < object.emailAddresses.length; ++i) + message.emailAddresses[i] = String(object.emailAddresses[i]); + } + if (object.ipAddresses) { + if (!Array.isArray(object.ipAddresses)) + throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.ipAddresses: array expected"); + message.ipAddresses = []; + for (var i = 0; i < object.ipAddresses.length; ++i) + message.ipAddresses[i] = String(object.ipAddresses[i]); + } + if (object.customSans) { + if (!Array.isArray(object.customSans)) + throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.customSans: array expected"); + message.customSans = []; + for (var i = 0; i < object.customSans.length; ++i) { + if (typeof object.customSans[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.customSans: object expected"); + message.customSans[i] = $root.google.cloud.security.privateca.v1beta1.X509Extension.fromObject(object.customSans[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SubjectAltNames message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @static + * @param {google.cloud.security.privateca.v1beta1.SubjectAltNames} message SubjectAltNames + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubjectAltNames.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dnsNames = []; + object.uris = []; + object.emailAddresses = []; + object.ipAddresses = []; + object.customSans = []; + } + if (message.dnsNames && message.dnsNames.length) { + object.dnsNames = []; + for (var j = 0; j < message.dnsNames.length; ++j) + object.dnsNames[j] = message.dnsNames[j]; + } + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + if (message.emailAddresses && message.emailAddresses.length) { + object.emailAddresses = []; + for (var j = 0; j < message.emailAddresses.length; ++j) + object.emailAddresses[j] = message.emailAddresses[j]; + } + if (message.ipAddresses && message.ipAddresses.length) { + object.ipAddresses = []; + for (var j = 0; j < message.ipAddresses.length; ++j) + object.ipAddresses[j] = message.ipAddresses[j]; + } + if (message.customSans && message.customSans.length) { + object.customSans = []; + for (var j = 0; j < message.customSans.length; ++j) + object.customSans[j] = $root.google.cloud.security.privateca.v1beta1.X509Extension.toObject(message.customSans[j], options); + } + return object; + }; + + /** + * Converts this SubjectAltNames to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @instance + * @returns {Object.} JSON object + */ + SubjectAltNames.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubjectAltNames + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubjectAltNames.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.SubjectAltNames"; + }; + + return SubjectAltNames; + })(); + + /** + * RevocationReason enum. + * @name google.cloud.security.privateca.v1beta1.RevocationReason + * @enum {number} + * @property {number} REVOCATION_REASON_UNSPECIFIED=0 REVOCATION_REASON_UNSPECIFIED value + * @property {number} KEY_COMPROMISE=1 KEY_COMPROMISE value + * @property {number} CERTIFICATE_AUTHORITY_COMPROMISE=2 CERTIFICATE_AUTHORITY_COMPROMISE value + * @property {number} AFFILIATION_CHANGED=3 AFFILIATION_CHANGED value + * @property {number} SUPERSEDED=4 SUPERSEDED value + * @property {number} CESSATION_OF_OPERATION=5 CESSATION_OF_OPERATION value + * @property {number} CERTIFICATE_HOLD=6 CERTIFICATE_HOLD value + * @property {number} PRIVILEGE_WITHDRAWN=7 PRIVILEGE_WITHDRAWN value + * @property {number} ATTRIBUTE_AUTHORITY_COMPROMISE=8 ATTRIBUTE_AUTHORITY_COMPROMISE value + */ + v1beta1.RevocationReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REVOCATION_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "KEY_COMPROMISE"] = 1; + values[valuesById[2] = "CERTIFICATE_AUTHORITY_COMPROMISE"] = 2; + values[valuesById[3] = "AFFILIATION_CHANGED"] = 3; + values[valuesById[4] = "SUPERSEDED"] = 4; + values[valuesById[5] = "CESSATION_OF_OPERATION"] = 5; + values[valuesById[6] = "CERTIFICATE_HOLD"] = 6; + values[valuesById[7] = "PRIVILEGE_WITHDRAWN"] = 7; + values[valuesById[8] = "ATTRIBUTE_AUTHORITY_COMPROMISE"] = 8; + return values; + })(); + + v1beta1.CertificateAuthorityService = (function() { + + /** + * Constructs a new CertificateAuthorityService service. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a CertificateAuthorityService + * @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 CertificateAuthorityService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CertificateAuthorityService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CertificateAuthorityService; + + /** + * Creates new CertificateAuthorityService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @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 {CertificateAuthorityService} RPC service. Useful where requests and/or responses are streamed. + */ + CertificateAuthorityService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|createCertificate}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef CreateCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.Certificate} [response] Certificate + */ + + /** + * Calls CreateCertificate. + * @function createCertificate + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest} request CreateCertificateRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateCallback} callback Node-style callback called with the error, if any, and Certificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.createCertificate = function createCertificate(request, callback) { + return this.rpcCall(createCertificate, $root.google.cloud.security.privateca.v1beta1.CreateCertificateRequest, $root.google.cloud.security.privateca.v1beta1.Certificate, request, callback); + }, "name", { value: "CreateCertificate" }); + + /** + * Calls CreateCertificate. + * @function createCertificate + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest} request CreateCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificate}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef GetCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.Certificate} [response] Certificate + */ + + /** + * Calls GetCertificate. + * @function getCertificate + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest} request GetCertificateRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateCallback} callback Node-style callback called with the error, if any, and Certificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.getCertificate = function getCertificate(request, callback) { + return this.rpcCall(getCertificate, $root.google.cloud.security.privateca.v1beta1.GetCertificateRequest, $root.google.cloud.security.privateca.v1beta1.Certificate, request, callback); + }, "name", { value: "GetCertificate" }); + + /** + * Calls GetCertificate. + * @function getCertificate + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest} request GetCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificates}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef ListCertificatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} [response] ListCertificatesResponse + */ + + /** + * Calls ListCertificates. + * @function listCertificates + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest} request ListCertificatesRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificatesCallback} callback Node-style callback called with the error, if any, and ListCertificatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.listCertificates = function listCertificates(request, callback) { + return this.rpcCall(listCertificates, $root.google.cloud.security.privateca.v1beta1.ListCertificatesRequest, $root.google.cloud.security.privateca.v1beta1.ListCertificatesResponse, request, callback); + }, "name", { value: "ListCertificates" }); + + /** + * Calls ListCertificates. + * @function listCertificates + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest} request ListCertificatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|revokeCertificate}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef RevokeCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.Certificate} [response] Certificate + */ + + /** + * Calls RevokeCertificate. + * @function revokeCertificate + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest} request RevokeCertificateRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificateCallback} callback Node-style callback called with the error, if any, and Certificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.revokeCertificate = function revokeCertificate(request, callback) { + return this.rpcCall(revokeCertificate, $root.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest, $root.google.cloud.security.privateca.v1beta1.Certificate, request, callback); + }, "name", { value: "RevokeCertificate" }); + + /** + * Calls RevokeCertificate. + * @function revokeCertificate + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest} request RevokeCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificate}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef UpdateCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.Certificate} [response] Certificate + */ + + /** + * Calls UpdateCertificate. + * @function updateCertificate + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest} request UpdateCertificateRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateCallback} callback Node-style callback called with the error, if any, and Certificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.updateCertificate = function updateCertificate(request, callback) { + return this.rpcCall(updateCertificate, $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest, $root.google.cloud.security.privateca.v1beta1.Certificate, request, callback); + }, "name", { value: "UpdateCertificate" }); + + /** + * Calls UpdateCertificate. + * @function updateCertificate + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest} request UpdateCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|activateCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef ActivateCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ActivateCertificateAuthority. + * @function activateCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest} request ActivateCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.activateCertificateAuthority = function activateCertificateAuthority(request, callback) { + return this.rpcCall(activateCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ActivateCertificateAuthority" }); + + /** + * Calls ActivateCertificateAuthority. + * @function activateCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest} request ActivateCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|createCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef CreateCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCertificateAuthority. + * @function createCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest} request CreateCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.createCertificateAuthority = function createCertificateAuthority(request, callback) { + return this.rpcCall(createCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCertificateAuthority" }); + + /** + * Calls CreateCertificateAuthority. + * @function createCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest} request CreateCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|disableCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef DisableCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DisableCertificateAuthority. + * @function disableCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest} request DisableCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.disableCertificateAuthority = function disableCertificateAuthority(request, callback) { + return this.rpcCall(disableCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DisableCertificateAuthority" }); + + /** + * Calls DisableCertificateAuthority. + * @function disableCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest} request DisableCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|enableCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef EnableCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls EnableCertificateAuthority. + * @function enableCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest} request EnableCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.enableCertificateAuthority = function enableCertificateAuthority(request, callback) { + return this.rpcCall(enableCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "EnableCertificateAuthority" }); + + /** + * Calls EnableCertificateAuthority. + * @function enableCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest} request EnableCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|fetchCertificateAuthorityCsr}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef FetchCertificateAuthorityCsrCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} [response] FetchCertificateAuthorityCsrResponse + */ + + /** + * Calls FetchCertificateAuthorityCsr. + * @function fetchCertificateAuthorityCsr + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest} request FetchCertificateAuthorityCsrRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsrCallback} callback Node-style callback called with the error, if any, and FetchCertificateAuthorityCsrResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.fetchCertificateAuthorityCsr = function fetchCertificateAuthorityCsr(request, callback) { + return this.rpcCall(fetchCertificateAuthorityCsr, $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest, $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse, request, callback); + }, "name", { value: "FetchCertificateAuthorityCsr" }); + + /** + * Calls FetchCertificateAuthorityCsr. + * @function fetchCertificateAuthorityCsr + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest} request FetchCertificateAuthorityCsrRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef GetCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority} [response] CertificateAuthority + */ + + /** + * Calls GetCertificateAuthority. + * @function getCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest} request GetCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and CertificateAuthority + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.getCertificateAuthority = function getCertificateAuthority(request, callback) { + return this.rpcCall(getCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest, $root.google.cloud.security.privateca.v1beta1.CertificateAuthority, request, callback); + }, "name", { value: "GetCertificateAuthority" }); + + /** + * Calls GetCertificateAuthority. + * @function getCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest} request GetCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificateAuthorities}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef ListCertificateAuthoritiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} [response] ListCertificateAuthoritiesResponse + */ + + /** + * Calls ListCertificateAuthorities. + * @function listCertificateAuthorities + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest} request ListCertificateAuthoritiesRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthoritiesCallback} callback Node-style callback called with the error, if any, and ListCertificateAuthoritiesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.listCertificateAuthorities = function listCertificateAuthorities(request, callback) { + return this.rpcCall(listCertificateAuthorities, $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest, $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse, request, callback); + }, "name", { value: "ListCertificateAuthorities" }); + + /** + * Calls ListCertificateAuthorities. + * @function listCertificateAuthorities + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest} request ListCertificateAuthoritiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|restoreCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef RestoreCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreCertificateAuthority. + * @function restoreCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest} request RestoreCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.restoreCertificateAuthority = function restoreCertificateAuthority(request, callback) { + return this.rpcCall(restoreCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreCertificateAuthority" }); + + /** + * Calls RestoreCertificateAuthority. + * @function restoreCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest} request RestoreCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|scheduleDeleteCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef ScheduleDeleteCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ScheduleDeleteCertificateAuthority. + * @function scheduleDeleteCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest} request ScheduleDeleteCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.scheduleDeleteCertificateAuthority = function scheduleDeleteCertificateAuthority(request, callback) { + return this.rpcCall(scheduleDeleteCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ScheduleDeleteCertificateAuthority" }); + + /** + * Calls ScheduleDeleteCertificateAuthority. + * @function scheduleDeleteCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest} request ScheduleDeleteCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificateAuthority}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef UpdateCertificateAuthorityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCertificateAuthority. + * @function updateCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest} request UpdateCertificateAuthorityRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.updateCertificateAuthority = function updateCertificateAuthority(request, callback) { + return this.rpcCall(updateCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCertificateAuthority" }); + + /** + * Calls UpdateCertificateAuthority. + * @function updateCertificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest} request UpdateCertificateAuthorityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificateRevocationList}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef GetCertificateRevocationListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList} [response] CertificateRevocationList + */ + + /** + * Calls GetCertificateRevocationList. + * @function getCertificateRevocationList + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest} request GetCertificateRevocationListRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationListCallback} callback Node-style callback called with the error, if any, and CertificateRevocationList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.getCertificateRevocationList = function getCertificateRevocationList(request, callback) { + return this.rpcCall(getCertificateRevocationList, $root.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest, $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList, request, callback); + }, "name", { value: "GetCertificateRevocationList" }); + + /** + * Calls GetCertificateRevocationList. + * @function getCertificateRevocationList + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest} request GetCertificateRevocationListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificateRevocationLists}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef ListCertificateRevocationListsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} [response] ListCertificateRevocationListsResponse + */ + + /** + * Calls ListCertificateRevocationLists. + * @function listCertificateRevocationLists + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest} request ListCertificateRevocationListsRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationListsCallback} callback Node-style callback called with the error, if any, and ListCertificateRevocationListsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.listCertificateRevocationLists = function listCertificateRevocationLists(request, callback) { + return this.rpcCall(listCertificateRevocationLists, $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest, $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse, request, callback); + }, "name", { value: "ListCertificateRevocationLists" }); + + /** + * Calls ListCertificateRevocationLists. + * @function listCertificateRevocationLists + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest} request ListCertificateRevocationListsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificateRevocationList}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef UpdateCertificateRevocationListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCertificateRevocationList. + * @function updateCertificateRevocationList + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest} request UpdateCertificateRevocationListRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationListCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.updateCertificateRevocationList = function updateCertificateRevocationList(request, callback) { + return this.rpcCall(updateCertificateRevocationList, $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCertificateRevocationList" }); + + /** + * Calls UpdateCertificateRevocationList. + * @function updateCertificateRevocationList + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest} request UpdateCertificateRevocationListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getReusableConfig}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef GetReusableConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.ReusableConfig} [response] ReusableConfig + */ + + /** + * Calls GetReusableConfig. + * @function getReusableConfig + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest} request GetReusableConfigRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfigCallback} callback Node-style callback called with the error, if any, and ReusableConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.getReusableConfig = function getReusableConfig(request, callback) { + return this.rpcCall(getReusableConfig, $root.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest, $root.google.cloud.security.privateca.v1beta1.ReusableConfig, request, callback); + }, "name", { value: "GetReusableConfig" }); + + /** + * Calls GetReusableConfig. + * @function getReusableConfig + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest} request GetReusableConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listReusableConfigs}. + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @typedef ListReusableConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} [response] ListReusableConfigsResponse + */ + + /** + * Calls ListReusableConfigs. + * @function listReusableConfigs + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest} request ListReusableConfigsRequest message or plain object + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigsCallback} callback Node-style callback called with the error, if any, and ListReusableConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateAuthorityService.prototype.listReusableConfigs = function listReusableConfigs(request, callback) { + return this.rpcCall(listReusableConfigs, $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest, $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse, request, callback); + }, "name", { value: "ListReusableConfigs" }); + + /** + * Calls ListReusableConfigs. + * @function listReusableConfigs + * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService + * @instance + * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest} request ListReusableConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CertificateAuthorityService; + })(); + + v1beta1.CreateCertificateRequest = (function() { + + /** + * Properties of a CreateCertificateRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface ICreateCertificateRequest + * @property {string|null} [parent] CreateCertificateRequest parent + * @property {string|null} [certificateId] CreateCertificateRequest certificateId + * @property {google.cloud.security.privateca.v1beta1.ICertificate|null} [certificate] CreateCertificateRequest certificate + * @property {string|null} [requestId] CreateCertificateRequest requestId + */ + + /** + * Constructs a new CreateCertificateRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a CreateCertificateRequest. + * @implements ICreateCertificateRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest=} [properties] Properties to set + */ + function CreateCertificateRequest(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]]; + } + + /** + * CreateCertificateRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.parent = ""; + + /** + * CreateCertificateRequest certificateId. + * @member {string} certificateId + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.certificateId = ""; + + /** + * CreateCertificateRequest certificate. + * @member {google.cloud.security.privateca.v1beta1.ICertificate|null|undefined} certificate + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.certificate = null; + + /** + * CreateCertificateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.requestId = ""; + + /** + * Creates a new CreateCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateRequest} CreateCertificateRequest instance + */ + CreateCertificateRequest.create = function create(properties) { + return new CreateCertificateRequest(properties); + }; + + /** + * Encodes the specified CreateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest} message CreateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.certificateId != null && Object.hasOwnProperty.call(message, "certificateId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateId); + if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + $root.google.cloud.security.privateca.v1beta1.Certificate.encode(message.certificate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest} message CreateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateRequest} CreateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.certificateId = reader.string(); + break; + } + case 3: { + message.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateRequest} CreateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCertificateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCertificateRequest.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.certificateId != null && message.hasOwnProperty("certificateId")) + if (!$util.isString(message.certificateId)) + return "certificateId: string expected"; + if (message.certificate != null && message.hasOwnProperty("certificate")) { + var error = $root.google.cloud.security.privateca.v1beta1.Certificate.verify(message.certificate); + if (error) + return "certificate." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateRequest} CreateCertificateRequest + */ + CreateCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CreateCertificateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.certificateId != null) + message.certificateId = String(object.certificateId); + if (object.certificate != null) { + if (typeof object.certificate !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CreateCertificateRequest.certificate: object expected"); + message.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.fromObject(object.certificate); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.CreateCertificateRequest} message CreateCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.certificateId = ""; + object.certificate = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.certificateId != null && message.hasOwnProperty("certificateId")) + object.certificateId = message.certificateId; + if (message.certificate != null && message.hasOwnProperty("certificate")) + object.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.toObject(message.certificate, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CreateCertificateRequest"; + }; + + return CreateCertificateRequest; + })(); + + v1beta1.GetCertificateRequest = (function() { + + /** + * Properties of a GetCertificateRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IGetCertificateRequest + * @property {string|null} [name] GetCertificateRequest name + */ + + /** + * Constructs a new GetCertificateRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a GetCertificateRequest. + * @implements IGetCertificateRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest=} [properties] Properties to set + */ + function GetCertificateRequest(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]]; + } + + /** + * GetCertificateRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest + * @instance + */ + GetCertificateRequest.prototype.name = ""; + + /** + * Creates a new GetCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRequest} GetCertificateRequest instance + */ + GetCertificateRequest.create = function create(properties) { + return new GetCertificateRequest(properties); + }; + + /** + * Encodes the specified GetCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest} message GetCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest} message GetCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRequest} GetCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRequest} GetCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCertificateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCertificateRequest.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 GetCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRequest} GetCertificateRequest + */ + GetCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.GetCertificateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.GetCertificateRequest} message GetCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCertificateRequest.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 GetCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + GetCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.GetCertificateRequest"; + }; + + return GetCertificateRequest; + })(); + + v1beta1.ListCertificatesRequest = (function() { + + /** + * Properties of a ListCertificatesRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IListCertificatesRequest + * @property {string|null} [parent] ListCertificatesRequest parent + * @property {number|null} [pageSize] ListCertificatesRequest pageSize + * @property {string|null} [pageToken] ListCertificatesRequest pageToken + * @property {string|null} [filter] ListCertificatesRequest filter + * @property {string|null} [orderBy] ListCertificatesRequest orderBy + */ + + /** + * Constructs a new ListCertificatesRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ListCertificatesRequest. + * @implements IListCertificatesRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest=} [properties] Properties to set + */ + function ListCertificatesRequest(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]]; + } + + /** + * ListCertificatesRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.parent = ""; + + /** + * ListCertificatesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.pageSize = 0; + + /** + * ListCertificatesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.pageToken = ""; + + /** + * ListCertificatesRequest filter. + * @member {string} filter + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.filter = ""; + + /** + * ListCertificatesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCertificatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesRequest} ListCertificatesRequest instance + */ + ListCertificatesRequest.create = function create(properties) { + return new ListCertificatesRequest(properties); + }; + + /** + * Encodes the specified ListCertificatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest} message ListCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest} message ListCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesRequest} ListCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListCertificatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesRequest} ListCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificatesRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificatesRequest.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 ListCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesRequest} ListCertificatesRequest + */ + ListCertificatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificatesRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCertificatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ListCertificatesRequest} message ListCertificatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCertificatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCertificatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificatesRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificatesRequest"; + }; + + return ListCertificatesRequest; + })(); + + v1beta1.ListCertificatesResponse = (function() { + + /** + * Properties of a ListCertificatesResponse. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IListCertificatesResponse + * @property {Array.|null} [certificates] ListCertificatesResponse certificates + * @property {string|null} [nextPageToken] ListCertificatesResponse nextPageToken + * @property {Array.|null} [unreachable] ListCertificatesResponse unreachable + */ + + /** + * Constructs a new ListCertificatesResponse. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ListCertificatesResponse. + * @implements IListCertificatesResponse + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IListCertificatesResponse=} [properties] Properties to set + */ + function ListCertificatesResponse(properties) { + this.certificates = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCertificatesResponse certificates. + * @member {Array.} certificates + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @instance + */ + ListCertificatesResponse.prototype.certificates = $util.emptyArray; + + /** + * ListCertificatesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @instance + */ + ListCertificatesResponse.prototype.nextPageToken = ""; + + /** + * ListCertificatesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @instance + */ + ListCertificatesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCertificatesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificatesResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} ListCertificatesResponse instance + */ + ListCertificatesResponse.create = function create(properties) { + return new ListCertificatesResponse(properties); + }; + + /** + * Encodes the specified ListCertificatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificatesResponse} message ListCertificatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificates != null && message.certificates.length) + for (var i = 0; i < message.certificates.length; ++i) + $root.google.cloud.security.privateca.v1beta1.Certificate.encode(message.certificates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCertificatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificatesResponse} message ListCertificatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} ListCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.certificates && message.certificates.length)) + message.certificates = []; + message.certificates.push($root.google.cloud.security.privateca.v1beta1.Certificate.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} ListCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificatesResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificates != null && message.hasOwnProperty("certificates")) { + if (!Array.isArray(message.certificates)) + return "certificates: array expected"; + for (var i = 0; i < message.certificates.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.Certificate.verify(message.certificates[i]); + if (error) + return "certificates." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCertificatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} ListCertificatesResponse + */ + ListCertificatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificatesResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificatesResponse(); + if (object.certificates) { + if (!Array.isArray(object.certificates)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificatesResponse.certificates: array expected"); + message.certificates = []; + for (var i = 0; i < object.certificates.length; ++i) { + if (typeof object.certificates[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificatesResponse.certificates: object expected"); + message.certificates[i] = $root.google.cloud.security.privateca.v1beta1.Certificate.fromObject(object.certificates[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificatesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCertificatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} message ListCertificatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.certificates = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.certificates && message.certificates.length) { + object.certificates = []; + for (var j = 0; j < message.certificates.length; ++j) + object.certificates[j] = $root.google.cloud.security.privateca.v1beta1.Certificate.toObject(message.certificates[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCertificatesResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCertificatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificatesResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificatesResponse"; + }; + + return ListCertificatesResponse; + })(); + + v1beta1.RevokeCertificateRequest = (function() { + + /** + * Properties of a RevokeCertificateRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IRevokeCertificateRequest + * @property {string|null} [name] RevokeCertificateRequest name + * @property {google.cloud.security.privateca.v1beta1.RevocationReason|null} [reason] RevokeCertificateRequest reason + * @property {string|null} [requestId] RevokeCertificateRequest requestId + */ + + /** + * Constructs a new RevokeCertificateRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a RevokeCertificateRequest. + * @implements IRevokeCertificateRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest=} [properties] Properties to set + */ + function RevokeCertificateRequest(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]]; + } + + /** + * RevokeCertificateRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @instance + */ + RevokeCertificateRequest.prototype.name = ""; + + /** + * RevokeCertificateRequest reason. + * @member {google.cloud.security.privateca.v1beta1.RevocationReason} reason + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @instance + */ + RevokeCertificateRequest.prototype.reason = 0; + + /** + * RevokeCertificateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @instance + */ + RevokeCertificateRequest.prototype.requestId = ""; + + /** + * Creates a new RevokeCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.RevokeCertificateRequest} RevokeCertificateRequest instance + */ + RevokeCertificateRequest.create = function create(properties) { + return new RevokeCertificateRequest(properties); + }; + + /** + * Encodes the specified RevokeCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RevokeCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest} message RevokeCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevokeCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified RevokeCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RevokeCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest} message RevokeCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevokeCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RevokeCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.RevokeCertificateRequest} RevokeCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevokeCertificateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.reason = reader.int32(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RevokeCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.RevokeCertificateRequest} RevokeCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevokeCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RevokeCertificateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RevokeCertificateRequest.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.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a RevokeCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.RevokeCertificateRequest} RevokeCertificateRequest + */ + RevokeCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "REVOCATION_REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "KEY_COMPROMISE": + case 1: + message.reason = 1; + break; + case "CERTIFICATE_AUTHORITY_COMPROMISE": + case 2: + message.reason = 2; + break; + case "AFFILIATION_CHANGED": + case 3: + message.reason = 3; + break; + case "SUPERSEDED": + case 4: + message.reason = 4; + break; + case "CESSATION_OF_OPERATION": + case 5: + message.reason = 5; + break; + case "CERTIFICATE_HOLD": + case 6: + message.reason = 6; + break; + case "PRIVILEGE_WITHDRAWN": + case 7: + message.reason = 7; + break; + case "ATTRIBUTE_AUTHORITY_COMPROMISE": + case 8: + message.reason = 8; + break; + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a RevokeCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.RevokeCertificateRequest} message RevokeCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RevokeCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.reason = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.reason] === undefined ? message.reason : $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.reason] : message.reason; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this RevokeCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + RevokeCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RevokeCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RevokeCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.RevokeCertificateRequest"; + }; + + return RevokeCertificateRequest; + })(); + + v1beta1.UpdateCertificateRequest = (function() { + + /** + * Properties of an UpdateCertificateRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IUpdateCertificateRequest + * @property {google.cloud.security.privateca.v1beta1.ICertificate|null} [certificate] UpdateCertificateRequest certificate + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateRequest updateMask + * @property {string|null} [requestId] UpdateCertificateRequest requestId + */ + + /** + * Constructs a new UpdateCertificateRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents an UpdateCertificateRequest. + * @implements IUpdateCertificateRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest=} [properties] Properties to set + */ + function UpdateCertificateRequest(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]]; + } + + /** + * UpdateCertificateRequest certificate. + * @member {google.cloud.security.privateca.v1beta1.ICertificate|null|undefined} certificate + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @instance + */ + UpdateCertificateRequest.prototype.certificate = null; + + /** + * UpdateCertificateRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @instance + */ + UpdateCertificateRequest.prototype.updateMask = null; + + /** + * UpdateCertificateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @instance + */ + UpdateCertificateRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRequest} UpdateCertificateRequest instance + */ + UpdateCertificateRequest.create = function create(properties) { + return new UpdateCertificateRequest(properties); + }; + + /** + * Encodes the specified UpdateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest} message UpdateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + $root.google.cloud.security.privateca.v1beta1.Certificate.encode(message.certificate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest} message UpdateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRequest} UpdateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRequest} UpdateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCertificateRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificate != null && message.hasOwnProperty("certificate")) { + var error = $root.google.cloud.security.privateca.v1beta1.Certificate.verify(message.certificate); + if (error) + return "certificate." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRequest} UpdateCertificateRequest + */ + UpdateCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(); + if (object.certificate != null) { + if (typeof object.certificate !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.certificate: object expected"); + message.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.fromObject(object.certificate); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.UpdateCertificateRequest} message UpdateCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificate = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.certificate != null && message.hasOwnProperty("certificate")) + object.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.toObject(message.certificate, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.UpdateCertificateRequest"; + }; + + return UpdateCertificateRequest; + })(); + + v1beta1.ActivateCertificateAuthorityRequest = (function() { + + /** + * Properties of an ActivateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IActivateCertificateAuthorityRequest + * @property {string|null} [name] ActivateCertificateAuthorityRequest name + * @property {string|null} [pemCaCertificate] ActivateCertificateAuthorityRequest pemCaCertificate + * @property {google.cloud.security.privateca.v1beta1.ISubordinateConfig|null} [subordinateConfig] ActivateCertificateAuthorityRequest subordinateConfig + * @property {string|null} [requestId] ActivateCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new ActivateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents an ActivateCertificateAuthorityRequest. + * @implements IActivateCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest=} [properties] Properties to set + */ + function ActivateCertificateAuthorityRequest(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]]; + } + + /** + * ActivateCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @instance + */ + ActivateCertificateAuthorityRequest.prototype.name = ""; + + /** + * ActivateCertificateAuthorityRequest pemCaCertificate. + * @member {string} pemCaCertificate + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @instance + */ + ActivateCertificateAuthorityRequest.prototype.pemCaCertificate = ""; + + /** + * ActivateCertificateAuthorityRequest subordinateConfig. + * @member {google.cloud.security.privateca.v1beta1.ISubordinateConfig|null|undefined} subordinateConfig + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @instance + */ + ActivateCertificateAuthorityRequest.prototype.subordinateConfig = null; + + /** + * ActivateCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @instance + */ + ActivateCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new ActivateCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest instance + */ + ActivateCertificateAuthorityRequest.create = function create(properties) { + return new ActivateCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified ActivateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivateCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pemCaCertificate != null && Object.hasOwnProperty.call(message, "pemCaCertificate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCaCertificate); + if (message.subordinateConfig != null && Object.hasOwnProperty.call(message, "subordinateConfig")) + $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.encode(message.subordinateConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ActivateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivateCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pemCaCertificate = reader.string(); + break; + } + case 3: { + message.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActivateCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActivateCertificateAuthorityRequest.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.pemCaCertificate != null && message.hasOwnProperty("pemCaCertificate")) + if (!$util.isString(message.pemCaCertificate)) + return "pemCaCertificate: string expected"; + if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) { + var error = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.verify(message.subordinateConfig); + if (error) + return "subordinateConfig." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an ActivateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest + */ + ActivateCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.pemCaCertificate != null) + message.pemCaCertificate = String(object.pemCaCertificate); + if (object.subordinateConfig != null) { + if (typeof object.subordinateConfig !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest.subordinateConfig: object expected"); + message.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.fromObject(object.subordinateConfig); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an ActivateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActivateCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pemCaCertificate = ""; + object.subordinateConfig = null; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pemCaCertificate != null && message.hasOwnProperty("pemCaCertificate")) + object.pemCaCertificate = message.pemCaCertificate; + if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) + object.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.toObject(message.subordinateConfig, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ActivateCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + ActivateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActivateCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActivateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest"; + }; + + return ActivateCertificateAuthorityRequest; + })(); + + v1beta1.CreateCertificateAuthorityRequest = (function() { + + /** + * Properties of a CreateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface ICreateCertificateAuthorityRequest + * @property {string|null} [parent] CreateCertificateAuthorityRequest parent + * @property {string|null} [certificateAuthorityId] CreateCertificateAuthorityRequest certificateAuthorityId + * @property {google.cloud.security.privateca.v1beta1.ICertificateAuthority|null} [certificateAuthority] CreateCertificateAuthorityRequest certificateAuthority + * @property {string|null} [requestId] CreateCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new CreateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a CreateCertificateAuthorityRequest. + * @implements ICreateCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest=} [properties] Properties to set + */ + function CreateCertificateAuthorityRequest(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]]; + } + + /** + * CreateCertificateAuthorityRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @instance + */ + CreateCertificateAuthorityRequest.prototype.parent = ""; + + /** + * CreateCertificateAuthorityRequest certificateAuthorityId. + * @member {string} certificateAuthorityId + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @instance + */ + CreateCertificateAuthorityRequest.prototype.certificateAuthorityId = ""; + + /** + * CreateCertificateAuthorityRequest certificateAuthority. + * @member {google.cloud.security.privateca.v1beta1.ICertificateAuthority|null|undefined} certificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @instance + */ + CreateCertificateAuthorityRequest.prototype.certificateAuthority = null; + + /** + * CreateCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @instance + */ + CreateCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new CreateCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest instance + */ + CreateCertificateAuthorityRequest.create = function create(properties) { + return new CreateCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified CreateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.certificateAuthorityId != null && Object.hasOwnProperty.call(message, "certificateAuthorityId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateAuthorityId); + if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) + $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.encode(message.certificateAuthority, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.certificateAuthorityId = reader.string(); + break; + } + case 3: { + message.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCertificateAuthorityRequest.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.certificateAuthorityId != null && message.hasOwnProperty("certificateAuthorityId")) + if (!$util.isString(message.certificateAuthorityId)) + return "certificateAuthorityId: string expected"; + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.verify(message.certificateAuthority); + if (error) + return "certificateAuthority." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest + */ + CreateCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.certificateAuthorityId != null) + message.certificateAuthorityId = String(object.certificateAuthorityId); + if (object.certificateAuthority != null) { + if (typeof object.certificateAuthority !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest.certificateAuthority: object expected"); + message.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.fromObject(object.certificateAuthority); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.certificateAuthorityId = ""; + object.certificateAuthority = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.certificateAuthorityId != null && message.hasOwnProperty("certificateAuthorityId")) + object.certificateAuthorityId = message.certificateAuthorityId; + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) + object.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.toObject(message.certificateAuthority, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest"; + }; + + return CreateCertificateAuthorityRequest; + })(); + + v1beta1.DisableCertificateAuthorityRequest = (function() { + + /** + * Properties of a DisableCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IDisableCertificateAuthorityRequest + * @property {string|null} [name] DisableCertificateAuthorityRequest name + * @property {string|null} [requestId] DisableCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new DisableCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a DisableCertificateAuthorityRequest. + * @implements IDisableCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest=} [properties] Properties to set + */ + function DisableCertificateAuthorityRequest(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]]; + } + + /** + * DisableCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @instance + */ + DisableCertificateAuthorityRequest.prototype.name = ""; + + /** + * DisableCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @instance + */ + DisableCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new DisableCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest instance + */ + DisableCertificateAuthorityRequest.create = function create(properties) { + return new DisableCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified DisableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DisableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableCertificateAuthorityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DisableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest + */ + DisableCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DisableCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DisableCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + DisableCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest"; + }; + + return DisableCertificateAuthorityRequest; + })(); + + v1beta1.EnableCertificateAuthorityRequest = (function() { + + /** + * Properties of an EnableCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IEnableCertificateAuthorityRequest + * @property {string|null} [name] EnableCertificateAuthorityRequest name + * @property {string|null} [requestId] EnableCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new EnableCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents an EnableCertificateAuthorityRequest. + * @implements IEnableCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest=} [properties] Properties to set + */ + function EnableCertificateAuthorityRequest(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]]; + } + + /** + * EnableCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @instance + */ + EnableCertificateAuthorityRequest.prototype.name = ""; + + /** + * EnableCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @instance + */ + EnableCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new EnableCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest instance + */ + EnableCertificateAuthorityRequest.create = function create(properties) { + return new EnableCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified EnableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified EnableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableCertificateAuthorityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an EnableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest + */ + EnableCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an EnableCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this EnableCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + EnableCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnableCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnableCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest"; + }; + + return EnableCertificateAuthorityRequest; + })(); + + v1beta1.FetchCertificateAuthorityCsrRequest = (function() { + + /** + * Properties of a FetchCertificateAuthorityCsrRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IFetchCertificateAuthorityCsrRequest + * @property {string|null} [name] FetchCertificateAuthorityCsrRequest name + */ + + /** + * Constructs a new FetchCertificateAuthorityCsrRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a FetchCertificateAuthorityCsrRequest. + * @implements IFetchCertificateAuthorityCsrRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest=} [properties] Properties to set + */ + function FetchCertificateAuthorityCsrRequest(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]]; + } + + /** + * FetchCertificateAuthorityCsrRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest + * @instance + */ + FetchCertificateAuthorityCsrRequest.prototype.name = ""; + + /** + * Creates a new FetchCertificateAuthorityCsrRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest instance + */ + FetchCertificateAuthorityCsrRequest.create = function create(properties) { + return new FetchCertificateAuthorityCsrRequest(properties); + }; + + /** + * Encodes the specified FetchCertificateAuthorityCsrRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCertificateAuthorityCsrRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified FetchCertificateAuthorityCsrRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCertificateAuthorityCsrRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCertificateAuthorityCsrRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCertificateAuthorityCsrRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchCertificateAuthorityCsrRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchCertificateAuthorityCsrRequest.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 FetchCertificateAuthorityCsrRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest + */ + FetchCertificateAuthorityCsrRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a FetchCertificateAuthorityCsrRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchCertificateAuthorityCsrRequest.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 FetchCertificateAuthorityCsrRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest + * @instance + * @returns {Object.} JSON object + */ + FetchCertificateAuthorityCsrRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchCertificateAuthorityCsrRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchCertificateAuthorityCsrRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest"; + }; + + return FetchCertificateAuthorityCsrRequest; + })(); + + v1beta1.FetchCertificateAuthorityCsrResponse = (function() { + + /** + * Properties of a FetchCertificateAuthorityCsrResponse. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IFetchCertificateAuthorityCsrResponse + * @property {string|null} [pemCsr] FetchCertificateAuthorityCsrResponse pemCsr + */ + + /** + * Constructs a new FetchCertificateAuthorityCsrResponse. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a FetchCertificateAuthorityCsrResponse. + * @implements IFetchCertificateAuthorityCsrResponse + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse=} [properties] Properties to set + */ + function FetchCertificateAuthorityCsrResponse(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]]; + } + + /** + * FetchCertificateAuthorityCsrResponse pemCsr. + * @member {string} pemCsr + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse + * @instance + */ + FetchCertificateAuthorityCsrResponse.prototype.pemCsr = ""; + + /** + * Creates a new FetchCertificateAuthorityCsrResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse instance + */ + FetchCertificateAuthorityCsrResponse.create = function create(properties) { + return new FetchCertificateAuthorityCsrResponse(properties); + }; + + /** + * Encodes the specified FetchCertificateAuthorityCsrResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCertificateAuthorityCsrResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCsr); + return writer; + }; + + /** + * Encodes the specified FetchCertificateAuthorityCsrResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchCertificateAuthorityCsrResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCertificateAuthorityCsrResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pemCsr = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchCertificateAuthorityCsrResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchCertificateAuthorityCsrResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchCertificateAuthorityCsrResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + if (!$util.isString(message.pemCsr)) + return "pemCsr: string expected"; + return null; + }; + + /** + * Creates a FetchCertificateAuthorityCsrResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse + */ + FetchCertificateAuthorityCsrResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse(); + if (object.pemCsr != null) + message.pemCsr = String(object.pemCsr); + return message; + }; + + /** + * Creates a plain object from a FetchCertificateAuthorityCsrResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchCertificateAuthorityCsrResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pemCsr = ""; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + object.pemCsr = message.pemCsr; + return object; + }; + + /** + * Converts this FetchCertificateAuthorityCsrResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse + * @instance + * @returns {Object.} JSON object + */ + FetchCertificateAuthorityCsrResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchCertificateAuthorityCsrResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchCertificateAuthorityCsrResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse"; + }; + + return FetchCertificateAuthorityCsrResponse; + })(); + + v1beta1.GetCertificateAuthorityRequest = (function() { + + /** + * Properties of a GetCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IGetCertificateAuthorityRequest + * @property {string|null} [name] GetCertificateAuthorityRequest name + */ + + /** + * Constructs a new GetCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a GetCertificateAuthorityRequest. + * @implements IGetCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest=} [properties] Properties to set + */ + function GetCertificateAuthorityRequest(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]]; + } + + /** + * GetCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest + * @instance + */ + GetCertificateAuthorityRequest.prototype.name = ""; + + /** + * Creates a new GetCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest instance + */ + GetCertificateAuthorityRequest.create = function create(properties) { + return new GetCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified GetCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest} message GetCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest} message GetCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCertificateAuthorityRequest.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 GetCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest + */ + GetCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest} message GetCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCertificateAuthorityRequest.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 GetCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + GetCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest"; + }; + + return GetCertificateAuthorityRequest; + })(); + + v1beta1.ListCertificateAuthoritiesRequest = (function() { + + /** + * Properties of a ListCertificateAuthoritiesRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IListCertificateAuthoritiesRequest + * @property {string|null} [parent] ListCertificateAuthoritiesRequest parent + * @property {number|null} [pageSize] ListCertificateAuthoritiesRequest pageSize + * @property {string|null} [pageToken] ListCertificateAuthoritiesRequest pageToken + * @property {string|null} [filter] ListCertificateAuthoritiesRequest filter + * @property {string|null} [orderBy] ListCertificateAuthoritiesRequest orderBy + */ + + /** + * Constructs a new ListCertificateAuthoritiesRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ListCertificateAuthoritiesRequest. + * @implements IListCertificateAuthoritiesRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest=} [properties] Properties to set + */ + function ListCertificateAuthoritiesRequest(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]]; + } + + /** + * ListCertificateAuthoritiesRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @instance + */ + ListCertificateAuthoritiesRequest.prototype.parent = ""; + + /** + * ListCertificateAuthoritiesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @instance + */ + ListCertificateAuthoritiesRequest.prototype.pageSize = 0; + + /** + * ListCertificateAuthoritiesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @instance + */ + ListCertificateAuthoritiesRequest.prototype.pageToken = ""; + + /** + * ListCertificateAuthoritiesRequest filter. + * @member {string} filter + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @instance + */ + ListCertificateAuthoritiesRequest.prototype.filter = ""; + + /** + * ListCertificateAuthoritiesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @instance + */ + ListCertificateAuthoritiesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCertificateAuthoritiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest instance + */ + ListCertificateAuthoritiesRequest.create = function create(properties) { + return new ListCertificateAuthoritiesRequest(properties); + }; + + /** + * Encodes the specified ListCertificateAuthoritiesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateAuthoritiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCertificateAuthoritiesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateAuthoritiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateAuthoritiesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListCertificateAuthoritiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateAuthoritiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateAuthoritiesRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateAuthoritiesRequest.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 ListCertificateAuthoritiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest + */ + ListCertificateAuthoritiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCertificateAuthoritiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateAuthoritiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCertificateAuthoritiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCertificateAuthoritiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateAuthoritiesRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateAuthoritiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest"; + }; + + return ListCertificateAuthoritiesRequest; + })(); + + v1beta1.ListCertificateAuthoritiesResponse = (function() { + + /** + * Properties of a ListCertificateAuthoritiesResponse. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IListCertificateAuthoritiesResponse + * @property {Array.|null} [certificateAuthorities] ListCertificateAuthoritiesResponse certificateAuthorities + * @property {string|null} [nextPageToken] ListCertificateAuthoritiesResponse nextPageToken + * @property {Array.|null} [unreachable] ListCertificateAuthoritiesResponse unreachable + */ + + /** + * Constructs a new ListCertificateAuthoritiesResponse. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ListCertificateAuthoritiesResponse. + * @implements IListCertificateAuthoritiesResponse + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse=} [properties] Properties to set + */ + function ListCertificateAuthoritiesResponse(properties) { + this.certificateAuthorities = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCertificateAuthoritiesResponse certificateAuthorities. + * @member {Array.} certificateAuthorities + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @instance + */ + ListCertificateAuthoritiesResponse.prototype.certificateAuthorities = $util.emptyArray; + + /** + * ListCertificateAuthoritiesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @instance + */ + ListCertificateAuthoritiesResponse.prototype.nextPageToken = ""; + + /** + * ListCertificateAuthoritiesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @instance + */ + ListCertificateAuthoritiesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCertificateAuthoritiesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse instance + */ + ListCertificateAuthoritiesResponse.create = function create(properties) { + return new ListCertificateAuthoritiesResponse(properties); + }; + + /** + * Encodes the specified ListCertificateAuthoritiesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateAuthoritiesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateAuthorities != null && message.certificateAuthorities.length) + for (var i = 0; i < message.certificateAuthorities.length; ++i) + $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.encode(message.certificateAuthorities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCertificateAuthoritiesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateAuthoritiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateAuthoritiesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.certificateAuthorities && message.certificateAuthorities.length)) + message.certificateAuthorities = []; + message.certificateAuthorities.push($root.google.cloud.security.privateca.v1beta1.CertificateAuthority.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateAuthoritiesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateAuthoritiesResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateAuthoritiesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateAuthorities != null && message.hasOwnProperty("certificateAuthorities")) { + if (!Array.isArray(message.certificateAuthorities)) + return "certificateAuthorities: array expected"; + for (var i = 0; i < message.certificateAuthorities.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.verify(message.certificateAuthorities[i]); + if (error) + return "certificateAuthorities." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCertificateAuthoritiesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse + */ + ListCertificateAuthoritiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse(); + if (object.certificateAuthorities) { + if (!Array.isArray(object.certificateAuthorities)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.certificateAuthorities: array expected"); + message.certificateAuthorities = []; + for (var i = 0; i < object.certificateAuthorities.length; ++i) { + if (typeof object.certificateAuthorities[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.certificateAuthorities: object expected"); + message.certificateAuthorities[i] = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.fromObject(object.certificateAuthorities[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCertificateAuthoritiesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateAuthoritiesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.certificateAuthorities = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.certificateAuthorities && message.certificateAuthorities.length) { + object.certificateAuthorities = []; + for (var j = 0; j < message.certificateAuthorities.length; ++j) + object.certificateAuthorities[j] = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.toObject(message.certificateAuthorities[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCertificateAuthoritiesResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCertificateAuthoritiesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateAuthoritiesResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateAuthoritiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse"; + }; + + return ListCertificateAuthoritiesResponse; + })(); + + v1beta1.RestoreCertificateAuthorityRequest = (function() { + + /** + * Properties of a RestoreCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IRestoreCertificateAuthorityRequest + * @property {string|null} [name] RestoreCertificateAuthorityRequest name + * @property {string|null} [requestId] RestoreCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new RestoreCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a RestoreCertificateAuthorityRequest. + * @implements IRestoreCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest=} [properties] Properties to set + */ + function RestoreCertificateAuthorityRequest(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]]; + } + + /** + * RestoreCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @instance + */ + RestoreCertificateAuthorityRequest.prototype.name = ""; + + /** + * RestoreCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @instance + */ + RestoreCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new RestoreCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest} RestoreCertificateAuthorityRequest instance + */ + RestoreCertificateAuthorityRequest.create = function create(properties) { + return new RestoreCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified RestoreCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest} message RestoreCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified RestoreCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest} message RestoreCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest} RestoreCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest} RestoreCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreCertificateAuthorityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a RestoreCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest} RestoreCertificateAuthorityRequest + */ + RestoreCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a RestoreCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest} message RestoreCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this RestoreCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest"; + }; + + return RestoreCertificateAuthorityRequest; + })(); + + v1beta1.ScheduleDeleteCertificateAuthorityRequest = (function() { + + /** + * Properties of a ScheduleDeleteCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IScheduleDeleteCertificateAuthorityRequest + * @property {string|null} [name] ScheduleDeleteCertificateAuthorityRequest name + * @property {string|null} [requestId] ScheduleDeleteCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new ScheduleDeleteCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ScheduleDeleteCertificateAuthorityRequest. + * @implements IScheduleDeleteCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest=} [properties] Properties to set + */ + function ScheduleDeleteCertificateAuthorityRequest(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]]; + } + + /** + * ScheduleDeleteCertificateAuthorityRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @instance + */ + ScheduleDeleteCertificateAuthorityRequest.prototype.name = ""; + + /** + * ScheduleDeleteCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @instance + */ + ScheduleDeleteCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new ScheduleDeleteCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest} ScheduleDeleteCertificateAuthorityRequest instance + */ + ScheduleDeleteCertificateAuthorityRequest.create = function create(properties) { + return new ScheduleDeleteCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified ScheduleDeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest} message ScheduleDeleteCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleDeleteCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ScheduleDeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest} message ScheduleDeleteCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleDeleteCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduleDeleteCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest} ScheduleDeleteCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleDeleteCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduleDeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest} ScheduleDeleteCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleDeleteCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduleDeleteCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduleDeleteCertificateAuthorityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ScheduleDeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest} ScheduleDeleteCertificateAuthorityRequest + */ + ScheduleDeleteCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ScheduleDeleteCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest} message ScheduleDeleteCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduleDeleteCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ScheduleDeleteCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + ScheduleDeleteCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScheduleDeleteCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleDeleteCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest"; + }; + + return ScheduleDeleteCertificateAuthorityRequest; + })(); + + v1beta1.UpdateCertificateAuthorityRequest = (function() { + + /** + * Properties of an UpdateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IUpdateCertificateAuthorityRequest + * @property {google.cloud.security.privateca.v1beta1.ICertificateAuthority|null} [certificateAuthority] UpdateCertificateAuthorityRequest certificateAuthority + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateAuthorityRequest updateMask + * @property {string|null} [requestId] UpdateCertificateAuthorityRequest requestId + */ + + /** + * Constructs a new UpdateCertificateAuthorityRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents an UpdateCertificateAuthorityRequest. + * @implements IUpdateCertificateAuthorityRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest=} [properties] Properties to set + */ + function UpdateCertificateAuthorityRequest(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]]; + } + + /** + * UpdateCertificateAuthorityRequest certificateAuthority. + * @member {google.cloud.security.privateca.v1beta1.ICertificateAuthority|null|undefined} certificateAuthority + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @instance + */ + UpdateCertificateAuthorityRequest.prototype.certificateAuthority = null; + + /** + * UpdateCertificateAuthorityRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @instance + */ + UpdateCertificateAuthorityRequest.prototype.updateMask = null; + + /** + * UpdateCertificateAuthorityRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @instance + */ + UpdateCertificateAuthorityRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateCertificateAuthorityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest instance + */ + UpdateCertificateAuthorityRequest.create = function create(properties) { + return new UpdateCertificateAuthorityRequest(properties); + }; + + /** + * Encodes the specified UpdateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateAuthorityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) + $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.encode(message.certificateAuthority, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateAuthorityRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCertificateAuthorityRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCertificateAuthorityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.verify(message.certificateAuthority); + if (error) + return "certificateAuthority." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest + */ + UpdateCertificateAuthorityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(); + if (object.certificateAuthority != null) { + if (typeof object.certificateAuthority !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.certificateAuthority: object expected"); + message.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.fromObject(object.certificateAuthority); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateCertificateAuthorityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCertificateAuthorityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificateAuthority = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) + object.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.toObject(message.certificateAuthority, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateCertificateAuthorityRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCertificateAuthorityRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest"; + }; + + return UpdateCertificateAuthorityRequest; + })(); + + v1beta1.GetCertificateRevocationListRequest = (function() { + + /** + * Properties of a GetCertificateRevocationListRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IGetCertificateRevocationListRequest + * @property {string|null} [name] GetCertificateRevocationListRequest name + */ + + /** + * Constructs a new GetCertificateRevocationListRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a GetCertificateRevocationListRequest. + * @implements IGetCertificateRevocationListRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest=} [properties] Properties to set + */ + function GetCertificateRevocationListRequest(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]]; + } + + /** + * GetCertificateRevocationListRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest + * @instance + */ + GetCertificateRevocationListRequest.prototype.name = ""; + + /** + * Creates a new GetCertificateRevocationListRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest instance + */ + GetCertificateRevocationListRequest.create = function create(properties) { + return new GetCertificateRevocationListRequest(properties); + }; + + /** + * Encodes the specified GetCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest} message GetCertificateRevocationListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateRevocationListRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest} message GetCertificateRevocationListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateRevocationListRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateRevocationListRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateRevocationListRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCertificateRevocationListRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCertificateRevocationListRequest.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 GetCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest + */ + GetCertificateRevocationListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCertificateRevocationListRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest} message GetCertificateRevocationListRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCertificateRevocationListRequest.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 GetCertificateRevocationListRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest + * @instance + * @returns {Object.} JSON object + */ + GetCertificateRevocationListRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCertificateRevocationListRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCertificateRevocationListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest"; + }; + + return GetCertificateRevocationListRequest; + })(); + + v1beta1.ListCertificateRevocationListsRequest = (function() { + + /** + * Properties of a ListCertificateRevocationListsRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IListCertificateRevocationListsRequest + * @property {string|null} [parent] ListCertificateRevocationListsRequest parent + * @property {number|null} [pageSize] ListCertificateRevocationListsRequest pageSize + * @property {string|null} [pageToken] ListCertificateRevocationListsRequest pageToken + * @property {string|null} [filter] ListCertificateRevocationListsRequest filter + * @property {string|null} [orderBy] ListCertificateRevocationListsRequest orderBy + */ + + /** + * Constructs a new ListCertificateRevocationListsRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ListCertificateRevocationListsRequest. + * @implements IListCertificateRevocationListsRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest=} [properties] Properties to set + */ + function ListCertificateRevocationListsRequest(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]]; + } + + /** + * ListCertificateRevocationListsRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @instance + */ + ListCertificateRevocationListsRequest.prototype.parent = ""; + + /** + * ListCertificateRevocationListsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @instance + */ + ListCertificateRevocationListsRequest.prototype.pageSize = 0; + + /** + * ListCertificateRevocationListsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @instance + */ + ListCertificateRevocationListsRequest.prototype.pageToken = ""; + + /** + * ListCertificateRevocationListsRequest filter. + * @member {string} filter + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @instance + */ + ListCertificateRevocationListsRequest.prototype.filter = ""; + + /** + * ListCertificateRevocationListsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @instance + */ + ListCertificateRevocationListsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCertificateRevocationListsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest instance + */ + ListCertificateRevocationListsRequest.create = function create(properties) { + return new ListCertificateRevocationListsRequest(properties); + }; + + /** + * Encodes the specified ListCertificateRevocationListsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateRevocationListsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCertificateRevocationListsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateRevocationListsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateRevocationListsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListCertificateRevocationListsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateRevocationListsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateRevocationListsRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateRevocationListsRequest.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 ListCertificateRevocationListsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest + */ + ListCertificateRevocationListsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCertificateRevocationListsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateRevocationListsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCertificateRevocationListsRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCertificateRevocationListsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateRevocationListsRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateRevocationListsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest"; + }; + + return ListCertificateRevocationListsRequest; + })(); + + v1beta1.ListCertificateRevocationListsResponse = (function() { + + /** + * Properties of a ListCertificateRevocationListsResponse. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IListCertificateRevocationListsResponse + * @property {Array.|null} [certificateRevocationLists] ListCertificateRevocationListsResponse certificateRevocationLists + * @property {string|null} [nextPageToken] ListCertificateRevocationListsResponse nextPageToken + * @property {Array.|null} [unreachable] ListCertificateRevocationListsResponse unreachable + */ + + /** + * Constructs a new ListCertificateRevocationListsResponse. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ListCertificateRevocationListsResponse. + * @implements IListCertificateRevocationListsResponse + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse=} [properties] Properties to set + */ + function ListCertificateRevocationListsResponse(properties) { + this.certificateRevocationLists = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCertificateRevocationListsResponse certificateRevocationLists. + * @member {Array.} certificateRevocationLists + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @instance + */ + ListCertificateRevocationListsResponse.prototype.certificateRevocationLists = $util.emptyArray; + + /** + * ListCertificateRevocationListsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @instance + */ + ListCertificateRevocationListsResponse.prototype.nextPageToken = ""; + + /** + * ListCertificateRevocationListsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @instance + */ + ListCertificateRevocationListsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCertificateRevocationListsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse instance + */ + ListCertificateRevocationListsResponse.create = function create(properties) { + return new ListCertificateRevocationListsResponse(properties); + }; + + /** + * Encodes the specified ListCertificateRevocationListsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateRevocationListsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateRevocationLists != null && message.certificateRevocationLists.length) + for (var i = 0; i < message.certificateRevocationLists.length; ++i) + $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.encode(message.certificateRevocationLists[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCertificateRevocationListsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateRevocationListsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateRevocationListsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.certificateRevocationLists && message.certificateRevocationLists.length)) + message.certificateRevocationLists = []; + message.certificateRevocationLists.push($root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateRevocationListsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateRevocationListsResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateRevocationListsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateRevocationLists != null && message.hasOwnProperty("certificateRevocationLists")) { + if (!Array.isArray(message.certificateRevocationLists)) + return "certificateRevocationLists: array expected"; + for (var i = 0; i < message.certificateRevocationLists.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify(message.certificateRevocationLists[i]); + if (error) + return "certificateRevocationLists." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCertificateRevocationListsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse + */ + ListCertificateRevocationListsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse(); + if (object.certificateRevocationLists) { + if (!Array.isArray(object.certificateRevocationLists)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.certificateRevocationLists: array expected"); + message.certificateRevocationLists = []; + for (var i = 0; i < object.certificateRevocationLists.length; ++i) { + if (typeof object.certificateRevocationLists[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.certificateRevocationLists: object expected"); + message.certificateRevocationLists[i] = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.fromObject(object.certificateRevocationLists[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCertificateRevocationListsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateRevocationListsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.certificateRevocationLists = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.certificateRevocationLists && message.certificateRevocationLists.length) { + object.certificateRevocationLists = []; + for (var j = 0; j < message.certificateRevocationLists.length; ++j) + object.certificateRevocationLists[j] = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.toObject(message.certificateRevocationLists[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCertificateRevocationListsResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCertificateRevocationListsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateRevocationListsResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateRevocationListsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse"; + }; + + return ListCertificateRevocationListsResponse; + })(); + + v1beta1.UpdateCertificateRevocationListRequest = (function() { + + /** + * Properties of an UpdateCertificateRevocationListRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IUpdateCertificateRevocationListRequest + * @property {google.cloud.security.privateca.v1beta1.ICertificateRevocationList|null} [certificateRevocationList] UpdateCertificateRevocationListRequest certificateRevocationList + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateRevocationListRequest updateMask + * @property {string|null} [requestId] UpdateCertificateRevocationListRequest requestId + */ + + /** + * Constructs a new UpdateCertificateRevocationListRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents an UpdateCertificateRevocationListRequest. + * @implements IUpdateCertificateRevocationListRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest=} [properties] Properties to set + */ + function UpdateCertificateRevocationListRequest(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]]; + } + + /** + * UpdateCertificateRevocationListRequest certificateRevocationList. + * @member {google.cloud.security.privateca.v1beta1.ICertificateRevocationList|null|undefined} certificateRevocationList + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @instance + */ + UpdateCertificateRevocationListRequest.prototype.certificateRevocationList = null; + + /** + * UpdateCertificateRevocationListRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @instance + */ + UpdateCertificateRevocationListRequest.prototype.updateMask = null; + + /** + * UpdateCertificateRevocationListRequest requestId. + * @member {string} requestId + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @instance + */ + UpdateCertificateRevocationListRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateCertificateRevocationListRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest instance + */ + UpdateCertificateRevocationListRequest.create = function create(properties) { + return new UpdateCertificateRevocationListRequest(properties); + }; + + /** + * Encodes the specified UpdateCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateRevocationListRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateRevocationList != null && Object.hasOwnProperty.call(message, "certificateRevocationList")) + $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.encode(message.certificateRevocationList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateRevocationListRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateRevocationListRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.certificateRevocationList = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateRevocationListRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCertificateRevocationListRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCertificateRevocationListRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateRevocationList != null && message.hasOwnProperty("certificateRevocationList")) { + var error = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify(message.certificateRevocationList); + if (error) + return "certificateRevocationList." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest + */ + UpdateCertificateRevocationListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(); + if (object.certificateRevocationList != null) { + if (typeof object.certificateRevocationList !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.certificateRevocationList: object expected"); + message.certificateRevocationList = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.fromObject(object.certificateRevocationList); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateCertificateRevocationListRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCertificateRevocationListRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificateRevocationList = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.certificateRevocationList != null && message.hasOwnProperty("certificateRevocationList")) + object.certificateRevocationList = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.toObject(message.certificateRevocationList, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateCertificateRevocationListRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCertificateRevocationListRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCertificateRevocationListRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCertificateRevocationListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest"; + }; + + return UpdateCertificateRevocationListRequest; + })(); + + v1beta1.GetReusableConfigRequest = (function() { + + /** + * Properties of a GetReusableConfigRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IGetReusableConfigRequest + * @property {string|null} [name] GetReusableConfigRequest name + */ + + /** + * Constructs a new GetReusableConfigRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a GetReusableConfigRequest. + * @implements IGetReusableConfigRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest=} [properties] Properties to set + */ + function GetReusableConfigRequest(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]]; + } + + /** + * GetReusableConfigRequest name. + * @member {string} name + * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest + * @instance + */ + GetReusableConfigRequest.prototype.name = ""; + + /** + * Creates a new GetReusableConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.GetReusableConfigRequest} GetReusableConfigRequest instance + */ + GetReusableConfigRequest.create = function create(properties) { + return new GetReusableConfigRequest(properties); + }; + + /** + * Encodes the specified GetReusableConfigRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetReusableConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest} message GetReusableConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReusableConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetReusableConfigRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetReusableConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest} message GetReusableConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReusableConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetReusableConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.GetReusableConfigRequest} GetReusableConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReusableConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetReusableConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.GetReusableConfigRequest} GetReusableConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReusableConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetReusableConfigRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetReusableConfigRequest.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 GetReusableConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.GetReusableConfigRequest} GetReusableConfigRequest + */ + GetReusableConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetReusableConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.GetReusableConfigRequest} message GetReusableConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetReusableConfigRequest.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 GetReusableConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetReusableConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetReusableConfigRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetReusableConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.GetReusableConfigRequest"; + }; + + return GetReusableConfigRequest; + })(); + + v1beta1.ListReusableConfigsRequest = (function() { + + /** + * Properties of a ListReusableConfigsRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IListReusableConfigsRequest + * @property {string|null} [parent] ListReusableConfigsRequest parent + * @property {number|null} [pageSize] ListReusableConfigsRequest pageSize + * @property {string|null} [pageToken] ListReusableConfigsRequest pageToken + * @property {string|null} [filter] ListReusableConfigsRequest filter + * @property {string|null} [orderBy] ListReusableConfigsRequest orderBy + */ + + /** + * Constructs a new ListReusableConfigsRequest. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ListReusableConfigsRequest. + * @implements IListReusableConfigsRequest + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest=} [properties] Properties to set + */ + function ListReusableConfigsRequest(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]]; + } + + /** + * ListReusableConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @instance + */ + ListReusableConfigsRequest.prototype.parent = ""; + + /** + * ListReusableConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @instance + */ + ListReusableConfigsRequest.prototype.pageSize = 0; + + /** + * ListReusableConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @instance + */ + ListReusableConfigsRequest.prototype.pageToken = ""; + + /** + * ListReusableConfigsRequest filter. + * @member {string} filter + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @instance + */ + ListReusableConfigsRequest.prototype.filter = ""; + + /** + * ListReusableConfigsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @instance + */ + ListReusableConfigsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListReusableConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest} ListReusableConfigsRequest instance + */ + ListReusableConfigsRequest.create = function create(properties) { + return new ListReusableConfigsRequest(properties); + }; + + /** + * Encodes the specified ListReusableConfigsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest} message ListReusableConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReusableConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListReusableConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest} message ListReusableConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReusableConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReusableConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest} ListReusableConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReusableConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ListReusableConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest} ListReusableConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReusableConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReusableConfigsRequest message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReusableConfigsRequest.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 ListReusableConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest} ListReusableConfigsRequest + */ + ListReusableConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListReusableConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @static + * @param {google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest} message ListReusableConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReusableConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListReusableConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListReusableConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReusableConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReusableConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest"; + }; + + return ListReusableConfigsRequest; + })(); + + v1beta1.ListReusableConfigsResponse = (function() { + + /** + * Properties of a ListReusableConfigsResponse. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IListReusableConfigsResponse + * @property {Array.|null} [reusableConfigs] ListReusableConfigsResponse reusableConfigs + * @property {string|null} [nextPageToken] ListReusableConfigsResponse nextPageToken + * @property {Array.|null} [unreachable] ListReusableConfigsResponse unreachable + */ + + /** + * Constructs a new ListReusableConfigsResponse. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents a ListReusableConfigsResponse. + * @implements IListReusableConfigsResponse + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse=} [properties] Properties to set + */ + function ListReusableConfigsResponse(properties) { + this.reusableConfigs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReusableConfigsResponse reusableConfigs. + * @member {Array.} reusableConfigs + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @instance + */ + ListReusableConfigsResponse.prototype.reusableConfigs = $util.emptyArray; + + /** + * ListReusableConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @instance + */ + ListReusableConfigsResponse.prototype.nextPageToken = ""; + + /** + * ListReusableConfigsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @instance + */ + ListReusableConfigsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListReusableConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} ListReusableConfigsResponse instance + */ + ListReusableConfigsResponse.create = function create(properties) { + return new ListReusableConfigsResponse(properties); + }; + + /** + * Encodes the specified ListReusableConfigsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse} message ListReusableConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReusableConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reusableConfigs != null && message.reusableConfigs.length) + for (var i = 0; i < message.reusableConfigs.length; ++i) + $root.google.cloud.security.privateca.v1beta1.ReusableConfig.encode(message.reusableConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListReusableConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse} message ListReusableConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReusableConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReusableConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} ListReusableConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReusableConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.reusableConfigs && message.reusableConfigs.length)) + message.reusableConfigs = []; + message.reusableConfigs.push($root.google.cloud.security.privateca.v1beta1.ReusableConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReusableConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} ListReusableConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReusableConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReusableConfigsResponse message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReusableConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reusableConfigs != null && message.hasOwnProperty("reusableConfigs")) { + if (!Array.isArray(message.reusableConfigs)) + return "reusableConfigs: array expected"; + for (var i = 0; i < message.reusableConfigs.length; ++i) { + var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfig.verify(message.reusableConfigs[i]); + if (error) + return "reusableConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListReusableConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} ListReusableConfigsResponse + */ + ListReusableConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse(); + if (object.reusableConfigs) { + if (!Array.isArray(object.reusableConfigs)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.reusableConfigs: array expected"); + message.reusableConfigs = []; + for (var i = 0; i < object.reusableConfigs.length; ++i) { + if (typeof object.reusableConfigs[i] !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.reusableConfigs: object expected"); + message.reusableConfigs[i] = $root.google.cloud.security.privateca.v1beta1.ReusableConfig.fromObject(object.reusableConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListReusableConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @static + * @param {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} message ListReusableConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReusableConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.reusableConfigs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.reusableConfigs && message.reusableConfigs.length) { + object.reusableConfigs = []; + for (var j = 0; j < message.reusableConfigs.length; ++j) + object.reusableConfigs[j] = $root.google.cloud.security.privateca.v1beta1.ReusableConfig.toObject(message.reusableConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListReusableConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListReusableConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReusableConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReusableConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse"; + }; + + return ListReusableConfigsResponse; + })(); + + v1beta1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.security.privateca.v1beta1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.security.privateca.v1beta1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.security.privateca.v1beta1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @static + * @param {google.cloud.security.privateca.v1beta1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1beta1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @static + * @param {google.cloud.security.privateca.v1beta1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @static + * @param {google.cloud.security.privateca.v1beta1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1beta1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1beta1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1beta1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1beta1.OperationMetadata) + return object; + var message = new $root.google.cloud.security.privateca.v1beta1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1beta1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @static + * @param {google.cloud.security.privateca.v1beta1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + return v1beta1; + })(); + + return privateca; + })(); + + return security; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @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 + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER 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; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * 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 + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * 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 = []; + this.style = []; + 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]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * 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) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + 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); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * 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 = []; + object.style = []; + } + 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] === undefined ? message.history : $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; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @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; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * 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]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * 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]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (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 + */ + + /** + * 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]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * 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 + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * 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) + }); + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * 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]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + 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]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) { + object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(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]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + 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]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + 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]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(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]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(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]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(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]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.common = null; + object.experimentalFeatures = null; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(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]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(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]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + 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]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(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]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + this.renamedServices = {}; + 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]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + 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]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(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]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + 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]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + * @property {Array.|null} [referencedTypes] FieldInfo referencedTypes + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + this.referencedTypes = []; + 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]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * FieldInfo referencedTypes. + * @member {Array.} referencedTypes + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.referencedTypes = $util.emptyArray; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + if (message.referencedTypes != null && message.referencedTypes.length) + for (var i = 0; i < message.referencedTypes.length; ++i) + $root.google.api.TypeReference.encode(message.referencedTypes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + case 2: { + if (!(message.referencedTypes && message.referencedTypes.length)) + message.referencedTypes = []; + message.referencedTypes.push($root.google.api.TypeReference.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.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 1: + case 2: + case 3: + case 4: + break; + } + if (message.referencedTypes != null && message.hasOwnProperty("referencedTypes")) { + if (!Array.isArray(message.referencedTypes)) + return "referencedTypes: array expected"; + for (var i = 0; i < message.referencedTypes.length; ++i) { + var error = $root.google.api.TypeReference.verify(message.referencedTypes[i]); + if (error) + return "referencedTypes." + error; + } + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + if (object.referencedTypes) { + if (!Array.isArray(object.referencedTypes)) + throw TypeError(".google.api.FieldInfo.referencedTypes: array expected"); + message.referencedTypes = []; + for (var i = 0; i < object.referencedTypes.length; ++i) { + if (typeof object.referencedTypes[i] !== "object") + throw TypeError(".google.api.FieldInfo.referencedTypes: object expected"); + message.referencedTypes[i] = $root.google.api.TypeReference.fromObject(object.referencedTypes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.referencedTypes = []; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + if (message.referencedTypes && message.referencedTypes.length) { + object.referencedTypes = []; + for (var j = 0; j < message.referencedTypes.length; ++j) + object.referencedTypes[j] = $root.google.api.TypeReference.toObject(message.referencedTypes[j], options); + } + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + + api.TypeReference = (function() { + + /** + * Properties of a TypeReference. + * @memberof google.api + * @interface ITypeReference + * @property {string|null} [typeName] TypeReference typeName + */ + + /** + * Constructs a new TypeReference. + * @memberof google.api + * @classdesc Represents a TypeReference. + * @implements ITypeReference + * @constructor + * @param {google.api.ITypeReference=} [properties] Properties to set + */ + function TypeReference(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]]; + } + + /** + * TypeReference typeName. + * @member {string} typeName + * @memberof google.api.TypeReference + * @instance + */ + TypeReference.prototype.typeName = ""; + + /** + * Creates a new TypeReference instance using the specified properties. + * @function create + * @memberof google.api.TypeReference + * @static + * @param {google.api.ITypeReference=} [properties] Properties to set + * @returns {google.api.TypeReference} TypeReference instance + */ + TypeReference.create = function create(properties) { + return new TypeReference(properties); + }; + + /** + * Encodes the specified TypeReference message. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. + * @function encode + * @memberof google.api.TypeReference + * @static + * @param {google.api.ITypeReference} message TypeReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.typeName); + return writer; + }; + + /** + * Encodes the specified TypeReference message, length delimited. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.TypeReference + * @static + * @param {google.api.ITypeReference} message TypeReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TypeReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.TypeReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.TypeReference} TypeReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.TypeReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.typeName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TypeReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.TypeReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.TypeReference} TypeReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TypeReference message. + * @function verify + * @memberof google.api.TypeReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TypeReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + return null; + }; + + /** + * Creates a TypeReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.TypeReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.TypeReference} TypeReference + */ + TypeReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.TypeReference) + return object; + var message = new $root.google.api.TypeReference(); + if (object.typeName != null) + message.typeName = String(object.typeName); + return message; + }; + + /** + * Creates a plain object from a TypeReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.TypeReference + * @static + * @param {google.api.TypeReference} message TypeReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TypeReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.typeName = ""; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + return object; + }; + + /** + * Converts this TypeReference to JSON. + * @function toJSON + * @memberof google.api.TypeReference + * @instance + * @returns {Object.} JSON object + */ + TypeReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TypeReference + * @function getTypeUrl + * @memberof google.api.TypeReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TypeReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.TypeReference"; + }; + + return TypeReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * 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]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * 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); + }; + + /** + * 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; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * 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} [optionDependency] FileDescriptorProto optionDependency + * @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 + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * 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.optionDependency = []; + 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]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + 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; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] 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.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * 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.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } + 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); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * 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 = []; + object.optionDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + 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; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * 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 + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility + */ + + /** + * 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]]; + } + + /** + * 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 + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "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.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 11: { + message.visibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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"; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * 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]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + 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; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + 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]; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * 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 + */ + + /** + * 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]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * 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 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 && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + 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]]; + } + + /** + * 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 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * 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 = []; + this.declaration = []; + 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]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * 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); + }; + + /** + * 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.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + 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()); + }; + + /** + * 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; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + 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]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + 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.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 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); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(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]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (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 + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * 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]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * 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 = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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 3: + case 2: + 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; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + 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) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + 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); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + 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 = ""; + object.proto3Optional = false; + } + 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] === undefined ? message.label : $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] === undefined ? message.type : $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; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + 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); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @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; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * 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]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * 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 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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * 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 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, error) { + 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(); + if (tag === error) + break; + 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 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 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 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 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 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); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * 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 + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility + */ + + /** + * 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]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "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]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 6: { + message.visibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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"; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * 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]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + return message; + }; + + /** + * 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; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + 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]; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * 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 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]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * 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 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 && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * 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 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * 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 + */ + + /** + * 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]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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 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()); + }; + + /** + * 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; + }; + + /** + * 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 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (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 + */ + + /** + * 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]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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 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()); + }; + + /** + * 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; + }; + + /** + * 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 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 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); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * 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 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]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * 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} [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 {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * 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]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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 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 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + 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; + }; + + /** + * 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()); + }; + + /** + * 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.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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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 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) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + 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.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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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; + }; + + /** + * 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 = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + 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] === undefined ? message.optimizeFor : $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.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @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; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (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 {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * 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]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * 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 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 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 && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + 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 && Object.hasOwnProperty.call(message, ".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 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 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, error) { + 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(); + if (tag === error) + break; + 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 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + 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 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 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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 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.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 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); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (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} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport + * @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 + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + */ + + /** + * 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.targets = []; + this.editionDefaults = []; + 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]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + 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) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); + 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + 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; + } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + 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()); + }; + + /** + * 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.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: 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.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } + 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: + case 6: + case 7: + case 8: + 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; + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } + 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) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + 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) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + 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.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } + 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: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + 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; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + 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"]); + } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } + 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.targets = []; + object.editionDefaults = []; + 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.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object.featureSupport = null; + object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $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] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); + 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]] === undefined ? message[".google.api.fieldBehavior"][j] : $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); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); + 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); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @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; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @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; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(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]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(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]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * 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]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * 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 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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 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 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + 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 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 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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 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 (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 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); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * 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]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + 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 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + 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 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()); + }; + + /** + * 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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 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; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 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); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * 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]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * 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 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 && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + 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 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 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + 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 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 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } + 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 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } + 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 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; + object.features = null; + object.debugRedact = false; + object.featureSupport = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); + 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 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); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @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 + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * 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]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * 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 + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + 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 && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + 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; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * 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.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * 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 {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @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 + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * 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]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + 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.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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 && Object.hasOwnProperty.call(message, ".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 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + 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; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * 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) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + 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.features = null; + object[".google.longrunning.operationInfo"] = null; + 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] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @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; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * 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 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]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * 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.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 && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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]); + } + } + 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 >= 0) + 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * 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]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * 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); + }; + + /** + * 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; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(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]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(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 VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + 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]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(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]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.fixedFeatures = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); + if (error) + return "fixedFeatures." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; + } + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * 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 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 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 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, error) { + 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(); + if (tag === error) + break; + 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 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()); + }; + + /** + * 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 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (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 + */ + + /** + * 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]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "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; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * 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]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * 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); + }; + + /** + * 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; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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]); + } + } + 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (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 + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * 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]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + 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; + object.semantic = options.enums === String ? "NONE" : 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; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + 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); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * 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]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * 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]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * 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); + }; + + /** + * 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 && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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; + }; + + /** + * 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; + }; + + /** + * 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 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); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(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]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(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 Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * 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]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * 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); + }; + + /** + * 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 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(); + }; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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 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()); + }; + + /** + * 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 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 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(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]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(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]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(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]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(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]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(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]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(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]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(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]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(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]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(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]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * 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 + */ + + /** + * 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]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * 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 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 && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * 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 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, error) { + 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(); + if (tag === error) + break; + 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; + }; + + /** + * 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()); + }; + + /** + * 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 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; + }; + + /** + * 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @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 Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.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.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(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]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.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 GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(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]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + 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]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.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 CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(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]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.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 DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(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]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(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]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + 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]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/protos.json b/owl-bot-staging/google-cloud-security-privateca/protos/protos.json new file mode 100644 index 000000000000..14b25276d45b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/protos/protos.json @@ -0,0 +1,7802 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "security": { + "nested": { + "privateca": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Security.PrivateCA.V1", + "go_package": "cloud.google.com/go/security/privateca/apiv1/privatecapb;privatecapb", + "java_multiple_files": true, + "java_outer_classname": "PrivateCaProto", + "java_package": "com.google.cloud.security.privateca.v1", + "php_namespace": "Google\\Cloud\\Security\\PrivateCA\\V1", + "ruby_package": "Google::Cloud::Security::PrivateCA::V1" + }, + "nested": { + "CertificateAuthority": { + "options": { + "(google.api.resource).type": "privateca.googleapis.com/CertificateAuthority", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "config": { + "type": "CertificateConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "lifetime": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "keySpec": { + "type": "KeyVersionSpec", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "subordinateConfig": { + "type": "SubordinateConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tier": { + "type": "CaPool.Tier", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCaCertificates": { + "rule": "repeated", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "caCertificateDescriptions": { + "rule": "repeated", + "type": "CertificateDescription", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gcsBucket": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "accessUrls": { + "type": "AccessUrls", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userDefinedAccessUrls": { + "type": "UserDefinedAccessUrls", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "SELF_SIGNED": 1, + "SUBORDINATE": 2 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2, + "STAGED": 3, + "AWAITING_USER_ACTIVATION": 4, + "DELETED": 5 + } + }, + "AccessUrls": { + "fields": { + "caCertificateAccessUrl": { + "type": "string", + "id": 1 + }, + "crlAccessUrls": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "KeyVersionSpec": { + "oneofs": { + "KeyVersion": { + "oneof": [ + "cloudKmsKeyVersion", + "algorithm" + ] + } + }, + "fields": { + "cloudKmsKeyVersion": { + "type": "string", + "id": 1 + }, + "algorithm": { + "type": "SignHashAlgorithm", + "id": 2 + } + } + }, + "SignHashAlgorithm": { + "values": { + "SIGN_HASH_ALGORITHM_UNSPECIFIED": 0, + "RSA_PSS_2048_SHA256": 1, + "RSA_PSS_3072_SHA256": 2, + "RSA_PSS_4096_SHA256": 3, + "RSA_PKCS1_2048_SHA256": 6, + "RSA_PKCS1_3072_SHA256": 7, + "RSA_PKCS1_4096_SHA256": 8, + "EC_P256_SHA256": 4, + "EC_P384_SHA384": 5 + } + }, + "UserDefinedAccessUrls": { + "fields": { + "aiaIssuingCertificateUrls": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "crlAccessUrls": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "CaPool": { + "options": { + "(google.api.resource).type": "privateca.googleapis.com/CaPool", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/caPools/{ca_pool}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "tier": { + "type": "Tier", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "issuancePolicy": { + "type": "IssuancePolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "publishingOptions": { + "type": "PublishingOptions", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionSpec": { + "type": "EncryptionSpec", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Tier": { + "values": { + "TIER_UNSPECIFIED": 0, + "ENTERPRISE": 1, + "DEVOPS": 2 + } + }, + "PublishingOptions": { + "fields": { + "publishCaCert": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "publishCrl": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encodingFormat": { + "type": "EncodingFormat", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EncodingFormat": { + "values": { + "ENCODING_FORMAT_UNSPECIFIED": 0, + "PEM": 1, + "DER": 2 + } + } + } + }, + "IssuancePolicy": { + "fields": { + "allowedKeyTypes": { + "rule": "repeated", + "type": "AllowedKeyType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "backdateDuration": { + "type": "google.protobuf.Duration", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowRequesterSpecifiedNotBeforeTime": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maximumLifetime": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedIssuanceModes": { + "type": "IssuanceModes", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "baselineValues": { + "type": "X509Parameters", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "identityConstraints": { + "type": "CertificateIdentityConstraints", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "passthroughExtensions": { + "type": "CertificateExtensionConstraints", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AllowedKeyType": { + "oneofs": { + "keyType": { + "oneof": [ + "rsa", + "ellipticCurve" + ] + } + }, + "fields": { + "rsa": { + "type": "RsaKeyType", + "id": 1 + }, + "ellipticCurve": { + "type": "EcKeyType", + "id": 2 + } + }, + "nested": { + "RsaKeyType": { + "fields": { + "minModulusSize": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxModulusSize": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EcKeyType": { + "fields": { + "signatureAlgorithm": { + "type": "EcSignatureAlgorithm", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EcSignatureAlgorithm": { + "values": { + "EC_SIGNATURE_ALGORITHM_UNSPECIFIED": 0, + "ECDSA_P256": 1, + "ECDSA_P384": 2, + "EDDSA_25519": 3 + } + } + } + } + } + }, + "IssuanceModes": { + "fields": { + "allowCsrBasedIssuance": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowConfigBasedIssuance": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + }, + "EncryptionSpec": { + "fields": { + "cloudKmsKey": { + "type": "string", + "id": 1 + } + } + }, + "CertificateRevocationList": { + "options": { + "(google.api.resource).type": "privateca.googleapis.com/CertificateRevocationList", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "sequenceNumber": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revokedCertificates": { + "rule": "repeated", + "type": "RevokedCertificate", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCrl": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accessUrl": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionId": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RevokedCertificate": { + "fields": { + "certificate": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "privateca.googleapis.com/Certificate" + } + }, + "hexSerialNumber": { + "type": "string", + "id": 2 + }, + "revocationReason": { + "type": "RevocationReason", + "id": 3 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "SUPERSEDED": 2 + } + } + } + }, + "Certificate": { + "options": { + "(google.api.resource).type": "privateca.googleapis.com/Certificate", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}" + }, + "oneofs": { + "certificateConfig": { + "oneof": [ + "pemCsr", + "config" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "pemCsr": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "config": { + "type": "CertificateConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "issuerCertificateAuthority": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "lifetime": { + "type": "google.protobuf.Duration", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "certificateTemplate": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateTemplate" + } + }, + "subjectMode": { + "type": "SubjectRequestMode", + "id": 7, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "revocationDetails": { + "type": "RevocationDetails", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCertificate": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "certificateDescription": { + "type": "CertificateDescription", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCertificateChain": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestedNotBeforeTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RevocationDetails": { + "fields": { + "revocationState": { + "type": "RevocationReason", + "id": 1 + }, + "revocationTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + }, + "CertificateTemplate": { + "options": { + "(google.api.resource).type": "privateca.googleapis.com/CertificateTemplate", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificateTemplates/{certificate_template}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "maximumLifetime": { + "type": "google.protobuf.Duration", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "predefinedValues": { + "type": "X509Parameters", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "identityConstraints": { + "type": "CertificateIdentityConstraints", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "passthroughExtensions": { + "type": "CertificateExtensionConstraints", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "X509Parameters": { + "fields": { + "keyUsage": { + "type": "KeyUsage", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "caOptions": { + "type": "CaOptions", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "policyIds": { + "rule": "repeated", + "type": "ObjectId", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "aiaOcspServers": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nameConstraints": { + "type": "NameConstraints", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "additionalExtensions": { + "rule": "repeated", + "type": "X509Extension", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CaOptions": { + "oneofs": { + "_isCa": { + "oneof": [ + "isCa" + ] + }, + "_maxIssuerPathLength": { + "oneof": [ + "maxIssuerPathLength" + ] + } + }, + "fields": { + "isCa": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "maxIssuerPathLength": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "NameConstraints": { + "fields": { + "critical": { + "type": "bool", + "id": 1 + }, + "permittedDnsNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "excludedDnsNames": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "permittedIpRanges": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "excludedIpRanges": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "permittedEmailAddresses": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "excludedEmailAddresses": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "permittedUris": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "excludedUris": { + "rule": "repeated", + "type": "string", + "id": 9 + } + } + } + } + }, + "SubordinateConfig": { + "oneofs": { + "subordinateConfig": { + "oneof": [ + "certificateAuthority", + "pemIssuerChain" + ] + } + }, + "fields": { + "certificateAuthority": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "pemIssuerChain": { + "type": "SubordinateConfigChain", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SubordinateConfigChain": { + "fields": { + "pemCertificates": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "PublicKey": { + "fields": { + "key": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "format": { + "type": "KeyFormat", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "KeyFormat": { + "values": { + "KEY_FORMAT_UNSPECIFIED": 0, + "PEM": 1 + } + } + } + }, + "CertificateConfig": { + "fields": { + "subjectConfig": { + "type": "SubjectConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "x509Config": { + "type": "X509Parameters", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicKey": { + "type": "PublicKey", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subjectKeyId": { + "type": "KeyId", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SubjectConfig": { + "fields": { + "subject": { + "type": "Subject", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subjectAltName": { + "type": "SubjectAltNames", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "KeyId": { + "fields": { + "keyId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "CertificateDescription": { + "fields": { + "subjectDescription": { + "type": "SubjectDescription", + "id": 1 + }, + "x509Description": { + "type": "X509Parameters", + "id": 2 + }, + "publicKey": { + "type": "PublicKey", + "id": 3 + }, + "subjectKeyId": { + "type": "KeyId", + "id": 4 + }, + "authorityKeyId": { + "type": "KeyId", + "id": 5 + }, + "crlDistributionPoints": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "aiaIssuingCertificateUrls": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "certFingerprint": { + "type": "CertificateFingerprint", + "id": 8 + }, + "tbsCertificateDigest": { + "type": "string", + "id": 9 + } + }, + "nested": { + "SubjectDescription": { + "fields": { + "subject": { + "type": "Subject", + "id": 1 + }, + "subjectAltName": { + "type": "SubjectAltNames", + "id": 2 + }, + "hexSerialNumber": { + "type": "string", + "id": 3 + }, + "lifetime": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "notBeforeTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "notAfterTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + } + }, + "KeyId": { + "fields": { + "keyId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CertificateFingerprint": { + "fields": { + "sha256Hash": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ObjectId": { + "fields": { + "objectIdPath": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "X509Extension": { + "fields": { + "objectId": { + "type": "ObjectId", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "critical": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "value": { + "type": "bytes", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "KeyUsage": { + "fields": { + "baseKeyUsage": { + "type": "KeyUsageOptions", + "id": 1 + }, + "extendedKeyUsage": { + "type": "ExtendedKeyUsageOptions", + "id": 2 + }, + "unknownExtendedKeyUsages": { + "rule": "repeated", + "type": "ObjectId", + "id": 3 + } + }, + "nested": { + "KeyUsageOptions": { + "fields": { + "digitalSignature": { + "type": "bool", + "id": 1 + }, + "contentCommitment": { + "type": "bool", + "id": 2 + }, + "keyEncipherment": { + "type": "bool", + "id": 3 + }, + "dataEncipherment": { + "type": "bool", + "id": 4 + }, + "keyAgreement": { + "type": "bool", + "id": 5 + }, + "certSign": { + "type": "bool", + "id": 6 + }, + "crlSign": { + "type": "bool", + "id": 7 + }, + "encipherOnly": { + "type": "bool", + "id": 8 + }, + "decipherOnly": { + "type": "bool", + "id": 9 + } + } + }, + "ExtendedKeyUsageOptions": { + "fields": { + "serverAuth": { + "type": "bool", + "id": 1 + }, + "clientAuth": { + "type": "bool", + "id": 2 + }, + "codeSigning": { + "type": "bool", + "id": 3 + }, + "emailProtection": { + "type": "bool", + "id": 4 + }, + "timeStamping": { + "type": "bool", + "id": 5 + }, + "ocspSigning": { + "type": "bool", + "id": 6 + } + } + } + } + }, + "AttributeTypeAndValue": { + "oneofs": { + "attributeType": { + "oneof": [ + "type", + "objectId" + ] + } + }, + "fields": { + "type": { + "type": "AttributeType", + "id": 1 + }, + "objectId": { + "type": "ObjectId", + "id": 2 + }, + "value": { + "type": "string", + "id": 3 + } + } + }, + "RelativeDistinguishedName": { + "fields": { + "attributes": { + "rule": "repeated", + "type": "AttributeTypeAndValue", + "id": 1 + } + } + }, + "Subject": { + "fields": { + "commonName": { + "type": "string", + "id": 1 + }, + "countryCode": { + "type": "string", + "id": 2 + }, + "organization": { + "type": "string", + "id": 3 + }, + "organizationalUnit": { + "type": "string", + "id": 4 + }, + "locality": { + "type": "string", + "id": 5 + }, + "province": { + "type": "string", + "id": 6 + }, + "streetAddress": { + "type": "string", + "id": 7 + }, + "postalCode": { + "type": "string", + "id": 8 + }, + "rdnSequence": { + "rule": "repeated", + "type": "RelativeDistinguishedName", + "id": 9 + } + } + }, + "SubjectAltNames": { + "fields": { + "dnsNames": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "uris": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "emailAddresses": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "ipAddresses": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "customSans": { + "rule": "repeated", + "type": "X509Extension", + "id": 5 + } + } + }, + "CertificateIdentityConstraints": { + "oneofs": { + "_allowSubjectPassthrough": { + "oneof": [ + "allowSubjectPassthrough" + ] + }, + "_allowSubjectAltNamesPassthrough": { + "oneof": [ + "allowSubjectAltNamesPassthrough" + ] + } + }, + "fields": { + "celExpression": { + "type": "google.type.Expr", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowSubjectPassthrough": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "allowSubjectAltNamesPassthrough": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "CertificateExtensionConstraints": { + "fields": { + "knownExtensions": { + "rule": "repeated", + "type": "KnownCertificateExtension", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "additionalExtensions": { + "rule": "repeated", + "type": "ObjectId", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "KnownCertificateExtension": { + "values": { + "KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED": 0, + "BASE_KEY_USAGE": 1, + "EXTENDED_KEY_USAGE": 2, + "CA_OPTIONS": 3, + "POLICY_IDS": 4, + "AIA_OCSP_SERVERS": 5, + "NAME_CONSTRAINTS": 6 + } + } + } + }, + "AttributeType": { + "values": { + "ATTRIBUTE_TYPE_UNSPECIFIED": 0, + "COMMON_NAME": 1, + "COUNTRY_CODE": 2, + "ORGANIZATION": 3, + "ORGANIZATIONAL_UNIT": 4, + "LOCALITY": 5, + "PROVINCE": 6, + "STREET_ADDRESS": 7, + "POSTAL_CODE": 8 + } + }, + "RevocationReason": { + "values": { + "REVOCATION_REASON_UNSPECIFIED": 0, + "KEY_COMPROMISE": 1, + "CERTIFICATE_AUTHORITY_COMPROMISE": 2, + "AFFILIATION_CHANGED": 3, + "SUPERSEDED": 4, + "CESSATION_OF_OPERATION": 5, + "CERTIFICATE_HOLD": 6, + "PRIVILEGE_WITHDRAWN": 7, + "ATTRIBUTE_AUTHORITY_COMPROMISE": 8 + } + }, + "SubjectRequestMode": { + "values": { + "SUBJECT_REQUEST_MODE_UNSPECIFIED": 0, + "DEFAULT": 1, + "RDN_SEQUENCE": 3, + "REFLECTED_SPIFFE": 2 + } + }, + "CertificateAuthorityService": { + "options": { + "(google.api.default_host)": "privateca.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateCertificate": { + "requestType": "CreateCertificateRequest", + "responseType": "Certificate", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/caPools/*}/certificates", + "(google.api.http).body": "certificate", + "(google.api.method_signature)": "parent,certificate,certificate_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/caPools/*}/certificates", + "body": "certificate" + } + }, + { + "(google.api.method_signature)": "parent,certificate,certificate_id" + } + ] + }, + "GetCertificate": { + "requestType": "GetCertificateRequest", + "responseType": "Certificate", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCertificates": { + "requestType": "ListCertificatesRequest", + "responseType": "ListCertificatesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/caPools/*}/certificates", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/caPools/*}/certificates" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RevokeCertificate": { + "requestType": "RevokeCertificateRequest", + "responseType": "Certificate", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}:revoke", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}:revoke", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCertificate": { + "requestType": "UpdateCertificateRequest", + "responseType": "Certificate", + "options": { + "(google.api.http).patch": "/v1/{certificate.name=projects/*/locations/*/caPools/*/certificates/*}", + "(google.api.http).body": "certificate", + "(google.api.method_signature)": "certificate,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{certificate.name=projects/*/locations/*/caPools/*/certificates/*}", + "body": "certificate" + } + }, + { + "(google.api.method_signature)": "certificate,update_mask" + } + ] + }, + "ActivateCertificateAuthority": { + "requestType": "ActivateCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:activate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:activate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateCertificateAuthority": { + "requestType": "CreateCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities", + "(google.api.http).body": "certificate_authority", + "(google.api.method_signature)": "parent,certificate_authority,certificate_authority_id", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities", + "body": "certificate_authority" + } + }, + { + "(google.api.method_signature)": "parent,certificate_authority,certificate_authority_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DisableCertificateAuthority": { + "requestType": "DisableCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:disable", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:disable", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "EnableCertificateAuthority": { + "requestType": "EnableCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:enable", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:enable", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "FetchCertificateAuthorityCsr": { + "requestType": "FetchCertificateAuthorityCsrRequest", + "responseType": "FetchCertificateAuthorityCsrResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:fetch", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:fetch" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetCertificateAuthority": { + "requestType": "GetCertificateAuthorityRequest", + "responseType": "CertificateAuthority", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCertificateAuthorities": { + "requestType": "ListCertificateAuthoritiesRequest", + "responseType": "ListCertificateAuthoritiesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UndeleteCertificateAuthority": { + "requestType": "UndeleteCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:undelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:undelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCertificateAuthority": { + "requestType": "DeleteCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCertificateAuthority": { + "requestType": "UpdateCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{certificate_authority.name=projects/*/locations/*/caPools/*/certificateAuthorities/*}", + "(google.api.http).body": "certificate_authority", + "(google.api.method_signature)": "certificate_authority,update_mask", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{certificate_authority.name=projects/*/locations/*/caPools/*/certificateAuthorities/*}", + "body": "certificate_authority" + } + }, + { + "(google.api.method_signature)": "certificate_authority,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateCaPool": { + "requestType": "CreateCaPoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/caPools", + "(google.api.http).body": "ca_pool", + "(google.api.method_signature)": "parent,ca_pool,ca_pool_id", + "(google.longrunning.operation_info).response_type": "CaPool", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/caPools", + "body": "ca_pool" + } + }, + { + "(google.api.method_signature)": "parent,ca_pool,ca_pool_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CaPool", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCaPool": { + "requestType": "UpdateCaPoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{ca_pool.name=projects/*/locations/*/caPools/*}", + "(google.api.http).body": "ca_pool", + "(google.api.method_signature)": "ca_pool,update_mask", + "(google.longrunning.operation_info).response_type": "CaPool", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{ca_pool.name=projects/*/locations/*/caPools/*}", + "body": "ca_pool" + } + }, + { + "(google.api.method_signature)": "ca_pool,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CaPool", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetCaPool": { + "requestType": "GetCaPoolRequest", + "responseType": "CaPool", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/caPools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/caPools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCaPools": { + "requestType": "ListCaPoolsRequest", + "responseType": "ListCaPoolsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/caPools", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/caPools" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteCaPool": { + "requestType": "DeleteCaPoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/caPools/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/caPools/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "FetchCaCerts": { + "requestType": "FetchCaCertsRequest", + "responseType": "FetchCaCertsResponse", + "options": { + "(google.api.http).post": "/v1/{ca_pool=projects/*/locations/*/caPools/*}:fetchCaCerts", + "(google.api.http).body": "*", + "(google.api.method_signature)": "ca_pool" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{ca_pool=projects/*/locations/*/caPools/*}:fetchCaCerts", + "body": "*" + } + }, + { + "(google.api.method_signature)": "ca_pool" + } + ] + }, + "GetCertificateRevocationList": { + "requestType": "GetCertificateRevocationListRequest", + "responseType": "CertificateRevocationList", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCertificateRevocationLists": { + "requestType": "ListCertificateRevocationListsRequest", + "responseType": "ListCertificateRevocationListsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/caPools/*/certificateAuthorities/*}/certificateRevocationLists", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/caPools/*/certificateAuthorities/*}/certificateRevocationLists" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateCertificateRevocationList": { + "requestType": "UpdateCertificateRevocationListRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{certificate_revocation_list.name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}", + "(google.api.http).body": "certificate_revocation_list", + "(google.api.method_signature)": "certificate_revocation_list,update_mask", + "(google.longrunning.operation_info).response_type": "CertificateRevocationList", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{certificate_revocation_list.name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}", + "body": "certificate_revocation_list" + } + }, + { + "(google.api.method_signature)": "certificate_revocation_list,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateRevocationList", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateCertificateTemplate": { + "requestType": "CreateCertificateTemplateRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/certificateTemplates", + "(google.api.http).body": "certificate_template", + "(google.api.method_signature)": "parent,certificate_template,certificate_template_id", + "(google.longrunning.operation_info).response_type": "CertificateTemplate", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/certificateTemplates", + "body": "certificate_template" + } + }, + { + "(google.api.method_signature)": "parent,certificate_template,certificate_template_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateTemplate", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCertificateTemplate": { + "requestType": "DeleteCertificateTemplateRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/certificateTemplates/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.security.privateca.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/certificateTemplates/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.security.privateca.v1.OperationMetadata" + } + } + ] + }, + "GetCertificateTemplate": { + "requestType": "GetCertificateTemplateRequest", + "responseType": "CertificateTemplate", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/certificateTemplates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/certificateTemplates/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCertificateTemplates": { + "requestType": "ListCertificateTemplatesRequest", + "responseType": "ListCertificateTemplatesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/certificateTemplates", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/certificateTemplates" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateCertificateTemplate": { + "requestType": "UpdateCertificateTemplateRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{certificate_template.name=projects/*/locations/*/certificateTemplates/*}", + "(google.api.http).body": "certificate_template", + "(google.api.method_signature)": "certificate_template,update_mask", + "(google.longrunning.operation_info).response_type": "CertificateTemplate", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{certificate_template.name=projects/*/locations/*/certificateTemplates/*}", + "body": "certificate_template" + } + }, + { + "(google.api.method_signature)": "certificate_template,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateTemplate", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "CreateCertificateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" + } + }, + "certificateId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "certificate": { + "type": "Certificate", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "issuingCertificateAuthorityId": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetCertificateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/Certificate" + } + } + } + }, + "ListCertificatesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" + } + }, + "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" + } + } + } + }, + "ListCertificatesResponse": { + "fields": { + "certificates": { + "rule": "repeated", + "type": "Certificate", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "RevokeCertificateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/Certificate" + } + }, + "reason": { + "type": "RevocationReason", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateCertificateRequest": { + "fields": { + "certificate": { + "type": "Certificate", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ActivateCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "pemCaCertificate": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subordinateConfig": { + "type": "SubordinateConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateCertificateAuthorityRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" + } + }, + "certificateAuthorityId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "certificateAuthority": { + "type": "CertificateAuthority", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DisableCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreDependentResources": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EnableCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FetchCertificateAuthorityCsrRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + } + } + }, + "FetchCertificateAuthorityCsrResponse": { + "fields": { + "pemCsr": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + } + } + }, + "ListCertificateAuthoritiesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" + } + }, + "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" + } + } + } + }, + "ListCertificateAuthoritiesResponse": { + "fields": { + "certificateAuthorities": { + "rule": "repeated", + "type": "CertificateAuthority", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UndeleteCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreActiveCertificates": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "skipGracePeriod": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreDependentResources": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateCertificateAuthorityRequest": { + "fields": { + "certificateAuthority": { + "type": "CertificateAuthority", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateCaPoolRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "caPoolId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "caPool": { + "type": "CaPool", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateCaPoolRequest": { + "fields": { + "caPool": { + "type": "CaPool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteCaPoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreDependentResources": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FetchCaCertsRequest": { + "fields": { + "caPool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FetchCaCertsResponse": { + "fields": { + "caCerts": { + "rule": "repeated", + "type": "CertChain", + "id": 1 + } + }, + "nested": { + "CertChain": { + "fields": { + "certificates": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "GetCaPoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" + } + } + } + }, + "ListCaPoolsRequest": { + "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" + } + } + } + }, + "ListCaPoolsResponse": { + "fields": { + "caPools": { + "rule": "repeated", + "type": "CaPool", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetCertificateRevocationListRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateRevocationList" + } + } + } + }, + "ListCertificateRevocationListsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "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" + } + } + } + }, + "ListCertificateRevocationListsResponse": { + "fields": { + "certificateRevocationLists": { + "rule": "repeated", + "type": "CertificateRevocationList", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateCertificateRevocationListRequest": { + "fields": { + "certificateRevocationList": { + "type": "CertificateRevocationList", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateCertificateTemplateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "certificateTemplateId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "certificateTemplate": { + "type": "CertificateTemplate", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteCertificateTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateTemplate" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetCertificateTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateTemplate" + } + } + } + }, + "ListCertificateTemplatesRequest": { + "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" + } + } + } + }, + "ListCertificateTemplatesResponse": { + "fields": { + "certificateTemplates": { + "rule": "repeated", + "type": "CertificateTemplate", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateCertificateTemplateRequest": { + "fields": { + "certificateTemplate": { + "type": "CertificateTemplate", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "v1beta1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Security.PrivateCA.V1Beta1", + "go_package": "cloud.google.com/go/security/privateca/apiv1beta1/privatecapb;privatecapb", + "java_multiple_files": true, + "java_outer_classname": "PrivateCaProto", + "java_package": "com.google.cloud.security.privateca.v1beta1", + "php_namespace": "Google\\Cloud\\Security\\PrivateCA\\V1beta1", + "ruby_package": "Google::Cloud::Security::PrivateCA::V1beta1" + }, + "nested": { + "CertificateAuthority": { + "options": { + "(google.api.resource).type": "privateca.googleapis.com/CertificateAuthority", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "tier": { + "type": "Tier", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "config": { + "type": "CertificateConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "lifetime": { + "type": "google.protobuf.Duration", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "keySpec": { + "type": "KeyVersionSpec", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "certificatePolicy": { + "type": "CertificateAuthorityPolicy", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "issuingOptions": { + "type": "IssuingOptions", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subordinateConfig": { + "type": "SubordinateConfig", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCaCertificates": { + "rule": "repeated", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "caCertificateDescriptions": { + "rule": "repeated", + "type": "CertificateDescription", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gcsBucket": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "accessUrls": { + "type": "AccessUrls", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "IssuingOptions": { + "fields": { + "includeCaCertUrl": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "includeCrlAccessUrl": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CertificateAuthorityPolicy": { + "oneofs": { + "configPolicy": { + "oneof": [ + "allowedConfigList", + "overwriteConfigValues" + ] + } + }, + "fields": { + "allowedConfigList": { + "type": "AllowedConfigList", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "overwriteConfigValues": { + "type": "ReusableConfigWrapper", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedLocationsAndOrganizations": { + "rule": "repeated", + "type": "Subject", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedCommonNames": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedSans": { + "type": "AllowedSubjectAltNames", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maximumLifetime": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedIssuanceModes": { + "type": "IssuanceModes", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AllowedConfigList": { + "fields": { + "allowedConfigValues": { + "rule": "repeated", + "type": "ReusableConfigWrapper", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AllowedSubjectAltNames": { + "fields": { + "allowedDnsNames": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedUris": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedEmailAddresses": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedIps": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowGlobbingDnsWildcards": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowCustomSans": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "IssuanceModes": { + "fields": { + "allowCsrBasedIssuance": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowConfigBasedIssuance": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "AccessUrls": { + "fields": { + "caCertificateAccessUrl": { + "type": "string", + "id": 1 + }, + "crlAccessUrl": { + "type": "string", + "id": 2 + } + } + }, + "KeyVersionSpec": { + "oneofs": { + "KeyVersion": { + "oneof": [ + "cloudKmsKeyVersion", + "algorithm" + ] + } + }, + "fields": { + "cloudKmsKeyVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "algorithm": { + "type": "SignHashAlgorithm", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "SELF_SIGNED": 1, + "SUBORDINATE": 2 + } + }, + "Tier": { + "values": { + "TIER_UNSPECIFIED": 0, + "ENTERPRISE": 1, + "DEVOPS": 2 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2, + "PENDING_ACTIVATION": 3, + "PENDING_DELETION": 4 + } + }, + "SignHashAlgorithm": { + "values": { + "SIGN_HASH_ALGORITHM_UNSPECIFIED": 0, + "RSA_PSS_2048_SHA256": 1, + "RSA_PSS_3072_SHA256": 2, + "RSA_PSS_4096_SHA256": 3, + "RSA_PKCS1_2048_SHA256": 6, + "RSA_PKCS1_3072_SHA256": 7, + "RSA_PKCS1_4096_SHA256": 8, + "EC_P256_SHA256": 4, + "EC_P384_SHA384": 5 + } + } + } + }, + "CertificateRevocationList": { + "options": { + "(google.api.resource).type": "privateca.googleapis.com/CertificateRevocationList", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sequenceNumber": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revokedCertificates": { + "rule": "repeated", + "type": "RevokedCertificate", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCrl": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accessUrl": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RevokedCertificate": { + "fields": { + "certificate": { + "type": "string", + "id": 1 + }, + "hexSerialNumber": { + "type": "string", + "id": 2 + }, + "revocationReason": { + "type": "RevocationReason", + "id": 3 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "SUPERSEDED": 2 + } + } + } + }, + "Certificate": { + "options": { + "(google.api.resource).type": "privateca.googleapis.com/Certificate", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificates/{certificate}" + }, + "oneofs": { + "certificateConfig": { + "oneof": [ + "pemCsr", + "config" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCsr": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "config": { + "type": "CertificateConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "lifetime": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "revocationDetails": { + "type": "RevocationDetails", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCertificate": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "certificateDescription": { + "type": "CertificateDescription", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCertificateChain": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RevocationDetails": { + "fields": { + "revocationState": { + "type": "RevocationReason", + "id": 1 + }, + "revocationTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + }, + "ReusableConfig": { + "options": { + "(google.api.resource).type": "privateca.googleapis.com/ReusableConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/reusableConfigs/{reusable_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "values": { + "type": "ReusableConfigValues", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ReusableConfigValues": { + "fields": { + "keyUsage": { + "type": "KeyUsage", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "caOptions": { + "type": "CaOptions", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "policyIds": { + "rule": "repeated", + "type": "ObjectId", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "aiaOcspServers": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "additionalExtensions": { + "rule": "repeated", + "type": "X509Extension", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CaOptions": { + "fields": { + "isCa": { + "type": "google.protobuf.BoolValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxIssuerPathLength": { + "type": "google.protobuf.Int32Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ReusableConfigWrapper": { + "oneofs": { + "configValues": { + "oneof": [ + "reusableConfig", + "reusableConfigValues" + ] + } + }, + "fields": { + "reusableConfig": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "reusableConfigValues": { + "type": "ReusableConfigValues", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SubordinateConfig": { + "oneofs": { + "subordinateConfig": { + "oneof": [ + "certificateAuthority", + "pemIssuerChain" + ] + } + }, + "fields": { + "certificateAuthority": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pemIssuerChain": { + "type": "SubordinateConfigChain", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SubordinateConfigChain": { + "fields": { + "pemCertificates": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "PublicKey": { + "fields": { + "type": { + "type": "KeyType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "key": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "KeyType": { + "values": { + "KEY_TYPE_UNSPECIFIED": 0, + "PEM_RSA_KEY": 1, + "PEM_EC_KEY": 2 + } + } + } + }, + "CertificateConfig": { + "fields": { + "subjectConfig": { + "type": "SubjectConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "reusableConfig": { + "type": "ReusableConfigWrapper", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicKey": { + "type": "PublicKey", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SubjectConfig": { + "fields": { + "subject": { + "type": "Subject", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "commonName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subjectAltName": { + "type": "SubjectAltNames", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "CertificateDescription": { + "fields": { + "subjectDescription": { + "type": "SubjectDescription", + "id": 1 + }, + "configValues": { + "type": "ReusableConfigValues", + "id": 2 + }, + "publicKey": { + "type": "PublicKey", + "id": 3 + }, + "subjectKeyId": { + "type": "KeyId", + "id": 4 + }, + "authorityKeyId": { + "type": "KeyId", + "id": 5 + }, + "crlDistributionPoints": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "aiaIssuingCertificateUrls": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "certFingerprint": { + "type": "CertificateFingerprint", + "id": 8 + } + }, + "nested": { + "SubjectDescription": { + "fields": { + "subject": { + "type": "Subject", + "id": 1 + }, + "commonName": { + "type": "string", + "id": 2 + }, + "subjectAltName": { + "type": "SubjectAltNames", + "id": 3 + }, + "hexSerialNumber": { + "type": "string", + "id": 4 + }, + "lifetime": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "notBeforeTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "notAfterTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + }, + "KeyId": { + "fields": { + "keyId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CertificateFingerprint": { + "fields": { + "sha256Hash": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ObjectId": { + "fields": { + "objectIdPath": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "X509Extension": { + "fields": { + "objectId": { + "type": "ObjectId", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "critical": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "value": { + "type": "bytes", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "KeyUsage": { + "fields": { + "baseKeyUsage": { + "type": "KeyUsageOptions", + "id": 1 + }, + "extendedKeyUsage": { + "type": "ExtendedKeyUsageOptions", + "id": 2 + }, + "unknownExtendedKeyUsages": { + "rule": "repeated", + "type": "ObjectId", + "id": 3 + } + }, + "nested": { + "KeyUsageOptions": { + "fields": { + "digitalSignature": { + "type": "bool", + "id": 1 + }, + "contentCommitment": { + "type": "bool", + "id": 2 + }, + "keyEncipherment": { + "type": "bool", + "id": 3 + }, + "dataEncipherment": { + "type": "bool", + "id": 4 + }, + "keyAgreement": { + "type": "bool", + "id": 5 + }, + "certSign": { + "type": "bool", + "id": 6 + }, + "crlSign": { + "type": "bool", + "id": 7 + }, + "encipherOnly": { + "type": "bool", + "id": 8 + }, + "decipherOnly": { + "type": "bool", + "id": 9 + } + } + }, + "ExtendedKeyUsageOptions": { + "fields": { + "serverAuth": { + "type": "bool", + "id": 1 + }, + "clientAuth": { + "type": "bool", + "id": 2 + }, + "codeSigning": { + "type": "bool", + "id": 3 + }, + "emailProtection": { + "type": "bool", + "id": 4 + }, + "timeStamping": { + "type": "bool", + "id": 5 + }, + "ocspSigning": { + "type": "bool", + "id": 6 + } + } + } + } + }, + "Subject": { + "fields": { + "countryCode": { + "type": "string", + "id": 1 + }, + "organization": { + "type": "string", + "id": 2 + }, + "organizationalUnit": { + "type": "string", + "id": 3 + }, + "locality": { + "type": "string", + "id": 4 + }, + "province": { + "type": "string", + "id": 5 + }, + "streetAddress": { + "type": "string", + "id": 6 + }, + "postalCode": { + "type": "string", + "id": 7 + } + } + }, + "SubjectAltNames": { + "fields": { + "dnsNames": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "uris": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "emailAddresses": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "ipAddresses": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "customSans": { + "rule": "repeated", + "type": "X509Extension", + "id": 5 + } + } + }, + "RevocationReason": { + "values": { + "REVOCATION_REASON_UNSPECIFIED": 0, + "KEY_COMPROMISE": 1, + "CERTIFICATE_AUTHORITY_COMPROMISE": 2, + "AFFILIATION_CHANGED": 3, + "SUPERSEDED": 4, + "CESSATION_OF_OPERATION": 5, + "CERTIFICATE_HOLD": 6, + "PRIVILEGE_WITHDRAWN": 7, + "ATTRIBUTE_AUTHORITY_COMPROMISE": 8 + } + }, + "CertificateAuthorityService": { + "options": { + "(google.api.default_host)": "privateca.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateCertificate": { + "requestType": "CreateCertificateRequest", + "responseType": "Certificate", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates", + "(google.api.http).body": "certificate", + "(google.api.method_signature)": "parent,certificate,certificate_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates", + "body": "certificate" + } + }, + { + "(google.api.method_signature)": "parent,certificate,certificate_id" + } + ] + }, + "GetCertificate": { + "requestType": "GetCertificateRequest", + "responseType": "Certificate", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCertificates": { + "requestType": "ListCertificatesRequest", + "responseType": "ListCertificatesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RevokeCertificate": { + "requestType": "RevokeCertificateRequest", + "responseType": "Certificate", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}:revoke", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}:revoke", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCertificate": { + "requestType": "UpdateCertificateRequest", + "responseType": "Certificate", + "options": { + "(google.api.http).patch": "/v1beta1/{certificate.name=projects/*/locations/*/certificateAuthorities/*/certificates/*}", + "(google.api.http).body": "certificate", + "(google.api.method_signature)": "certificate,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{certificate.name=projects/*/locations/*/certificateAuthorities/*/certificates/*}", + "body": "certificate" + } + }, + { + "(google.api.method_signature)": "certificate,update_mask" + } + ] + }, + "ActivateCertificateAuthority": { + "requestType": "ActivateCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:activate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:activate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateCertificateAuthority": { + "requestType": "CreateCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities", + "(google.api.http).body": "certificate_authority", + "(google.api.method_signature)": "parent,certificate_authority,certificate_authority_id", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities", + "body": "certificate_authority" + } + }, + { + "(google.api.method_signature)": "parent,certificate_authority,certificate_authority_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DisableCertificateAuthority": { + "requestType": "DisableCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:disable", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:disable", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "EnableCertificateAuthority": { + "requestType": "EnableCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:enable", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:enable", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "FetchCertificateAuthorityCsr": { + "requestType": "FetchCertificateAuthorityCsrRequest", + "responseType": "FetchCertificateAuthorityCsrResponse", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:fetch", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:fetch" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetCertificateAuthority": { + "requestType": "GetCertificateAuthorityRequest", + "responseType": "CertificateAuthority", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCertificateAuthorities": { + "requestType": "ListCertificateAuthoritiesRequest", + "responseType": "ListCertificateAuthoritiesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RestoreCertificateAuthority": { + "requestType": "RestoreCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ScheduleDeleteCertificateAuthority": { + "requestType": "ScheduleDeleteCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:scheduleDelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:scheduleDelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCertificateAuthority": { + "requestType": "UpdateCertificateAuthorityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta1/{certificate_authority.name=projects/*/locations/*/certificateAuthorities/*}", + "(google.api.http).body": "certificate_authority", + "(google.api.method_signature)": "certificate_authority,update_mask", + "(google.longrunning.operation_info).response_type": "CertificateAuthority", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{certificate_authority.name=projects/*/locations/*/certificateAuthorities/*}", + "body": "certificate_authority" + } + }, + { + "(google.api.method_signature)": "certificate_authority,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateAuthority", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetCertificateRevocationList": { + "requestType": "GetCertificateRevocationListRequest", + "responseType": "CertificateRevocationList", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCertificateRevocationLists": { + "requestType": "ListCertificateRevocationListsRequest", + "responseType": "ListCertificateRevocationListsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificateRevocationLists", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificateRevocationLists" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateCertificateRevocationList": { + "requestType": "UpdateCertificateRevocationListRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta1/{certificate_revocation_list.name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}", + "(google.api.http).body": "certificate_revocation_list", + "(google.api.method_signature)": "certificate_revocation_list,update_mask", + "(google.longrunning.operation_info).response_type": "CertificateRevocationList", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{certificate_revocation_list.name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}", + "body": "certificate_revocation_list" + } + }, + { + "(google.api.method_signature)": "certificate_revocation_list,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateRevocationList", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetReusableConfig": { + "requestType": "GetReusableConfigRequest", + "responseType": "ReusableConfig", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/reusableConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/reusableConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListReusableConfigs": { + "requestType": "ListReusableConfigsRequest", + "responseType": "ListReusableConfigsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/reusableConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/reusableConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateCertificateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "certificateId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "certificate": { + "type": "Certificate", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetCertificateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/Certificate" + } + } + } + }, + "ListCertificatesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "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" + } + } + } + }, + "ListCertificatesResponse": { + "fields": { + "certificates": { + "rule": "repeated", + "type": "Certificate", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "RevokeCertificateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/Certificate" + } + }, + "reason": { + "type": "RevocationReason", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateCertificateRequest": { + "fields": { + "certificate": { + "type": "Certificate", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ActivateCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "pemCaCertificate": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subordinateConfig": { + "type": "SubordinateConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateCertificateAuthorityRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "certificateAuthorityId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "certificateAuthority": { + "type": "CertificateAuthority", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DisableCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EnableCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FetchCertificateAuthorityCsrRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + } + } + }, + "FetchCertificateAuthorityCsrResponse": { + "fields": { + "pemCsr": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + } + } + }, + "ListCertificateAuthoritiesRequest": { + "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" + } + } + } + }, + "ListCertificateAuthoritiesResponse": { + "fields": { + "certificateAuthorities": { + "rule": "repeated", + "type": "CertificateAuthority", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "RestoreCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ScheduleDeleteCertificateAuthorityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateCertificateAuthorityRequest": { + "fields": { + "certificateAuthority": { + "type": "CertificateAuthority", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetCertificateRevocationListRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateRevocationList" + } + } + } + }, + "ListCertificateRevocationListsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" + } + }, + "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" + } + } + } + }, + "ListCertificateRevocationListsResponse": { + "fields": { + "certificateRevocationLists": { + "rule": "repeated", + "type": "CertificateRevocationList", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateCertificateRevocationListRequest": { + "fields": { + "certificateRevocationList": { + "type": "CertificateRevocationList", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetReusableConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/ReusableConfig" + } + } + } + }, + "ListReusableConfigsRequest": { + "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" + } + } + } + }, + "ListReusableConfigsResponse": { + "fields": { + "reusableConfigs": { + "rule": "repeated", + "type": "ReusableConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "FieldInfoProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI" + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + }, + "referencedTypes": { + "rule": "repeated", + "type": "TypeReference", + "id": 2 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, + "TypeReference": { + "fields": { + "typeName": { + "type": "string", + "id": 1 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "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 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + }, + "reserved": [ + [ + 4, + 4 + ], + "stream" + ] + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + "php_generic_services", + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false, + "deprecated": true + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } + } + }, + "extensions": [ + [ + 1000, + 9994 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + }, + "reserved": [ + [ + 1, + 1 + ] + ] + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "overridableFeatures": { + "type": "FeatureSet", + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 + } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "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 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.activate_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.activate_certificate_authority.js new file mode 100644 index 000000000000..c20e501bbf3c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.activate_certificate_authority.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, pemCaCertificate, subordinateConfig) { + // [START privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + /** + * Required. The signed CA certificate issued from + * FetchCertificateAuthorityCsrResponse.pem_csr google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.pem_csr. + */ + // const pemCaCertificate = 'abc123' + /** + * Required. Must include information about the issuer of + * 'pem_ca_certificate', and any further issuers until the self-signed CA. + */ + // const subordinateConfig = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callActivateCertificateAuthority() { + // Construct request + const request = { + name, + pemCaCertificate, + subordinateConfig, + }; + + // Run request + const [operation] = await privatecaClient.activateCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callActivateCertificateAuthority(); + // [END privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_ca_pool.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_ca_pool.js new file mode 100644 index 000000000000..e84805c7c4fc --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_ca_pool.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, caPoolId, caPool) { + // [START privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location associated with the + * CaPool google.cloud.security.privateca.v1.CaPool, in the format + * `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + */ + // const caPoolId = 'abc123' + /** + * Required. A CaPool google.cloud.security.privateca.v1.CaPool with + * initial field values. + */ + // const caPool = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callCreateCaPool() { + // Construct request + const request = { + parent, + caPoolId, + caPool, + }; + + // Run request + const [operation] = await privatecaClient.createCaPool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCaPool(); + // [END privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate.js new file mode 100644 index 000000000000..1bf084d79f42 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate.js @@ -0,0 +1,126 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, certificate) { + // [START privateca_v1_generated_CertificateAuthorityService_CreateCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the + * CaPool google.cloud.security.privateca.v1.CaPool associated with the + * Certificate google.cloud.security.privateca.v1.Certificate, in the + * format `projects/* /locations/* /caPools/*`. + */ + // const parent = 'abc123' + /** + * Optional. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * in the Enterprise + * CertificateAuthority.tier google.cloud.security.privateca.v1.CertificateAuthority.tier, + * but is optional and its value is ignored otherwise. + */ + // const certificateId = 'abc123' + /** + * Required. A Certificate google.cloud.security.privateca.v1.Certificate + * with initial field values. + */ + // const certificate = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If this is true, no + * Certificate google.cloud.security.privateca.v1.Certificate resource will + * be persisted regardless of the + * CaPool google.cloud.security.privateca.v1.CaPool's + * tier google.cloud.security.privateca.v1.CaPool.tier, and the returned + * Certificate google.cloud.security.privateca.v1.Certificate will not + * contain the + * pem_certificate google.cloud.security.privateca.v1.Certificate.pem_certificate + * field. + */ + // const validateOnly = true + /** + * Optional. The resource ID of the + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * that should issue the certificate. This optional field will ignore the + * load-balancing scheme of the Pool and directly issue the certificate from + * the CA with the specified ID, contained in the same + * CaPool google.cloud.security.privateca.v1.CaPool referenced by `parent`. + * Per-CA quota rules apply. If left empty, a + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * will be chosen from the CaPool google.cloud.security.privateca.v1.CaPool + * by the service. For example, to issue a + * Certificate google.cloud.security.privateca.v1.Certificate from a + * Certificate Authority with resource name + * "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", + * you can set the + * parent google.cloud.security.privateca.v1.CreateCertificateRequest.parent + * to "projects/my-project/locations/us-central1/caPools/my-pool" and the + * issuing_certificate_authority_id google.cloud.security.privateca.v1.CreateCertificateRequest.issuing_certificate_authority_id + * to "my-ca". + */ + // const issuingCertificateAuthorityId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callCreateCertificate() { + // Construct request + const request = { + parent, + certificate, + }; + + // Run request + const response = await privatecaClient.createCertificate(request); + console.log(response); + } + + callCreateCertificate(); + // [END privateca_v1_generated_CertificateAuthorityService_CreateCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_authority.js new file mode 100644 index 000000000000..1b183d2ffaef --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_authority.js @@ -0,0 +1,92 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, certificateAuthorityId, certificateAuthority) { + // [START privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the + * CaPool google.cloud.security.privateca.v1.CaPool associated with the + * CertificateAuthorities google.cloud.security.privateca.v1.CertificateAuthority, + * in the format `projects/* /locations/* /caPools/*`. + */ + // const parent = 'abc123' + /** + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + */ + // const certificateAuthorityId = 'abc123' + /** + * Required. A + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * with initial field values. + */ + // const certificateAuthority = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callCreateCertificateAuthority() { + // Construct request + const request = { + parent, + certificateAuthorityId, + certificateAuthority, + }; + + // Run request + const [operation] = await privatecaClient.createCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCertificateAuthority(); + // [END privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_template.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_template.js new file mode 100644 index 000000000000..9eb57a8857c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_template.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, certificateTemplateId, certificateTemplate) { + // [START privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location associated with the + * CertificateTemplate google.cloud.security.privateca.v1.CertificateTemplate, + * in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + */ + // const certificateTemplateId = 'abc123' + /** + * Required. A + * CertificateTemplate google.cloud.security.privateca.v1.CertificateTemplate + * with initial field values. + */ + // const certificateTemplate = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callCreateCertificateTemplate() { + // Construct request + const request = { + parent, + certificateTemplateId, + certificateTemplate, + }; + + // Run request + const [operation] = await privatecaClient.createCertificateTemplate(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCertificateTemplate(); + // [END privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js new file mode 100644 index 000000000000..1190cecae76c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this + * CaPool google.cloud.security.privateca.v1.CaPool in the format + * `projects/* /locations/* /caPools/*`. + */ + // const name = 'abc123' + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. This field allows this pool to be deleted even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resources since the pool will + * no longer be able to issue certificates. + */ + // const ignoreDependentResources = true + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callDeleteCaPool() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await privatecaClient.deleteCaPool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCaPool(); + // [END privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js new file mode 100644 index 000000000000..3fe8c766541e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js @@ -0,0 +1,96 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. This field allows the CA to be deleted even if the CA has + * active certs. Active certs include both unrevoked and unexpired certs. + */ + // const ignoreActiveCertificates = true + /** + * Optional. If this flag is set, the Certificate Authority will be deleted as + * soon as possible without a 30-day grace period where undeletion would have + * been allowed. If you proceed, there will be no way to recover this CA. + */ + // const skipGracePeriod = true + /** + * Optional. This field allows this CA to be deleted even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resources since the CA will + * no longer be able to issue certificates. + */ + // const ignoreDependentResources = true + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callDeleteCertificateAuthority() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await privatecaClient.deleteCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCertificateAuthority(); + // [END privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_template.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_template.js new file mode 100644 index 000000000000..2722872082b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_template.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this + * CertificateTemplate google.cloud.security.privateca.v1.CertificateTemplate + * in the format `projects/* /locations/* /certificateTemplates/*`. + */ + // const name = 'abc123' + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callDeleteCertificateTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await privatecaClient.deleteCertificateTemplate(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCertificateTemplate(); + // [END privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js new file mode 100644 index 000000000000..69e3467fa95c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. This field allows this CA to be disabled even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resources since the CA will + * no longer be able to issue certificates. + */ + // const ignoreDependentResources = true + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callDisableCertificateAuthority() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await privatecaClient.disableCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDisableCertificateAuthority(); + // [END privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.enable_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.enable_certificate_authority.js new file mode 100644 index 000000000000..7840fe97c842 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.enable_certificate_authority.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callEnableCertificateAuthority() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await privatecaClient.enableCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callEnableCertificateAuthority(); + // [END privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_ca_certs.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_ca_certs.js new file mode 100644 index 000000000000..f9e9be0794ef --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_ca_certs.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(caPool) { + // [START privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for the + * CaPool google.cloud.security.privateca.v1.CaPool in the format + * `projects/* /locations/* /caPools/*`. + */ + // const caPool = 'abc123' + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callFetchCaCerts() { + // Construct request + const request = { + caPool, + }; + + // Run request + const response = await privatecaClient.fetchCaCerts(request); + console.log(response); + } + + callFetchCaCerts(); + // [END privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js new file mode 100644 index 000000000000..3952fa029afb --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callFetchCertificateAuthorityCsr() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await privatecaClient.fetchCertificateAuthorityCsr(request); + console.log(response); + } + + callFetchCertificateAuthorityCsr(); + // [END privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_ca_pool.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_ca_pool.js new file mode 100644 index 000000000000..77b37b793f07 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_ca_pool.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_GetCaPool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name google.cloud.security.privateca.v1.CaPool.name of the + * CaPool google.cloud.security.privateca.v1.CaPool to get. + */ + // const name = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callGetCaPool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await privatecaClient.getCaPool(request); + console.log(response); + } + + callGetCaPool(); + // [END privateca_v1_generated_CertificateAuthorityService_GetCaPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate.js new file mode 100644 index 000000000000..5884ff290df6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_GetCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name google.cloud.security.privateca.v1.Certificate.name + * of the Certificate google.cloud.security.privateca.v1.Certificate to + * get. + */ + // const name = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callGetCertificate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await privatecaClient.getCertificate(request); + console.log(response); + } + + callGetCertificate(); + // [END privateca_v1_generated_CertificateAuthorityService_GetCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_authority.js new file mode 100644 index 000000000000..c98bb1edbb86 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_authority.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The + * name google.cloud.security.privateca.v1.CertificateAuthority.name of the + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * to get. + */ + // const name = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callGetCertificateAuthority() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await privatecaClient.getCertificateAuthority(request); + console.log(response); + } + + callGetCertificateAuthority(); + // [END privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js new file mode 100644 index 000000000000..ac84979168dc --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The + * name google.cloud.security.privateca.v1.CertificateRevocationList.name + * of the + * CertificateRevocationList google.cloud.security.privateca.v1.CertificateRevocationList + * to get. + */ + // const name = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callGetCertificateRevocationList() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await privatecaClient.getCertificateRevocationList(request); + console.log(response); + } + + callGetCertificateRevocationList(); + // [END privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_template.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_template.js new file mode 100644 index 000000000000..eed47b46b481 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_template.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The + * name google.cloud.security.privateca.v1.CertificateTemplate.name of the + * CertificateTemplate google.cloud.security.privateca.v1.CertificateTemplate + * to get. + */ + // const name = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callGetCertificateTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await privatecaClient.getCertificateTemplate(request); + console.log(response); + } + + callGetCertificateTemplate(); + // [END privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_ca_pools.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_ca_pools.js new file mode 100644 index 000000000000..c2e2deae554c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_ca_pools.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START privateca_v1_generated_CertificateAuthorityService_ListCaPools_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location associated with the + * CaPools google.cloud.security.privateca.v1.CaPool, in the format + * `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Optional. Limit on the number of + * CaPools google.cloud.security.privateca.v1.CaPool to include in the + * response. Further CaPools google.cloud.security.privateca.v1.CaPool can + * subsequently be obtained by including the + * ListCaPoolsResponse.next_page_token google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListCaPoolsResponse.next_page_token google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token. + */ + // const pageToken = 'abc123' + /** + * Optional. Only include resources that match the filter in the response. + */ + // const filter = 'abc123' + /** + * Optional. Specify how the results should be sorted. + */ + // const orderBy = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callListCaPools() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = privatecaClient.listCaPoolsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCaPools(); + // [END privateca_v1_generated_CertificateAuthorityService_ListCaPools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_authorities.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_authorities.js new file mode 100644 index 000000000000..e23e6e89aa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_authorities.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the + * CaPool google.cloud.security.privateca.v1.CaPool associated with the + * CertificateAuthorities google.cloud.security.privateca.v1.CertificateAuthority, + * in the format `projects/* /locations/* /caPools/*`. + */ + // const parent = 'abc123' + /** + * Optional. Limit on the number of + * CertificateAuthorities google.cloud.security.privateca.v1.CertificateAuthority + * to include in the response. Further + * CertificateAuthorities google.cloud.security.privateca.v1.CertificateAuthority + * can subsequently be obtained by including the + * ListCertificateAuthoritiesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListCertificateAuthoritiesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token. + */ + // const pageToken = 'abc123' + /** + * Optional. Only include resources that match the filter in the response. + */ + // const filter = 'abc123' + /** + * Optional. Specify how the results should be sorted. + */ + // const orderBy = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callListCertificateAuthorities() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = privatecaClient.listCertificateAuthoritiesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificateAuthorities(); + // [END privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js new file mode 100644 index 000000000000..978fd39b8f48 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location associated with the + * CertificateRevocationLists google.cloud.security.privateca.v1.CertificateRevocationList, + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + */ + // const parent = 'abc123' + /** + * Optional. Limit on the number of + * CertificateRevocationLists google.cloud.security.privateca.v1.CertificateRevocationList + * to include in the response. Further + * CertificateRevocationLists google.cloud.security.privateca.v1.CertificateRevocationList + * can subsequently be obtained by including the + * ListCertificateRevocationListsResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListCertificateRevocationListsResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token. + */ + // const pageToken = 'abc123' + /** + * Optional. Only include resources that match the filter in the response. + */ + // const filter = 'abc123' + /** + * Optional. Specify how the results should be sorted. + */ + // const orderBy = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callListCertificateRevocationLists() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = privatecaClient.listCertificateRevocationListsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificateRevocationLists(); + // [END privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_templates.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_templates.js new file mode 100644 index 000000000000..40b45810635b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_templates.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location associated with the + * CertificateTemplates google.cloud.security.privateca.v1.CertificateTemplate, + * in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Optional. Limit on the number of + * CertificateTemplates google.cloud.security.privateca.v1.CertificateTemplate + * to include in the response. Further + * CertificateTemplates google.cloud.security.privateca.v1.CertificateTemplate + * can subsequently be obtained by including the + * ListCertificateTemplatesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListCertificateTemplatesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token. + */ + // const pageToken = 'abc123' + /** + * Optional. Only include resources that match the filter in the response. + */ + // const filter = 'abc123' + /** + * Optional. Specify how the results should be sorted. + */ + // const orderBy = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callListCertificateTemplates() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = privatecaClient.listCertificateTemplatesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificateTemplates(); + // [END privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js new file mode 100644 index 000000000000..fa81a8eb69e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js @@ -0,0 +1,100 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START privateca_v1_generated_CertificateAuthorityService_ListCertificates_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent associated with the + * Certificates google.cloud.security.privateca.v1.Certificate, in the + * format `projects/* /locations/* /caPools/*`. The parent resource name can be + * in one of two forms: + * 1. **Specific CA Pool:** To list certificates within a single CA Pool: + * `projects/* /locations/* /caPools/*` + * 2. **All CA Pools in a Location:** To list certificates across *all* CA + * Pools in a given project and location, use the wildcard character (`-`) + * in place of the CA Pool ID. + * Example: `projects/* /locations/* /caPools/-` + */ + // const parent = 'abc123' + /** + * Optional. Limit on the number of + * Certificates google.cloud.security.privateca.v1.Certificate to include + * in the response. Further + * Certificates google.cloud.security.privateca.v1.Certificate can + * subsequently be obtained by including the + * ListCertificatesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListCertificatesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token. + */ + // const pageToken = 'abc123' + /** + * Optional. Only include resources that match the filter in the response. For + * details on supported filters and syntax, see Certificates Filtering + * documentation (https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + */ + // const filter = 'abc123' + /** + * Optional. Specify how the results should be sorted. For details on + * supported fields and syntax, see Certificates Sorting + * documentation (https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + */ + // const orderBy = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callListCertificates() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = privatecaClient.listCertificatesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificates(); + // [END privateca_v1_generated_CertificateAuthorityService_ListCertificates_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.revoke_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.revoke_certificate.js new file mode 100644 index 000000000000..2871b5a377ef --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.revoke_certificate.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, reason) { + // [START privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this + * Certificate google.cloud.security.privateca.v1.Certificate in the format + * `projects/* /locations/* /caPools/* /certificates/*`. + */ + // const name = 'abc123' + /** + * Required. The + * RevocationReason google.cloud.security.privateca.v1.RevocationReason for + * revoking this certificate. + */ + // const reason = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callRevokeCertificate() { + // Construct request + const request = { + name, + reason, + }; + + // Run request + const response = await privatecaClient.revokeCertificate(request); + console.log(response); + } + + callRevokeCertificate(); + // [END privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js new file mode 100644 index 000000000000..efd6976370b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callUndeleteCertificateAuthority() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await privatecaClient.undeleteCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeleteCertificateAuthority(); + // [END privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_ca_pool.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_ca_pool.js new file mode 100644 index 000000000000..daadb6a77a6b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_ca_pool.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(caPool, updateMask) { + // [START privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. CaPool google.cloud.security.privateca.v1.CaPool with updated + * values. + */ + // const caPool = {} + /** + * Required. A list of fields to be updated in this request. + */ + // const updateMask = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callUpdateCaPool() { + // Construct request + const request = { + caPool, + updateMask, + }; + + // Run request + const [operation] = await privatecaClient.updateCaPool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCaPool(); + // [END privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate.js new file mode 100644 index 000000000000..b54efba3a47c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(certificate, updateMask) { + // [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Certificate google.cloud.security.privateca.v1.Certificate + * with updated values. + */ + // const certificate = {} + /** + * Required. A list of fields to be updated in this request. + */ + // const updateMask = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callUpdateCertificate() { + // Construct request + const request = { + certificate, + updateMask, + }; + + // Run request + const response = await privatecaClient.updateCertificate(request); + console.log(response); + } + + callUpdateCertificate(); + // [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_authority.js new file mode 100644 index 000000000000..8262a182f25e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_authority.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(certificateAuthority, updateMask) { + // [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. + * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority + * with updated values. + */ + // const certificateAuthority = {} + /** + * Required. A list of fields to be updated in this request. + */ + // const updateMask = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callUpdateCertificateAuthority() { + // Construct request + const request = { + certificateAuthority, + updateMask, + }; + + // Run request + const [operation] = await privatecaClient.updateCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCertificateAuthority(); + // [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js new file mode 100644 index 000000000000..9a2ab753c2a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(certificateRevocationList, updateMask) { + // [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. + * CertificateRevocationList google.cloud.security.privateca.v1.CertificateRevocationList + * with updated values. + */ + // const certificateRevocationList = {} + /** + * Required. A list of fields to be updated in this request. + */ + // const updateMask = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callUpdateCertificateRevocationList() { + // Construct request + const request = { + certificateRevocationList, + updateMask, + }; + + // Run request + const [operation] = await privatecaClient.updateCertificateRevocationList(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCertificateRevocationList(); + // [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_template.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_template.js new file mode 100644 index 000000000000..90683dc23091 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_template.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(certificateTemplate, updateMask) { + // [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. + * CertificateTemplate google.cloud.security.privateca.v1.CertificateTemplate + * with updated values. + */ + // const certificateTemplate = {} + /** + * Required. A list of fields to be updated in this request. + */ + // const updateMask = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callUpdateCertificateTemplate() { + // Construct request + const request = { + certificateTemplate, + updateMask, + }; + + // Run request + const [operation] = await privatecaClient.updateCertificateTemplate(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCertificateTemplate(); + // [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json new file mode 100644 index 000000000000..72d7dcb4ed20 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json @@ -0,0 +1,1419 @@ +{ + "clientLibrary": { + "name": "nodejs-privateca", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.security.privateca.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificate_async", + "title": "CertificateAuthorityService createCertificate Sample", + "origin": "API_DEFINITION", + "description": " Create a new [Certificate][google.cloud.security.privateca.v1.Certificate] in a given Project, Location from a particular [CaPool][google.cloud.security.privateca.v1.CaPool].", + "canonical": true, + "file": "certificate_authority_service.create_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 118, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCertificate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "certificate_id", + "type": "TYPE_STRING" + }, + { + "name": "certificate", + "type": ".google.cloud.security.privateca.v1.Certificate" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "issuing_certificate_authority_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.Certificate", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "CreateCertificate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_GetCertificate_async", + "title": "CertificateAuthorityService getCertificate Sample", + "origin": "API_DEFINITION", + "description": " Returns a [Certificate][google.cloud.security.privateca.v1.Certificate].", + "canonical": true, + "file": "certificate_authority_service.get_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCertificate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.Certificate", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "GetCertificate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_ListCertificates_async", + "title": "CertificateAuthorityService listCertificates Sample", + "origin": "API_DEFINITION", + "description": " Lists [Certificates][google.cloud.security.privateca.v1.Certificate].", + "canonical": true, + "file": "certificate_authority_service.list_certificates.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCertificates", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.ListCertificatesResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ListCertificates", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_async", + "title": "CertificateAuthorityService revokeCertificate Sample", + "origin": "API_DEFINITION", + "description": " Revoke a [Certificate][google.cloud.security.privateca.v1.Certificate].", + "canonical": true, + "file": "certificate_authority_service.revoke_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RevokeCertificate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "reason", + "type": ".google.cloud.security.privateca.v1.RevocationReason" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.Certificate", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "RevokeCertificate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_async", + "title": "CertificateAuthorityService updateCertificate Sample", + "origin": "API_DEFINITION", + "description": " Update a [Certificate][google.cloud.security.privateca.v1.Certificate]. Currently, the only field you can update is the [labels][google.cloud.security.privateca.v1.Certificate.labels] field.", + "canonical": true, + "file": "certificate_authority_service.update_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCertificate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificate", + "async": true, + "parameters": [ + { + "name": "certificate", + "type": ".google.cloud.security.privateca.v1.Certificate" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.Certificate", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "UpdateCertificate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async", + "title": "CertificateAuthorityService activateCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Activate a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] that is in state [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] and is of type [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. After the parent Certificate Authority signs a certificate signing request from [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr], this method can complete the activation process.", + "canonical": true, + "file": "certificate_authority_service.activate_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ActivateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "pem_ca_certificate", + "type": "TYPE_STRING" + }, + { + "name": "subordinate_config", + "type": ".google.cloud.security.privateca.v1.SubordinateConfig" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ActivateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async", + "title": "CertificateAuthorityService createCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Create a new [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] in a given Project and Location.", + "canonical": true, + "file": "certificate_authority_service.create_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "certificate_authority_id", + "type": "TYPE_STRING" + }, + { + "name": "certificate_authority", + "type": ".google.cloud.security.privateca.v1.CertificateAuthority" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "CreateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async", + "title": "CertificateAuthorityService disableCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Disable a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.disable_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DisableCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "ignore_dependent_resources", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "DisableCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async", + "title": "CertificateAuthorityService enableCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Enable a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.enable_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnableCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "EnableCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async", + "title": "CertificateAuthorityService fetchCertificateAuthorityCsr Sample", + "origin": "API_DEFINITION", + "description": " Fetch a certificate signing request (CSR) from a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] that is in state [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] and is of type [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. The CSR must then be signed by the desired parent Certificate Authority, which could be another [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] resource, or could be an on-prem certificate authority. See also [ActivateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.fetch_certificate_authority_csr.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchCertificateAuthorityCsr", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "FetchCertificateAuthorityCsr", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_async", + "title": "CertificateAuthorityService getCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Returns a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.get_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.CertificateAuthority", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "GetCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_async", + "title": "CertificateAuthorityService listCertificateAuthorities Sample", + "origin": "API_DEFINITION", + "description": " Lists [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.list_certificate_authorities.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCertificateAuthorities", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ListCertificateAuthorities", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async", + "title": "CertificateAuthorityService undeleteCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Undelete a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] that has been deleted.", + "canonical": true, + "file": "certificate_authority_service.undelete_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeleteCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "UndeleteCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async", + "title": "CertificateAuthorityService deleteCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Delete a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.delete_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 88, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "ignore_active_certificates", + "type": "TYPE_BOOL" + }, + { + "name": "skip_grace_period", + "type": "TYPE_BOOL" + }, + { + "name": "ignore_dependent_resources", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "DeleteCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async", + "title": "CertificateAuthorityService updateCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Update a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.update_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "certificate_authority", + "type": ".google.cloud.security.privateca.v1.CertificateAuthority" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "UpdateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async", + "title": "CertificateAuthorityService createCaPool Sample", + "origin": "API_DEFINITION", + "description": " Create a [CaPool][google.cloud.security.privateca.v1.CaPool].", + "canonical": true, + "file": "certificate_authority_service.create_ca_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCaPool", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPool", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "ca_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "ca_pool", + "type": ".google.cloud.security.privateca.v1.CaPool" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "CreateCaPool", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPool", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async", + "title": "CertificateAuthorityService updateCaPool Sample", + "origin": "API_DEFINITION", + "description": " Update a [CaPool][google.cloud.security.privateca.v1.CaPool].", + "canonical": true, + "file": "certificate_authority_service.update_ca_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCaPool", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPool", + "async": true, + "parameters": [ + { + "name": "ca_pool", + "type": ".google.cloud.security.privateca.v1.CaPool" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "UpdateCaPool", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPool", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_GetCaPool_async", + "title": "CertificateAuthorityService getCaPool Sample", + "origin": "API_DEFINITION", + "description": " Returns a [CaPool][google.cloud.security.privateca.v1.CaPool].", + "canonical": true, + "file": "certificate_authority_service.get_ca_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCaPool", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.CaPool", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "GetCaPool", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPool", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_ListCaPools_async", + "title": "CertificateAuthorityService listCaPools Sample", + "origin": "API_DEFINITION", + "description": " Lists [CaPools][google.cloud.security.privateca.v1.CaPool].", + "canonical": true, + "file": "certificate_authority_service.list_ca_pools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCaPools", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.ListCaPoolsResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ListCaPools", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async", + "title": "CertificateAuthorityService deleteCaPool Sample", + "origin": "API_DEFINITION", + "description": " Delete a [CaPool][google.cloud.security.privateca.v1.CaPool].", + "canonical": true, + "file": "certificate_authority_service.delete_ca_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCaPool", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "ignore_dependent_resources", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "DeleteCaPool", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPool", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_async", + "title": "CertificateAuthorityService fetchCaCerts Sample", + "origin": "API_DEFINITION", + "description": " FetchCaCerts returns the current trust anchor for the [CaPool][google.cloud.security.privateca.v1.CaPool]. This will include CA certificate chains for all certificate authorities in the ENABLED, DISABLED, or STAGED states.", + "canonical": true, + "file": "certificate_authority_service.fetch_ca_certs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchCaCerts", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts", + "async": true, + "parameters": [ + { + "name": "ca_pool", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.FetchCaCertsResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "FetchCaCerts", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_async", + "title": "CertificateAuthorityService getCertificateRevocationList Sample", + "origin": "API_DEFINITION", + "description": " Returns a [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList].", + "canonical": true, + "file": "certificate_authority_service.get_certificate_revocation_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCertificateRevocationList", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationList", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.CertificateRevocationList", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "GetCertificateRevocationList", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationList", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async", + "title": "CertificateAuthorityService listCertificateRevocationLists Sample", + "origin": "API_DEFINITION", + "description": " Lists [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList].", + "canonical": true, + "file": "certificate_authority_service.list_certificate_revocation_lists.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCertificateRevocationLists", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ListCertificateRevocationLists", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async", + "title": "CertificateAuthorityService updateCertificateRevocationList Sample", + "origin": "API_DEFINITION", + "description": " Update a [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList].", + "canonical": true, + "file": "certificate_authority_service.update_certificate_revocation_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCertificateRevocationList", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationList", + "async": true, + "parameters": [ + { + "name": "certificate_revocation_list", + "type": ".google.cloud.security.privateca.v1.CertificateRevocationList" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "UpdateCertificateRevocationList", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationList", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async", + "title": "CertificateAuthorityService createCertificateTemplate Sample", + "origin": "API_DEFINITION", + "description": " Create a new [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] in a given Project and Location.", + "canonical": true, + "file": "certificate_authority_service.create_certificate_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCertificateTemplate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "certificate_template_id", + "type": "TYPE_STRING" + }, + { + "name": "certificate_template", + "type": ".google.cloud.security.privateca.v1.CertificateTemplate" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "CreateCertificateTemplate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async", + "title": "CertificateAuthorityService deleteCertificateTemplate Sample", + "origin": "API_DEFINITION", + "description": " DeleteCertificateTemplate deletes a [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate].", + "canonical": true, + "file": "certificate_authority_service.delete_certificate_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCertificateTemplate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "DeleteCertificateTemplate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_async", + "title": "CertificateAuthorityService getCertificateTemplate Sample", + "origin": "API_DEFINITION", + "description": " Returns a [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate].", + "canonical": true, + "file": "certificate_authority_service.get_certificate_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCertificateTemplate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.CertificateTemplate", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "GetCertificateTemplate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_async", + "title": "CertificateAuthorityService listCertificateTemplates Sample", + "origin": "API_DEFINITION", + "description": " Lists [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate].", + "canonical": true, + "file": "certificate_authority_service.list_certificate_templates.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCertificateTemplates", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1.ListCertificateTemplatesResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ListCertificateTemplates", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async", + "title": "CertificateAuthorityService updateCertificateTemplate Sample", + "origin": "API_DEFINITION", + "description": " Update a [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate].", + "canonical": true, + "file": "certificate_authority_service.update_certificate_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCertificateTemplate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplate", + "async": true, + "parameters": [ + { + "name": "certificate_template", + "type": ".google.cloud.security.privateca.v1.CertificateTemplate" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "UpdateCertificateTemplate", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js new file mode 100644 index 000000000000..480e775882df --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, pemCaCertificate, subordinateConfig) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the + * format `projects/* /locations/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + /** + * Required. The signed CA certificate issued from + * FetchCertificateAuthorityCsrResponse.pem_csr google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.pem_csr. + */ + // const pemCaCertificate = 'abc123' + /** + * Required. Must include information about the issuer of 'pem_ca_certificate', and any + * further issuers until the self-signed CA. + */ + // const subordinateConfig = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callActivateCertificateAuthority() { + // Construct request + const request = { + name, + pemCaCertificate, + subordinateConfig, + }; + + // Run request + const [operation] = await privatecaClient.activateCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callActivateCertificateAuthority(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate.js new file mode 100644 index 000000000000..73d3825b24c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, certificate) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location and CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority + * associated with the Certificate google.cloud.security.privateca.v1beta1.Certificate, in the format + * `projects/* /locations/* /certificateAuthorities/*`. + */ + // const parent = 'abc123' + /** + * Optional. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + * CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the Enterprise CertificateAuthority.Tier google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier, + * but is optional and its value is ignored otherwise. + */ + // const certificateId = 'abc123' + /** + * Required. A Certificate google.cloud.security.privateca.v1beta1.Certificate with initial field values. + */ + // const certificate = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callCreateCertificate() { + // Construct request + const request = { + parent, + certificate, + }; + + // Run request + const response = await privatecaClient.createCertificate(request); + console.log(response); + } + + callCreateCertificate(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js new file mode 100644 index 000000000000..2aa8f4788225 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, certificateAuthorityId, certificateAuthority) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location associated with the + * CertificateAuthorities google.cloud.security.privateca.v1beta1.CertificateAuthority, in the format + * `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + */ + // const certificateAuthorityId = 'abc123' + /** + * Required. A CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority with initial field values. + */ + // const certificateAuthority = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callCreateCertificateAuthority() { + // Construct request + const request = { + parent, + certificateAuthorityId, + certificateAuthority, + }; + + // Run request + const [operation] = await privatecaClient.createCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCertificateAuthority(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js new file mode 100644 index 000000000000..8af3dc53872e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the + * format `projects/* /locations/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + /** + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callDisableCertificateAuthority() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await privatecaClient.disableCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDisableCertificateAuthority(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js new file mode 100644 index 000000000000..650b0ac7675b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the + * format `projects/* /locations/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + /** + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callEnableCertificateAuthority() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await privatecaClient.enableCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callEnableCertificateAuthority(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js new file mode 100644 index 000000000000..a4a1b46fc184 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the + * format `projects/* /locations/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callFetchCertificateAuthorityCsr() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await privatecaClient.fetchCertificateAuthorityCsr(request); + console.log(response); + } + + callFetchCertificateAuthorityCsr(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate.js new file mode 100644 index 000000000000..82970a185a1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name google.cloud.security.privateca.v1beta1.Certificate.name of the Certificate google.cloud.security.privateca.v1beta1.Certificate to get. + */ + // const name = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callGetCertificate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await privatecaClient.getCertificate(request); + console.log(response); + } + + callGetCertificate(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js new file mode 100644 index 000000000000..9b8c68276bac --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name google.cloud.security.privateca.v1beta1.CertificateAuthority.name of the CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority to + * get. + */ + // const name = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callGetCertificateAuthority() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await privatecaClient.getCertificateAuthority(request); + console.log(response); + } + + callGetCertificateAuthority(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js new file mode 100644 index 000000000000..a96e6c2cd685 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name google.cloud.security.privateca.v1beta1.CertificateRevocationList.name of the + * CertificateRevocationList google.cloud.security.privateca.v1beta1.CertificateRevocationList to get. + */ + // const name = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callGetCertificateRevocationList() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await privatecaClient.getCertificateRevocationList(request); + console.log(response); + } + + callGetCertificateRevocationList(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js new file mode 100644 index 000000000000..38f003d620f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name ReusableConfigs.name of the ReusableConfigs to get. + */ + // const name = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callGetReusableConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await privatecaClient.getReusableConfig(request); + console.log(response); + } + + callGetReusableConfig(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js new file mode 100644 index 000000000000..470f984314b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js @@ -0,0 +1,87 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location associated with the + * CertificateAuthorities google.cloud.security.privateca.v1beta1.CertificateAuthority, in the format + * `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Optional. Limit on the number of CertificateAuthorities google.cloud.security.privateca.v1beta1.CertificateAuthority to + * include in the response. + * Further CertificateAuthorities google.cloud.security.privateca.v1beta1.CertificateAuthority can subsequently be + * obtained by including the + * ListCertificateAuthoritiesResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token in a subsequent + * request. If unspecified, the server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListCertificateAuthoritiesResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token. + */ + // const pageToken = 'abc123' + /** + * Optional. Only include resources that match the filter in the response. + */ + // const filter = 'abc123' + /** + * Optional. Specify how the results should be sorted. + */ + // const orderBy = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callListCertificateAuthorities() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = privatecaClient.listCertificateAuthoritiesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificateAuthorities(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js new file mode 100644 index 000000000000..fd477477d992 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js @@ -0,0 +1,87 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location associated with the + * CertificateRevocationLists google.cloud.security.privateca.v1beta1.CertificateRevocationList, in the format + * `projects/* /locations/* /certificateauthorities/*`. + */ + // const parent = 'abc123' + /** + * Optional. Limit on the number of + * CertificateRevocationLists google.cloud.security.privateca.v1beta1.CertificateRevocationList to include in the + * response. Further CertificateRevocationLists google.cloud.security.privateca.v1beta1.CertificateRevocationList + * can subsequently be obtained by including the + * ListCertificateRevocationListsResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token in a subsequent + * request. If unspecified, the server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListCertificateRevocationListsResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token. + */ + // const pageToken = 'abc123' + /** + * Optional. Only include resources that match the filter in the response. + */ + // const filter = 'abc123' + /** + * Optional. Specify how the results should be sorted. + */ + // const orderBy = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callListCertificateRevocationLists() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = privatecaClient.listCertificateRevocationListsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificateRevocationLists(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificates.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificates.js new file mode 100644 index 000000000000..d1fef2ca4a75 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificates.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location associated with the + * Certificates google.cloud.security.privateca.v1beta1.Certificate, in the format + * `projects/* /locations/* /certificateauthorities/*`. + */ + // const parent = 'abc123' + /** + * Optional. Limit on the number of + * Certificates google.cloud.security.privateca.v1beta1.Certificate to include in the + * response. Further Certificates google.cloud.security.privateca.v1beta1.Certificate can subsequently be obtained + * by including the + * ListCertificatesResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token in a subsequent + * request. If unspecified, the server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListCertificatesResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token. + */ + // const pageToken = 'abc123' + /** + * Optional. Only include resources that match the filter in the response. For details + * on supported filters and syntax, see Certificates Filtering + * documentation (https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + */ + // const filter = 'abc123' + /** + * Optional. Specify how the results should be sorted. For details on supported fields + * and syntax, see Certificates Sorting + * documentation (https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + */ + // const orderBy = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callListCertificates() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = privatecaClient.listCertificatesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificates(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js new file mode 100644 index 000000000000..fe28df6d9462 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js @@ -0,0 +1,87 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location associated with the + * ReusableConfigs google.cloud.security.privateca.v1beta1.ReusableConfig, in the format + * `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Optional. Limit on the number of + * ReusableConfigs google.cloud.security.privateca.v1beta1.ReusableConfig to include in the response. + * Further ReusableConfigs google.cloud.security.privateca.v1beta1.ReusableConfig can subsequently be + * obtained by including the + * ListReusableConfigsResponse.next_page_token google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token in a subsequent request. If + * unspecified, the server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListReusableConfigsResponse.next_page_token google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token. + */ + // const pageToken = 'abc123' + /** + * Optional. Only include resources that match the filter in the response. + */ + // const filter = 'abc123' + /** + * Optional. Specify how the results should be sorted. + */ + // const orderBy = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callListReusableConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = privatecaClient.listReusableConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListReusableConfigs(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js new file mode 100644 index 000000000000..2e86eae1d391 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the + * format `projects/* /locations/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + /** + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callRestoreCertificateAuthority() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await privatecaClient.restoreCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreCertificateAuthority(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js new file mode 100644 index 000000000000..01a5d03ca217 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, reason) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this Certificate google.cloud.security.privateca.v1beta1.Certificate in the + * format `projects/* /locations/* /certificateAuthorities/* /certificates/*`. + */ + // const name = 'abc123' + /** + * Required. The RevocationReason google.cloud.security.privateca.v1beta1.RevocationReason for revoking this certificate. + */ + // const reason = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callRevokeCertificate() { + // Construct request + const request = { + name, + reason, + }; + + // Run request + const response = await privatecaClient.revokeCertificate(request); + console.log(response); + } + + callRevokeCertificate(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js new file mode 100644 index 000000000000..6aa90aeaaf96 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the + * format `projects/* /locations/* /certificateAuthorities/*`. + */ + // const name = 'abc123' + /** + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callScheduleDeleteCertificateAuthority() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await privatecaClient.scheduleDeleteCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callScheduleDeleteCertificateAuthority(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate.js new file mode 100644 index 000000000000..17571312bf34 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(certificate, updateMask) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Certificate google.cloud.security.privateca.v1beta1.Certificate with updated values. + */ + // const certificate = {} + /** + * Required. A list of fields to be updated in this request. + */ + // const updateMask = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callUpdateCertificate() { + // Construct request + const request = { + certificate, + updateMask, + }; + + // Run request + const response = await privatecaClient.updateCertificate(request); + console.log(response); + } + + callUpdateCertificate(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js new file mode 100644 index 000000000000..3ad76629a601 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(certificateAuthority, updateMask) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority with updated values. + */ + // const certificateAuthority = {} + /** + * Required. A list of fields to be updated in this request. + */ + // const updateMask = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callUpdateCertificateAuthority() { + // Construct request + const request = { + certificateAuthority, + updateMask, + }; + + // Run request + const [operation] = await privatecaClient.updateCertificateAuthority(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCertificateAuthority(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js new file mode 100644 index 000000000000..cc7ccfc1c711 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(certificateRevocationList, updateMask) { + // [START privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. CertificateRevocationList google.cloud.security.privateca.v1beta1.CertificateRevocationList with updated values. + */ + // const certificateRevocationList = {} + /** + * Required. A list of fields to be updated in this request. + */ + // const updateMask = {} + /** + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Privateca library + const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; + + // Instantiates a client + const privatecaClient = new CertificateAuthorityServiceClient(); + + async function callUpdateCertificateRevocationList() { + // Construct request + const request = { + certificateRevocationList, + updateMask, + }; + + // Run request + const [operation] = await privatecaClient.updateCertificateRevocationList(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCertificateRevocationList(); + // [END privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata_google.cloud.security.privateca.v1beta1.json b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata_google.cloud.security.privateca.v1beta1.json new file mode 100644 index 000000000000..de0c1f8e8433 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata_google.cloud.security.privateca.v1beta1.json @@ -0,0 +1,963 @@ +{ + "clientLibrary": { + "name": "nodejs-privateca", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.security.privateca.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_async", + "title": "CertificateAuthorityService createCertificate Sample", + "origin": "API_DEFINITION", + "description": " Create a new [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in a given Project, Location from a particular [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.create_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCertificate", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "certificate_id", + "type": "TYPE_STRING" + }, + { + "name": "certificate", + "type": ".google.cloud.security.privateca.v1beta1.Certificate" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.Certificate", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "CreateCertificate", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_async", + "title": "CertificateAuthorityService getCertificate Sample", + "origin": "API_DEFINITION", + "description": " Returns a [Certificate][google.cloud.security.privateca.v1beta1.Certificate].", + "canonical": true, + "file": "certificate_authority_service.get_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCertificate", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.Certificate", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "GetCertificate", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_async", + "title": "CertificateAuthorityService listCertificates Sample", + "origin": "API_DEFINITION", + "description": " Lists [Certificates][google.cloud.security.privateca.v1beta1.Certificate].", + "canonical": true, + "file": "certificate_authority_service.list_certificates.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCertificates", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificates", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.ListCertificatesResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ListCertificates", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificates", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_async", + "title": "CertificateAuthorityService revokeCertificate Sample", + "origin": "API_DEFINITION", + "description": " Revoke a [Certificate][google.cloud.security.privateca.v1beta1.Certificate].", + "canonical": true, + "file": "certificate_authority_service.revoke_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RevokeCertificate", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "reason", + "type": ".google.cloud.security.privateca.v1beta1.RevocationReason" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.Certificate", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "RevokeCertificate", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_async", + "title": "CertificateAuthorityService updateCertificate Sample", + "origin": "API_DEFINITION", + "description": " Update a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. Currently, the only field you can update is the [labels][google.cloud.security.privateca.v1beta1.Certificate.labels] field.", + "canonical": true, + "file": "certificate_authority_service.update_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCertificate", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificate", + "async": true, + "parameters": [ + { + "name": "certificate", + "type": ".google.cloud.security.privateca.v1beta1.Certificate" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.Certificate", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "UpdateCertificate", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificate", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async", + "title": "CertificateAuthorityService activateCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Activate a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is in state [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. After the parent Certificate Authority signs a certificate signing request from [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr], this method can complete the activation process.", + "canonical": true, + "file": "certificate_authority_service.activate_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ActivateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "pem_ca_certificate", + "type": "TYPE_STRING" + }, + { + "name": "subordinate_config", + "type": ".google.cloud.security.privateca.v1beta1.SubordinateConfig" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ActivateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_async", + "title": "CertificateAuthorityService createCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Create a new [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in a given Project and Location.", + "canonical": true, + "file": "certificate_authority_service.create_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "certificate_authority_id", + "type": "TYPE_STRING" + }, + { + "name": "certificate_authority", + "type": ".google.cloud.security.privateca.v1beta1.CertificateAuthority" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "CreateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_async", + "title": "CertificateAuthorityService disableCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Disable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.disable_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DisableCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "DisableCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_async", + "title": "CertificateAuthorityService enableCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Enable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.enable_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnableCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "EnableCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async", + "title": "CertificateAuthorityService fetchCertificateAuthorityCsr Sample", + "origin": "API_DEFINITION", + "description": " Fetch a certificate signing request (CSR) from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is in state [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. The CSR must then be signed by the desired parent Certificate Authority, which could be another [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] resource, or could be an on-prem certificate authority. See also [ActivateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.fetch_certificate_authority_csr.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchCertificateAuthorityCsr", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "FetchCertificateAuthorityCsr", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_async", + "title": "CertificateAuthorityService getCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Returns a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.get_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.CertificateAuthority", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "GetCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_async", + "title": "CertificateAuthorityService listCertificateAuthorities Sample", + "origin": "API_DEFINITION", + "description": " Lists [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.list_certificate_authorities.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCertificateAuthorities", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthorities", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ListCertificateAuthorities", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthorities", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_async", + "title": "CertificateAuthorityService restoreCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Restore a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is scheduled for deletion.", + "canonical": true, + "file": "certificate_authority_service.restore_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "RestoreCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_async", + "title": "CertificateAuthorityService scheduleDeleteCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Schedule a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] for deletion.", + "canonical": true, + "file": "certificate_authority_service.schedule_delete_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ScheduleDeleteCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ScheduleDeleteCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async", + "title": "CertificateAuthorityService updateCertificateAuthority Sample", + "origin": "API_DEFINITION", + "description": " Update a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].", + "canonical": true, + "file": "certificate_authority_service.update_certificate_authority.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthority", + "async": true, + "parameters": [ + { + "name": "certificate_authority", + "type": ".google.cloud.security.privateca.v1beta1.CertificateAuthority" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "UpdateCertificateAuthority", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthority", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_async", + "title": "CertificateAuthorityService getCertificateRevocationList Sample", + "origin": "API_DEFINITION", + "description": " Returns a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList].", + "canonical": true, + "file": "certificate_authority_service.get_certificate_revocation_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCertificateRevocationList", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationList", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.CertificateRevocationList", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "GetCertificateRevocationList", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationList", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async", + "title": "CertificateAuthorityService listCertificateRevocationLists Sample", + "origin": "API_DEFINITION", + "description": " Lists [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList].", + "canonical": true, + "file": "certificate_authority_service.list_certificate_revocation_lists.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCertificateRevocationLists", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationLists", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ListCertificateRevocationLists", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationLists", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async", + "title": "CertificateAuthorityService updateCertificateRevocationList Sample", + "origin": "API_DEFINITION", + "description": " Update a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList].", + "canonical": true, + "file": "certificate_authority_service.update_certificate_revocation_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCertificateRevocationList", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationList", + "async": true, + "parameters": [ + { + "name": "certificate_revocation_list", + "type": ".google.cloud.security.privateca.v1beta1.CertificateRevocationList" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "UpdateCertificateRevocationList", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationList", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_async", + "title": "CertificateAuthorityService getReusableConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns a [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig].", + "canonical": true, + "file": "certificate_authority_service.get_reusable_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetReusableConfig", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.ReusableConfig", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "GetReusableConfig", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfig", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + }, + { + "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_async", + "title": "CertificateAuthorityService listReusableConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig].", + "canonical": true, + "file": "certificate_authority_service.list_reusable_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListReusableConfigs", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse", + "client": { + "shortName": "CertificateAuthorityServiceClient", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" + }, + "method": { + "shortName": "ListReusableConfigs", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigs", + "service": { + "shortName": "CertificateAuthorityService", + "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/index.ts b/owl-bot-staging/google-cloud-security-privateca/src/index.ts new file mode 100644 index 000000000000..c5cdb2fc6929 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/src/index.ts @@ -0,0 +1,28 @@ +// Copyright 2026 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1beta1 from './v1beta1'; + +const CertificateAuthorityServiceClient = v1.CertificateAuthorityServiceClient; +type CertificateAuthorityServiceClient = v1.CertificateAuthorityServiceClient; + +export {v1, v1beta1, CertificateAuthorityServiceClient}; +export default {v1, v1beta1, CertificateAuthorityServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts b/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts new file mode 100644 index 000000000000..01b6373b2fd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts @@ -0,0 +1,7233 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/certificate_authority_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './certificate_authority_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * [Certificate Authority + * Service][google.cloud.security.privateca.v1.CertificateAuthorityService] + * manages private certificate authorities and issued certificates. + * @class + * @memberof v1 + */ +export class CertificateAuthorityServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('security-private-ca'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + certificateAuthorityServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of CertificateAuthorityServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new CertificateAuthorityServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof CertificateAuthorityServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'privateca.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + caPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/caPools/{ca_pool}', + ), + certificatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}', + ), + certificateAuthorityPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}', + ), + certificateRevocationListPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}', + ), + certificateTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/certificateTemplates/{certificate_template}', + ), + locationPathTemplate: new this._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 = { + listCertificates: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificates', + ), + listCertificateAuthorities: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificateAuthorities', + ), + listCaPools: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'caPools', + ), + listCertificateRevocationLists: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificateRevocationLists', + ), + listCertificateTemplates: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificateTemplates', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/caPools/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/certificateTemplates/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/caPools/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/certificateTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/caPools/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/certificateTemplates/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const activateCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CertificateAuthority', + ) as gax.protobuf.Type; + const activateCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const createCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CertificateAuthority', + ) as gax.protobuf.Type; + const createCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const disableCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CertificateAuthority', + ) as gax.protobuf.Type; + const disableCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const enableCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CertificateAuthority', + ) as gax.protobuf.Type; + const enableCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const undeleteCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CertificateAuthority', + ) as gax.protobuf.Type; + const undeleteCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CertificateAuthority', + ) as gax.protobuf.Type; + const deleteCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const updateCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CertificateAuthority', + ) as gax.protobuf.Type; + const updateCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const createCaPoolResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CaPool', + ) as gax.protobuf.Type; + const createCaPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const updateCaPoolResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CaPool', + ) as gax.protobuf.Type; + const updateCaPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteCaPoolResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteCaPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const updateCertificateRevocationListResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CertificateRevocationList', + ) as gax.protobuf.Type; + const updateCertificateRevocationListMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const createCertificateTemplateResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CertificateTemplate', + ) as gax.protobuf.Type; + const createCertificateTemplateMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteCertificateTemplateResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteCertificateTemplateMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + const updateCertificateTemplateResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.CertificateTemplate', + ) as gax.protobuf.Type; + const updateCertificateTemplateMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1.OperationMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + activateCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + activateCertificateAuthorityResponse.decode.bind( + activateCertificateAuthorityResponse, + ), + activateCertificateAuthorityMetadata.decode.bind( + activateCertificateAuthorityMetadata, + ), + ), + createCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCertificateAuthorityResponse.decode.bind( + createCertificateAuthorityResponse, + ), + createCertificateAuthorityMetadata.decode.bind( + createCertificateAuthorityMetadata, + ), + ), + disableCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + disableCertificateAuthorityResponse.decode.bind( + disableCertificateAuthorityResponse, + ), + disableCertificateAuthorityMetadata.decode.bind( + disableCertificateAuthorityMetadata, + ), + ), + enableCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + enableCertificateAuthorityResponse.decode.bind( + enableCertificateAuthorityResponse, + ), + enableCertificateAuthorityMetadata.decode.bind( + enableCertificateAuthorityMetadata, + ), + ), + undeleteCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeleteCertificateAuthorityResponse.decode.bind( + undeleteCertificateAuthorityResponse, + ), + undeleteCertificateAuthorityMetadata.decode.bind( + undeleteCertificateAuthorityMetadata, + ), + ), + deleteCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCertificateAuthorityResponse.decode.bind( + deleteCertificateAuthorityResponse, + ), + deleteCertificateAuthorityMetadata.decode.bind( + deleteCertificateAuthorityMetadata, + ), + ), + updateCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCertificateAuthorityResponse.decode.bind( + updateCertificateAuthorityResponse, + ), + updateCertificateAuthorityMetadata.decode.bind( + updateCertificateAuthorityMetadata, + ), + ), + createCaPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCaPoolResponse.decode.bind(createCaPoolResponse), + createCaPoolMetadata.decode.bind(createCaPoolMetadata), + ), + updateCaPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCaPoolResponse.decode.bind(updateCaPoolResponse), + updateCaPoolMetadata.decode.bind(updateCaPoolMetadata), + ), + deleteCaPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCaPoolResponse.decode.bind(deleteCaPoolResponse), + deleteCaPoolMetadata.decode.bind(deleteCaPoolMetadata), + ), + updateCertificateRevocationList: + new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCertificateRevocationListResponse.decode.bind( + updateCertificateRevocationListResponse, + ), + updateCertificateRevocationListMetadata.decode.bind( + updateCertificateRevocationListMetadata, + ), + ), + createCertificateTemplate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCertificateTemplateResponse.decode.bind( + createCertificateTemplateResponse, + ), + createCertificateTemplateMetadata.decode.bind( + createCertificateTemplateMetadata, + ), + ), + deleteCertificateTemplate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCertificateTemplateResponse.decode.bind( + deleteCertificateTemplateResponse, + ), + deleteCertificateTemplateMetadata.decode.bind( + deleteCertificateTemplateMetadata, + ), + ), + updateCertificateTemplate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCertificateTemplateResponse.decode.bind( + updateCertificateTemplateResponse, + ), + updateCertificateTemplateMetadata.decode.bind( + updateCertificateTemplateMetadata, + ), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.security.privateca.v1.CertificateAuthorityService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.certificateAuthorityServiceStub) { + return this.certificateAuthorityServiceStub; + } + + // Put together the "service stub" for + // google.cloud.security.privateca.v1.CertificateAuthorityService. + this.certificateAuthorityServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.security.privateca.v1.CertificateAuthorityService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.security.privateca.v1 + .CertificateAuthorityService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const certificateAuthorityServiceStubMethods = [ + 'createCertificate', + 'getCertificate', + 'listCertificates', + 'revokeCertificate', + 'updateCertificate', + 'activateCertificateAuthority', + 'createCertificateAuthority', + 'disableCertificateAuthority', + 'enableCertificateAuthority', + 'fetchCertificateAuthorityCsr', + 'getCertificateAuthority', + 'listCertificateAuthorities', + 'undeleteCertificateAuthority', + 'deleteCertificateAuthority', + 'updateCertificateAuthority', + 'createCaPool', + 'updateCaPool', + 'getCaPool', + 'listCaPools', + 'deleteCaPool', + 'fetchCaCerts', + 'getCertificateRevocationList', + 'listCertificateRevocationLists', + 'updateCertificateRevocationList', + 'createCertificateTemplate', + 'deleteCertificateTemplate', + 'getCertificateTemplate', + 'listCertificateTemplates', + 'updateCertificateTemplate', + ]; + for (const methodName of certificateAuthorityServiceStubMethods) { + const callPromise = this.certificateAuthorityServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.certificateAuthorityServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'privateca.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'privateca.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Create a new {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} + * in a given Project, Location from a particular + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} associated with the + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}, in the + * format `projects/* /locations/* /caPools/*`. + * @param {string} [request.certificateId] + * Optional. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * in the Enterprise + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.tier|CertificateAuthority.tier}, + * but is optional and its value is ignored otherwise. + * @param {google.cloud.security.privateca.v1.Certificate} request.certificate + * Required. A {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} + * with initial field values. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If this is true, no + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} resource will + * be persisted regardless of the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}'s + * {@link protos.google.cloud.security.privateca.v1.CaPool.tier|tier}, and the returned + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} will not + * contain the + * {@link protos.google.cloud.security.privateca.v1.Certificate.pem_certificate|pem_certificate} + * field. + * @param {string} [request.issuingCertificateAuthorityId] + * Optional. The resource ID of the + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * that should issue the certificate. This optional field will ignore the + * load-balancing scheme of the Pool and directly issue the certificate from + * the CA with the specified ID, contained in the same + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} referenced by `parent`. + * Per-CA quota rules apply. If left empty, a + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * will be chosen from the {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} + * by the service. For example, to issue a + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} from a + * Certificate Authority with resource name + * "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", + * you can set the + * {@link protos.google.cloud.security.privateca.v1.CreateCertificateRequest.parent|parent} + * to "projects/my-project/locations/us-central1/caPools/my-pool" and the + * {@link protos.google.cloud.security.privateca.v1.CreateCertificateRequest.issuing_certificate_authority_id|issuing_certificate_authority_id} + * to "my-ca". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.create_certificate.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificate_async + */ + createCertificate( + request?: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest + | undefined + ), + {} | undefined, + ] + >; + createCertificate( + request: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createCertificate( + request: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createCertificate( + request?: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCertificate response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns a {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The {@link protos.google.cloud.security.privateca.v1.Certificate.name|name} + * of the {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} 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 {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.get_certificate.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificate_async + */ + getCertificate( + request?: protos.google.cloud.security.privateca.v1.IGetCertificateRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateRequest + | undefined + ), + {} | undefined, + ] + >; + getCertificate( + request: protos.google.cloud.security.privateca.v1.IGetCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificate( + request: protos.google.cloud.security.privateca.v1.IGetCertificateRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificate( + request?: protos.google.cloud.security.privateca.v1.IGetCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCertificate response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Revoke a {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} in the format + * `projects/* /locations/* /caPools/* /certificates/*`. + * @param {google.cloud.security.privateca.v1.RevocationReason} request.reason + * Required. The + * {@link protos.google.cloud.security.privateca.v1.RevocationReason|RevocationReason} for + * revoking this certificate. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.revoke_certificate.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_async + */ + revokeCertificate( + request?: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest + | undefined + ), + {} | undefined, + ] + >; + revokeCertificate( + request: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + revokeCertificate( + request: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + revokeCertificate( + request?: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('revokeCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('revokeCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .revokeCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('revokeCertificate response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Update a {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. + * Currently, the only field you can update is the + * {@link protos.google.cloud.security.privateca.v1.Certificate.labels|labels} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.security.privateca.v1.Certificate} request.certificate + * Required. {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} + * with updated values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A list of fields to be updated in this request. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.update_certificate.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_async + */ + updateCertificate( + request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest + | undefined + ), + {} | undefined, + ] + >; + updateCertificate( + request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateCertificate( + request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateCertificate( + request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'certificate.name': request.certificate!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1.ICertificate, + | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCertificate response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Fetch a certificate signing request (CSR) from a + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * that is in state + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION|AWAITING_USER_ACTIVATION} + * and is of type + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE|SUBORDINATE}. + * The CSR must then be signed by the desired parent Certificate Authority, + * which could be another + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * resource, or could be an on-prem certificate authority. See also + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority|ActivateCertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse|FetchCertificateAuthorityCsrResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async + */ + fetchCertificateAuthorityCsr( + request?: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, + ( + | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest + | undefined + ), + {} | undefined, + ] + >; + fetchCertificateAuthorityCsr( + request: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, + | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + fetchCertificateAuthorityCsr( + request: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, + | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + fetchCertificateAuthorityCsr( + request?: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, + | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, + | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, + ( + | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('fetchCertificateAuthorityCsr request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, + | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('fetchCertificateAuthorityCsr response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .fetchCertificateAuthorityCsr(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, + ( + | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('fetchCertificateAuthorityCsr response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns a + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.name|name} of the + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * 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 {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.get_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_async + */ + getCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest + | undefined + ), + {} | undefined, + ] + >; + getCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getCertificateAuthority request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCertificateAuthority response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCertificateAuthority response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns a {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The {@link protos.google.cloud.security.privateca.v1.CaPool.name|name} of the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} 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 {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.get_ca_pool.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCaPool_async + */ + getCaPool( + request?: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IGetCaPoolRequest | undefined, + {} | undefined, + ] + >; + getCaPool( + request: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICaPool, + | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCaPool( + request: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICaPool, + | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCaPool( + request?: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1.ICaPool, + | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1.ICaPool, + | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IGetCaPoolRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getCaPool request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1.ICaPool, + | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCaPool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCaPool(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1.ICaPool, + ( + | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCaPool response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * FetchCaCerts returns the current trust anchor for the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. This will include CA + * certificate chains for all certificate authorities in the ENABLED, + * DISABLED, or STAGED states. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.caPool + * Required. The resource name for the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} in the format + * `projects/* /locations/* /caPools/*`. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1.FetchCaCertsResponse|FetchCaCertsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.fetch_ca_certs.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_async + */ + fetchCaCerts( + request?: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, + ( + | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest + | undefined + ), + {} | undefined, + ] + >; + fetchCaCerts( + request: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, + | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + fetchCaCerts( + request: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, + | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + fetchCaCerts( + request?: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, + | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, + | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, + ( + | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + ca_pool: request.caPool ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('fetchCaCerts request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, + | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('fetchCaCerts response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .fetchCaCerts(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, + ( + | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('fetchCaCerts response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns a + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList.name|name} + * of the + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList} + * 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 {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_async + */ + getCertificateRevocationList( + request?: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest + | undefined + ), + {} | undefined, + ] + >; + getCertificateRevocationList( + request: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificateRevocationList( + request: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificateRevocationList( + request?: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getCertificateRevocationList request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCertificateRevocationList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCertificateRevocationList(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCertificateRevocationList response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns a + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate.name|name} of the + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} + * 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 {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.get_certificate_template.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_async + */ + getCertificateTemplate( + request?: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest + | undefined + ), + {} | undefined, + ] + >; + getCertificateTemplate( + request: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificateTemplate( + request: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificateTemplate( + request?: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getCertificateTemplate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCertificateTemplate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCertificateTemplate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + ( + | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCertificateTemplate response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Activate a + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * that is in state + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION|AWAITING_USER_ACTIVATION} + * and is of type + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE|SUBORDINATE}. + * After the parent Certificate Authority signs a certificate signing request + * from + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr|FetchCertificateAuthorityCsr}, + * this method can complete the activation process. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + * @param {string} request.pemCaCertificate + * Required. The signed CA certificate issued from + * {@link protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.pem_csr|FetchCertificateAuthorityCsrResponse.pem_csr}. + * @param {google.cloud.security.privateca.v1.SubordinateConfig} request.subordinateConfig + * Required. Must include information about the issuer of + * 'pem_ca_certificate', and any further issuers until the self-signed CA. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.activate_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async + */ + activateCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + activateCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + activateCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + activateCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'activateCertificateAuthority response %j', + rawResponse, + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('activateCertificateAuthority request %j', request); + return this.innerApiCalls + .activateCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'activateCertificateAuthority response %j', + rawResponse, + ); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `activateCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.activate_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async + */ + async checkActivateCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('activateCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.activateCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Create a new + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * 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 + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} associated with the + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, + * in the format `projects/* /locations/* /caPools/*`. + * @param {string} request.certificateAuthorityId + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param {google.cloud.security.privateca.v1.CertificateAuthority} request.certificateAuthority + * Required. A + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * with initial field values. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.create_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async + */ + createCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCertificateAuthority response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCertificateAuthority request %j', request); + return this.innerApiCalls + .createCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCertificateAuthority response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.create_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async + */ + async checkCreateCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('createCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Disable a + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.ignoreDependentResources] + * Optional. This field allows this CA to be disabled even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resources since the CA will + * no longer be able to issue certificates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.disable_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async + */ + disableCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + disableCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + disableCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + disableCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'disableCertificateAuthority response %j', + rawResponse, + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('disableCertificateAuthority request %j', request); + return this.innerApiCalls + .disableCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'disableCertificateAuthority response %j', + rawResponse, + ); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `disableCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.disable_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async + */ + async checkDisableCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('disableCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.disableCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Enable a + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.enable_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async + */ + enableCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + enableCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + enableCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + enableCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('enableCertificateAuthority response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('enableCertificateAuthority request %j', request); + return this.innerApiCalls + .enableCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('enableCertificateAuthority response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `enableCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.enable_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async + */ + async checkEnableCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('enableCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.enableCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Undelete a + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * that has been deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async + */ + undeleteCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + undeleteCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + undeleteCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + undeleteCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'undeleteCertificateAuthority response %j', + rawResponse, + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeleteCertificateAuthority request %j', request); + return this.innerApiCalls + .undeleteCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'undeleteCertificateAuthority response %j', + rawResponse, + ); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `undeleteCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async + */ + async checkUndeleteCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('undeleteCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.undeleteCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Delete a + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.ignoreActiveCertificates] + * Optional. This field allows the CA to be deleted even if the CA has + * active certs. Active certs include both unrevoked and unexpired certs. + * @param {boolean} [request.skipGracePeriod] + * Optional. If this flag is set, the Certificate Authority will be deleted as + * soon as possible without a 30-day grace period where undeletion would have + * been allowed. If you proceed, there will be no way to recover this CA. + * @param {boolean} [request.ignoreDependentResources] + * Optional. This field allows this CA to be deleted even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resources since the CA will + * no longer be able to issue certificates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.delete_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async + */ + deleteCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCertificateAuthority response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCertificateAuthority request %j', request); + return this.innerApiCalls + .deleteCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCertificateAuthority response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.delete_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async + */ + async checkDeleteCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('deleteCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Update a + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.security.privateca.v1.CertificateAuthority} request.certificateAuthority + * Required. + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} + * with updated values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A list of fields to be updated in this request. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.update_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async + */ + updateCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCertificateAuthority( + request: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'certificate_authority.name': request.certificateAuthority!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCertificateAuthority response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCertificateAuthority request %j', request); + return this.innerApiCalls + .updateCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCertificateAuthority response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.update_certificate_authority.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async + */ + async checkUpdateCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('updateCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CertificateAuthority, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Create a {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}, in the format + * `projects/* /locations/*`. + * @param {string} request.caPoolId + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param {google.cloud.security.privateca.v1.CaPool} request.caPool + * Required. A {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} with + * initial field values. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.create_ca_pool.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async + */ + createCaPool( + request?: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createCaPool( + request: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCaPool( + request: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCaPool( + request?: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCaPool response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCaPool request %j', request); + return this.innerApiCalls + .createCaPool(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCaPool response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createCaPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.create_ca_pool.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async + */ + async checkCreateCaPoolProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CaPool, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('createCaPool long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createCaPool, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CaPool, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Update a {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.security.privateca.v1.CaPool} request.caPool + * Required. {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} with updated + * values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A list of fields to be updated in this request. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.update_ca_pool.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async + */ + updateCaPool( + request?: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateCaPool( + request: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCaPool( + request: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCaPool( + request?: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'ca_pool.name': request.caPool!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCaPool response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCaPool request %j', request); + return this.innerApiCalls + .updateCaPool(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCaPool response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateCaPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.update_ca_pool.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async + */ + async checkUpdateCaPoolProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CaPool, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('updateCaPool long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateCaPool, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CaPool, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Delete a {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} in the format + * `projects/* /locations/* /caPools/*`. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.ignoreDependentResources] + * Optional. This field allows this pool to be deleted even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resources since the pool will + * no longer be able to issue certificates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.delete_ca_pool.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async + */ + deleteCaPool( + request?: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteCaPool( + request: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteCaPool( + request: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteCaPool( + request?: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCaPool response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCaPool request %j', request); + return this.innerApiCalls + .deleteCaPool(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCaPool response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteCaPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.delete_ca_pool.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async + */ + async checkDeleteCaPoolProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('deleteCaPool long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteCaPool, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Update a + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.security.privateca.v1.CertificateRevocationList} request.certificateRevocationList + * Required. + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList} + * with updated values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A list of fields to be updated in this request. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async + */ + updateCertificateRevocationList( + request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateCertificateRevocationList( + request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCertificateRevocationList( + request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCertificateRevocationList( + request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'certificate_revocation_list.name': + request.certificateRevocationList!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'updateCertificateRevocationList response %j', + rawResponse, + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCertificateRevocationList request %j', request); + return this.innerApiCalls + .updateCertificateRevocationList(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'updateCertificateRevocationList response %j', + rawResponse, + ); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateCertificateRevocationList()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async + */ + async checkUpdateCertificateRevocationListProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CertificateRevocationList, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('updateCertificateRevocationList long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateCertificateRevocationList, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CertificateRevocationList, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Create a new + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} + * 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 + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}, + * in the format `projects/* /locations/*`. + * @param {string} request.certificateTemplateId + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param {google.cloud.security.privateca.v1.CertificateTemplate} request.certificateTemplate + * Required. A + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} + * with initial field values. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.create_certificate_template.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async + */ + createCertificateTemplate( + request?: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createCertificateTemplate( + request: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCertificateTemplate( + request: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCertificateTemplate( + request?: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCertificateTemplate response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCertificateTemplate request %j', request); + return this.innerApiCalls + .createCertificateTemplate(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCertificateTemplate response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createCertificateTemplate()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.create_certificate_template.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async + */ + async checkCreateCertificateTemplateProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CertificateTemplate, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('createCertificateTemplate long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createCertificateTemplate, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CertificateTemplate, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * DeleteCertificateTemplate deletes a + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} + * in the format `projects/* /locations/* /certificateTemplates/*`. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.delete_certificate_template.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async + */ + deleteCertificateTemplate( + request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteCertificateTemplate( + request: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteCertificateTemplate( + request: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteCertificateTemplate( + request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCertificateTemplate response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCertificateTemplate request %j', request); + return this.innerApiCalls + .deleteCertificateTemplate(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCertificateTemplate response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteCertificateTemplate()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.delete_certificate_template.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async + */ + async checkDeleteCertificateTemplateProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('deleteCertificateTemplate long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteCertificateTemplate, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Update a + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.security.privateca.v1.CertificateTemplate} request.certificateTemplate + * Required. + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} + * with updated values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A list of fields to be updated in this request. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that + * if you must retry your request, the server will know to ignore the request + * if it has already been completed. The server will guarantee that for at + * least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.update_certificate_template.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async + */ + updateCertificateTemplate( + request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateCertificateTemplate( + request: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCertificateTemplate( + request: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCertificateTemplate( + request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'certificate_template.name': request.certificateTemplate!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCertificateTemplate response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCertificateTemplate request %j', request); + return this.innerApiCalls + .updateCertificateTemplate(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCertificateTemplate response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateCertificateTemplate()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.update_certificate_template.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async + */ + async checkUpdateCertificateTemplateProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1.CertificateTemplate, + protos.google.cloud.security.privateca.v1.OperationMetadata + > + > { + this._log.info('updateCertificateTemplate long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateCertificateTemplate, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1.CertificateTemplate, + protos.google.cloud.security.privateca.v1.OperationMetadata + >; + } + /** + * Lists {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent associated with the + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates}, in the + * format `projects/* /locations/* /caPools/*`. The parent resource name can be + * in one of two forms: + * + * 1. **Specific CA Pool:** To list certificates within a single CA Pool: + * `projects/* /locations/* /caPools/*` + * + * 2. **All CA Pools in a Location:** To list certificates across *all* CA + * Pools in a given project and location, use the wildcard character (`-`) + * in place of the CA Pool ID. + * Example: `projects/* /locations/* /caPools/-` + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} to include + * in the response. Further + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} can + * subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For + * details on supported filters and syntax, see [Certificates Filtering + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. For details on + * supported fields and syntax, see [Certificates Sorting + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCertificatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificates( + request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificate[], + protos.google.cloud.security.privateca.v1.IListCertificatesRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificatesResponse, + ] + >; + listCertificates( + request: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificatesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificate + >, + ): void; + listCertificates( + request: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificatesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificate + >, + ): void; + listCertificates( + request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificatesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificate + >, + callback?: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificatesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificate + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificate[], + protos.google.cloud.security.privateca.v1.IListCertificatesRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificatesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificatesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificate + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCertificates values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCertificates request %j', request); + return this.innerApiCalls + .listCertificates(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.security.privateca.v1.ICertificate[], + protos.google.cloud.security.privateca.v1.IListCertificatesRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificatesResponse, + ]) => { + this._log.info('listCertificates values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listCertificates`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent associated with the + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates}, in the + * format `projects/* /locations/* /caPools/*`. The parent resource name can be + * in one of two forms: + * + * 1. **Specific CA Pool:** To list certificates within a single CA Pool: + * `projects/* /locations/* /caPools/*` + * + * 2. **All CA Pools in a Location:** To list certificates across *all* CA + * Pools in a given project and location, use the wildcard character (`-`) + * in place of the CA Pool ID. + * Example: `projects/* /locations/* /caPools/-` + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} to include + * in the response. Further + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} can + * subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For + * details on supported filters and syntax, see [Certificates Filtering + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. For details on + * supported fields and syntax, see [Certificates Sorting + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCertificatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificatesStream( + request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCertificates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificates stream %j', request); + return this.descriptors.page.listCertificates.createStream( + this.innerApiCalls.listCertificates as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listCertificates`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent associated with the + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates}, in the + * format `projects/* /locations/* /caPools/*`. The parent resource name can be + * in one of two forms: + * + * 1. **Specific CA Pool:** To list certificates within a single CA Pool: + * `projects/* /locations/* /caPools/*` + * + * 2. **All CA Pools in a Location:** To list certificates across *all* CA + * Pools in a given project and location, use the wildcard character (`-`) + * in place of the CA Pool ID. + * Example: `projects/* /locations/* /caPools/-` + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} to include + * in the response. Further + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} can + * subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For + * details on supported filters and syntax, see [Certificates Filtering + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. For details on + * supported fields and syntax, see [Certificates Sorting + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.list_certificates.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificates_async + */ + listCertificatesAsync( + request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCertificates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificates iterate %j', request); + return this.descriptors.page.listCertificates.asyncIterate( + this.innerApiCalls['listCertificates'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} associated with the + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, + * in the format `projects/* /locations/* /caPools/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} + * to include in the response. Further + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCertificateAuthoritiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificateAuthorities( + request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateAuthority[], + protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse, + ] + >; + listCertificateAuthorities( + request: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateAuthority + >, + ): void; + listCertificateAuthorities( + request: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateAuthority + >, + ): void; + listCertificateAuthorities( + request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateAuthority + >, + callback?: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateAuthority + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateAuthority[], + protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateAuthority + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCertificateAuthorities values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCertificateAuthorities request %j', request); + return this.innerApiCalls + .listCertificateAuthorities(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.security.privateca.v1.ICertificateAuthority[], + protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse, + ]) => { + this._log.info('listCertificateAuthorities values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listCertificateAuthorities`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} associated with the + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, + * in the format `projects/* /locations/* /caPools/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} + * to include in the response. Further + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCertificateAuthoritiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificateAuthoritiesStream( + request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCertificateAuthorities']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificateAuthorities stream %j', request); + return this.descriptors.page.listCertificateAuthorities.createStream( + this.innerApiCalls.listCertificateAuthorities as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listCertificateAuthorities`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} associated with the + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, + * in the format `projects/* /locations/* /caPools/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} + * to include in the response. Further + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.list_certificate_authorities.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_async + */ + listCertificateAuthoritiesAsync( + request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCertificateAuthorities']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificateAuthorities iterate %j', request); + return this.descriptors.page.listCertificateAuthorities.asyncIterate( + this.innerApiCalls['listCertificateAuthorities'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools}, in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} to include in the + * response. Further {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} can + * subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCaPoolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCaPools( + request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICaPool[], + protos.google.cloud.security.privateca.v1.IListCaPoolsRequest | null, + protos.google.cloud.security.privateca.v1.IListCaPoolsResponse, + ] + >; + listCaPools( + request: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, + | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICaPool + >, + ): void; + listCaPools( + request: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, + | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICaPool + >, + ): void; + listCaPools( + request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, + | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICaPool + >, + callback?: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, + | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICaPool + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICaPool[], + protos.google.cloud.security.privateca.v1.IListCaPoolsRequest | null, + protos.google.cloud.security.privateca.v1.IListCaPoolsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, + | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICaPool + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCaPools values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCaPools request %j', request); + return this.innerApiCalls + .listCaPools(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.security.privateca.v1.ICaPool[], + protos.google.cloud.security.privateca.v1.IListCaPoolsRequest | null, + protos.google.cloud.security.privateca.v1.IListCaPoolsResponse, + ]) => { + this._log.info('listCaPools values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listCaPools`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools}, in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} to include in the + * response. Further {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} can + * subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCaPoolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCaPoolsStream( + request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCaPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCaPools stream %j', request); + return this.descriptors.page.listCaPools.createStream( + this.innerApiCalls.listCaPools as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listCaPools`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools}, in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} to include in the + * response. Further {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} can + * subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.list_ca_pools.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCaPools_async + */ + listCaPoolsAsync( + request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCaPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCaPools iterate %j', request); + return this.descriptors.page.listCaPools.asyncIterate( + this.innerApiCalls['listCaPools'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}, + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} + * to include in the response. Further + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCertificateRevocationListsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificateRevocationLists( + request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateRevocationList[], + protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse, + ] + >; + listCertificateRevocationLists( + request: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateRevocationList + >, + ): void; + listCertificateRevocationLists( + request: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateRevocationList + >, + ): void; + listCertificateRevocationLists( + request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateRevocationList + >, + callback?: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateRevocationList + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateRevocationList[], + protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateRevocationList + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCertificateRevocationLists values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCertificateRevocationLists request %j', request); + return this.innerApiCalls + .listCertificateRevocationLists(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.security.privateca.v1.ICertificateRevocationList[], + protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse, + ]) => { + this._log.info('listCertificateRevocationLists values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listCertificateRevocationLists`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}, + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} + * to include in the response. Further + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCertificateRevocationListsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificateRevocationListsStream( + request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = + this._defaults['listCertificateRevocationLists']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificateRevocationLists stream %j', request); + return this.descriptors.page.listCertificateRevocationLists.createStream( + this.innerApiCalls.listCertificateRevocationLists as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listCertificateRevocationLists`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}, + * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} + * to include in the response. Further + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async + */ + listCertificateRevocationListsAsync( + request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = + this._defaults['listCertificateRevocationLists']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificateRevocationLists iterate %j', request); + return this.descriptors.page.listCertificateRevocationLists.asyncIterate( + this.innerApiCalls['listCertificateRevocationLists'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}, + * in the format `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} + * to include in the response. Further + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCertificateTemplatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificateTemplates( + request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateTemplate[], + protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse, + ] + >; + listCertificateTemplates( + request: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateTemplate + >, + ): void; + listCertificateTemplates( + request: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateTemplate + >, + ): void; + listCertificateTemplates( + request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateTemplate + >, + callback?: PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateTemplate + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1.ICertificateTemplate[], + protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, + | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1.ICertificateTemplate + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCertificateTemplates values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCertificateTemplates request %j', request); + return this.innerApiCalls + .listCertificateTemplates(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.security.privateca.v1.ICertificateTemplate[], + protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest | null, + protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse, + ]) => { + this._log.info('listCertificateTemplates values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listCertificateTemplates`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}, + * in the format `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} + * to include in the response. Further + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCertificateTemplatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificateTemplatesStream( + request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCertificateTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificateTemplates stream %j', request); + return this.descriptors.page.listCertificateTemplates.createStream( + this.innerApiCalls.listCertificateTemplates as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listCertificateTemplates`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}, + * in the format `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} + * to include in the response. Further + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token} + * in a subsequent request. If unspecified, the server will pick an + * appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/certificate_authority_service.list_certificate_templates.js + * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_async + */ + listCertificateTemplatesAsync( + request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCertificateTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificateTemplates iterate %j', request); + return this.descriptors.page.listCertificateTemplates.asyncIterate( + this.innerApiCalls['listCertificateTemplates'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + ): Promise<[protos.google.longrunning.Operation]> { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions, + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + ): Promise { + 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified caPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} ca_pool + * @returns {string} Resource name string. + */ + caPoolPath(project: string, location: string, caPool: string) { + return this.pathTemplates.caPoolPathTemplate.render({ + project: project, + location: location, + ca_pool: caPool, + }); + } + + /** + * Parse the project from CaPool resource. + * + * @param {string} caPoolName + * A fully-qualified path representing CaPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCaPoolName(caPoolName: string) { + return this.pathTemplates.caPoolPathTemplate.match(caPoolName).project; + } + + /** + * Parse the location from CaPool resource. + * + * @param {string} caPoolName + * A fully-qualified path representing CaPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCaPoolName(caPoolName: string) { + return this.pathTemplates.caPoolPathTemplate.match(caPoolName).location; + } + + /** + * Parse the ca_pool from CaPool resource. + * + * @param {string} caPoolName + * A fully-qualified path representing CaPool resource. + * @returns {string} A string representing the ca_pool. + */ + matchCaPoolFromCaPoolName(caPoolName: string) { + return this.pathTemplates.caPoolPathTemplate.match(caPoolName).ca_pool; + } + + /** + * Return a fully-qualified certificate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} ca_pool + * @param {string} certificate + * @returns {string} Resource name string. + */ + certificatePath( + project: string, + location: string, + caPool: string, + certificate: string, + ) { + return this.pathTemplates.certificatePathTemplate.render({ + project: project, + location: location, + ca_pool: caPool, + certificate: certificate, + }); + } + + /** + * Parse the project from Certificate resource. + * + * @param {string} certificateName + * A fully-qualified path representing Certificate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCertificateName(certificateName: string) { + return this.pathTemplates.certificatePathTemplate.match(certificateName) + .project; + } + + /** + * Parse the location from Certificate resource. + * + * @param {string} certificateName + * A fully-qualified path representing Certificate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCertificateName(certificateName: string) { + return this.pathTemplates.certificatePathTemplate.match(certificateName) + .location; + } + + /** + * Parse the ca_pool from Certificate resource. + * + * @param {string} certificateName + * A fully-qualified path representing Certificate resource. + * @returns {string} A string representing the ca_pool. + */ + matchCaPoolFromCertificateName(certificateName: string) { + return this.pathTemplates.certificatePathTemplate.match(certificateName) + .ca_pool; + } + + /** + * Parse the certificate from Certificate resource. + * + * @param {string} certificateName + * A fully-qualified path representing Certificate resource. + * @returns {string} A string representing the certificate. + */ + matchCertificateFromCertificateName(certificateName: string) { + return this.pathTemplates.certificatePathTemplate.match(certificateName) + .certificate; + } + + /** + * Return a fully-qualified certificateAuthority resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} ca_pool + * @param {string} certificate_authority + * @returns {string} Resource name string. + */ + certificateAuthorityPath( + project: string, + location: string, + caPool: string, + certificateAuthority: string, + ) { + return this.pathTemplates.certificateAuthorityPathTemplate.render({ + project: project, + location: location, + ca_pool: caPool, + certificate_authority: certificateAuthority, + }); + } + + /** + * Parse the project from CertificateAuthority resource. + * + * @param {string} certificateAuthorityName + * A fully-qualified path representing CertificateAuthority resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCertificateAuthorityName(certificateAuthorityName: string) { + return this.pathTemplates.certificateAuthorityPathTemplate.match( + certificateAuthorityName, + ).project; + } + + /** + * Parse the location from CertificateAuthority resource. + * + * @param {string} certificateAuthorityName + * A fully-qualified path representing CertificateAuthority resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCertificateAuthorityName(certificateAuthorityName: string) { + return this.pathTemplates.certificateAuthorityPathTemplate.match( + certificateAuthorityName, + ).location; + } + + /** + * Parse the ca_pool from CertificateAuthority resource. + * + * @param {string} certificateAuthorityName + * A fully-qualified path representing CertificateAuthority resource. + * @returns {string} A string representing the ca_pool. + */ + matchCaPoolFromCertificateAuthorityName(certificateAuthorityName: string) { + return this.pathTemplates.certificateAuthorityPathTemplate.match( + certificateAuthorityName, + ).ca_pool; + } + + /** + * Parse the certificate_authority from CertificateAuthority resource. + * + * @param {string} certificateAuthorityName + * A fully-qualified path representing CertificateAuthority resource. + * @returns {string} A string representing the certificate_authority. + */ + matchCertificateAuthorityFromCertificateAuthorityName( + certificateAuthorityName: string, + ) { + return this.pathTemplates.certificateAuthorityPathTemplate.match( + certificateAuthorityName, + ).certificate_authority; + } + + /** + * Return a fully-qualified certificateRevocationList resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} ca_pool + * @param {string} certificate_authority + * @param {string} certificate_revocation_list + * @returns {string} Resource name string. + */ + certificateRevocationListPath( + project: string, + location: string, + caPool: string, + certificateAuthority: string, + certificateRevocationList: string, + ) { + return this.pathTemplates.certificateRevocationListPathTemplate.render({ + project: project, + location: location, + ca_pool: caPool, + certificate_authority: certificateAuthority, + certificate_revocation_list: certificateRevocationList, + }); + } + + /** + * Parse the project from CertificateRevocationList resource. + * + * @param {string} certificateRevocationListName + * A fully-qualified path representing CertificateRevocationList resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCertificateRevocationListName( + certificateRevocationListName: string, + ) { + return this.pathTemplates.certificateRevocationListPathTemplate.match( + certificateRevocationListName, + ).project; + } + + /** + * Parse the location from CertificateRevocationList resource. + * + * @param {string} certificateRevocationListName + * A fully-qualified path representing CertificateRevocationList resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCertificateRevocationListName( + certificateRevocationListName: string, + ) { + return this.pathTemplates.certificateRevocationListPathTemplate.match( + certificateRevocationListName, + ).location; + } + + /** + * Parse the ca_pool from CertificateRevocationList resource. + * + * @param {string} certificateRevocationListName + * A fully-qualified path representing CertificateRevocationList resource. + * @returns {string} A string representing the ca_pool. + */ + matchCaPoolFromCertificateRevocationListName( + certificateRevocationListName: string, + ) { + return this.pathTemplates.certificateRevocationListPathTemplate.match( + certificateRevocationListName, + ).ca_pool; + } + + /** + * Parse the certificate_authority from CertificateRevocationList resource. + * + * @param {string} certificateRevocationListName + * A fully-qualified path representing CertificateRevocationList resource. + * @returns {string} A string representing the certificate_authority. + */ + matchCertificateAuthorityFromCertificateRevocationListName( + certificateRevocationListName: string, + ) { + return this.pathTemplates.certificateRevocationListPathTemplate.match( + certificateRevocationListName, + ).certificate_authority; + } + + /** + * Parse the certificate_revocation_list from CertificateRevocationList resource. + * + * @param {string} certificateRevocationListName + * A fully-qualified path representing CertificateRevocationList resource. + * @returns {string} A string representing the certificate_revocation_list. + */ + matchCertificateRevocationListFromCertificateRevocationListName( + certificateRevocationListName: string, + ) { + return this.pathTemplates.certificateRevocationListPathTemplate.match( + certificateRevocationListName, + ).certificate_revocation_list; + } + + /** + * Return a fully-qualified certificateTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} certificate_template + * @returns {string} Resource name string. + */ + certificateTemplatePath( + project: string, + location: string, + certificateTemplate: string, + ) { + return this.pathTemplates.certificateTemplatePathTemplate.render({ + project: project, + location: location, + certificate_template: certificateTemplate, + }); + } + + /** + * Parse the project from CertificateTemplate resource. + * + * @param {string} certificateTemplateName + * A fully-qualified path representing CertificateTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCertificateTemplateName(certificateTemplateName: string) { + return this.pathTemplates.certificateTemplatePathTemplate.match( + certificateTemplateName, + ).project; + } + + /** + * Parse the location from CertificateTemplate resource. + * + * @param {string} certificateTemplateName + * A fully-qualified path representing CertificateTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCertificateTemplateName(certificateTemplateName: string) { + return this.pathTemplates.certificateTemplatePathTemplate.match( + certificateTemplateName, + ).location; + } + + /** + * Parse the certificate_template from CertificateTemplate resource. + * + * @param {string} certificateTemplateName + * A fully-qualified path representing CertificateTemplate resource. + * @returns {string} A string representing the certificate_template. + */ + matchCertificateTemplateFromCertificateTemplateName( + certificateTemplateName: string, + ) { + return this.pathTemplates.certificateTemplatePathTemplate.match( + certificateTemplateName, + ).certificate_template; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.certificateAuthorityServiceStub && !this._terminated) { + return this.certificateAuthorityServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch((err) => { + throw err; + }); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client_config.json b/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client_config.json new file mode 100644 index 000000000000..d7847b0603f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client_config.json @@ -0,0 +1,176 @@ +{ + "interfaces": { + "google.cloud.security.privateca.v1.CertificateAuthorityService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unknown_deadline_exceeded_unavailable": [ + "UNKNOWN", + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "GetCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ListCertificates": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "RevokeCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "UpdateCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ActivateCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "CreateCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "DisableCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "EnableCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "FetchCertificateAuthorityCsr": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "GetCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ListCertificateAuthorities": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "UndeleteCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "DeleteCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "UpdateCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "CreateCaPool": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "UpdateCaPool": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "GetCaPool": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ListCaPools": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "DeleteCaPool": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "FetchCaCerts": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "GetCertificateRevocationList": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ListCertificateRevocationLists": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "UpdateCertificateRevocationList": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "CreateCertificateTemplate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "DeleteCertificateTemplate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "GetCertificateTemplate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ListCertificateTemplates": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "UpdateCertificateTemplate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_proto_list.json b/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_proto_list.json new file mode 100644 index 000000000000..ec340e404e82 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/security/privateca/v1/resources.proto", + "../../protos/google/cloud/security/privateca/v1/service.proto" +] diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-privateca/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..dc371ea2a568 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/src/v1/gapic_metadata.json @@ -0,0 +1,333 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.security.privateca.v1", + "libraryPackage": "@google-cloud/security-private-ca", + "services": { + "CertificateAuthorityService": { + "clients": { + "grpc": { + "libraryClient": "CertificateAuthorityServiceClient", + "rpcs": { + "CreateCertificate": { + "methods": [ + "createCertificate" + ] + }, + "GetCertificate": { + "methods": [ + "getCertificate" + ] + }, + "RevokeCertificate": { + "methods": [ + "revokeCertificate" + ] + }, + "UpdateCertificate": { + "methods": [ + "updateCertificate" + ] + }, + "FetchCertificateAuthorityCsr": { + "methods": [ + "fetchCertificateAuthorityCsr" + ] + }, + "GetCertificateAuthority": { + "methods": [ + "getCertificateAuthority" + ] + }, + "GetCaPool": { + "methods": [ + "getCaPool" + ] + }, + "FetchCaCerts": { + "methods": [ + "fetchCaCerts" + ] + }, + "GetCertificateRevocationList": { + "methods": [ + "getCertificateRevocationList" + ] + }, + "GetCertificateTemplate": { + "methods": [ + "getCertificateTemplate" + ] + }, + "ActivateCertificateAuthority": { + "methods": [ + "activateCertificateAuthority" + ] + }, + "CreateCertificateAuthority": { + "methods": [ + "createCertificateAuthority" + ] + }, + "DisableCertificateAuthority": { + "methods": [ + "disableCertificateAuthority" + ] + }, + "EnableCertificateAuthority": { + "methods": [ + "enableCertificateAuthority" + ] + }, + "UndeleteCertificateAuthority": { + "methods": [ + "undeleteCertificateAuthority" + ] + }, + "DeleteCertificateAuthority": { + "methods": [ + "deleteCertificateAuthority" + ] + }, + "UpdateCertificateAuthority": { + "methods": [ + "updateCertificateAuthority" + ] + }, + "CreateCaPool": { + "methods": [ + "createCaPool" + ] + }, + "UpdateCaPool": { + "methods": [ + "updateCaPool" + ] + }, + "DeleteCaPool": { + "methods": [ + "deleteCaPool" + ] + }, + "UpdateCertificateRevocationList": { + "methods": [ + "updateCertificateRevocationList" + ] + }, + "CreateCertificateTemplate": { + "methods": [ + "createCertificateTemplate" + ] + }, + "DeleteCertificateTemplate": { + "methods": [ + "deleteCertificateTemplate" + ] + }, + "UpdateCertificateTemplate": { + "methods": [ + "updateCertificateTemplate" + ] + }, + "ListCertificates": { + "methods": [ + "listCertificates", + "listCertificatesStream", + "listCertificatesAsync" + ] + }, + "ListCertificateAuthorities": { + "methods": [ + "listCertificateAuthorities", + "listCertificateAuthoritiesStream", + "listCertificateAuthoritiesAsync" + ] + }, + "ListCaPools": { + "methods": [ + "listCaPools", + "listCaPoolsStream", + "listCaPoolsAsync" + ] + }, + "ListCertificateRevocationLists": { + "methods": [ + "listCertificateRevocationLists", + "listCertificateRevocationListsStream", + "listCertificateRevocationListsAsync" + ] + }, + "ListCertificateTemplates": { + "methods": [ + "listCertificateTemplates", + "listCertificateTemplatesStream", + "listCertificateTemplatesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CertificateAuthorityServiceClient", + "rpcs": { + "CreateCertificate": { + "methods": [ + "createCertificate" + ] + }, + "GetCertificate": { + "methods": [ + "getCertificate" + ] + }, + "RevokeCertificate": { + "methods": [ + "revokeCertificate" + ] + }, + "UpdateCertificate": { + "methods": [ + "updateCertificate" + ] + }, + "FetchCertificateAuthorityCsr": { + "methods": [ + "fetchCertificateAuthorityCsr" + ] + }, + "GetCertificateAuthority": { + "methods": [ + "getCertificateAuthority" + ] + }, + "GetCaPool": { + "methods": [ + "getCaPool" + ] + }, + "FetchCaCerts": { + "methods": [ + "fetchCaCerts" + ] + }, + "GetCertificateRevocationList": { + "methods": [ + "getCertificateRevocationList" + ] + }, + "GetCertificateTemplate": { + "methods": [ + "getCertificateTemplate" + ] + }, + "ActivateCertificateAuthority": { + "methods": [ + "activateCertificateAuthority" + ] + }, + "CreateCertificateAuthority": { + "methods": [ + "createCertificateAuthority" + ] + }, + "DisableCertificateAuthority": { + "methods": [ + "disableCertificateAuthority" + ] + }, + "EnableCertificateAuthority": { + "methods": [ + "enableCertificateAuthority" + ] + }, + "UndeleteCertificateAuthority": { + "methods": [ + "undeleteCertificateAuthority" + ] + }, + "DeleteCertificateAuthority": { + "methods": [ + "deleteCertificateAuthority" + ] + }, + "UpdateCertificateAuthority": { + "methods": [ + "updateCertificateAuthority" + ] + }, + "CreateCaPool": { + "methods": [ + "createCaPool" + ] + }, + "UpdateCaPool": { + "methods": [ + "updateCaPool" + ] + }, + "DeleteCaPool": { + "methods": [ + "deleteCaPool" + ] + }, + "UpdateCertificateRevocationList": { + "methods": [ + "updateCertificateRevocationList" + ] + }, + "CreateCertificateTemplate": { + "methods": [ + "createCertificateTemplate" + ] + }, + "DeleteCertificateTemplate": { + "methods": [ + "deleteCertificateTemplate" + ] + }, + "UpdateCertificateTemplate": { + "methods": [ + "updateCertificateTemplate" + ] + }, + "ListCertificates": { + "methods": [ + "listCertificates", + "listCertificatesStream", + "listCertificatesAsync" + ] + }, + "ListCertificateAuthorities": { + "methods": [ + "listCertificateAuthorities", + "listCertificateAuthoritiesStream", + "listCertificateAuthoritiesAsync" + ] + }, + "ListCaPools": { + "methods": [ + "listCaPools", + "listCaPoolsStream", + "listCaPoolsAsync" + ] + }, + "ListCertificateRevocationLists": { + "methods": [ + "listCertificateRevocationLists", + "listCertificateRevocationListsStream", + "listCertificateRevocationListsAsync" + ] + }, + "ListCertificateTemplates": { + "methods": [ + "listCertificateTemplates", + "listCertificateTemplatesStream", + "listCertificateTemplatesAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1/index.ts b/owl-bot-staging/google-cloud-security-privateca/src/v1/index.ts new file mode 100644 index 000000000000..47de88d5715f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export { CertificateAuthorityServiceClient } from './certificate_authority_service_client'; diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts new file mode 100644 index 000000000000..d55aa17ca557 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts @@ -0,0 +1,4703 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/certificate_authority_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './certificate_authority_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthorityService|Certificate Authority Service} manages private + * certificate authorities and issued certificates. + * @class + * @memberof v1beta1 + */ +export class CertificateAuthorityServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('security-private-ca'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + certificateAuthorityServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of CertificateAuthorityServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new CertificateAuthorityServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof CertificateAuthorityServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'privateca.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + certificatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificates/{certificate}', + ), + certificateAuthorityPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}', + ), + certificateRevocationListPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + reusableConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reusableConfigs/{reusable_config}', + ), + }; + + // 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 = { + listCertificates: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificates', + ), + listCertificateAuthorities: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificateAuthorities', + ), + listCertificateRevocationLists: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificateRevocationLists', + ), + listReusableConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'reusableConfigs', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const activateCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.CertificateAuthority', + ) as gax.protobuf.Type; + const activateCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.OperationMetadata', + ) as gax.protobuf.Type; + const createCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.CertificateAuthority', + ) as gax.protobuf.Type; + const createCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.OperationMetadata', + ) as gax.protobuf.Type; + const disableCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.CertificateAuthority', + ) as gax.protobuf.Type; + const disableCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.OperationMetadata', + ) as gax.protobuf.Type; + const enableCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.CertificateAuthority', + ) as gax.protobuf.Type; + const enableCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.OperationMetadata', + ) as gax.protobuf.Type; + const restoreCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.CertificateAuthority', + ) as gax.protobuf.Type; + const restoreCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.OperationMetadata', + ) as gax.protobuf.Type; + const scheduleDeleteCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.CertificateAuthority', + ) as gax.protobuf.Type; + const scheduleDeleteCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.OperationMetadata', + ) as gax.protobuf.Type; + const updateCertificateAuthorityResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.CertificateAuthority', + ) as gax.protobuf.Type; + const updateCertificateAuthorityMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.OperationMetadata', + ) as gax.protobuf.Type; + const updateCertificateRevocationListResponse = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.CertificateRevocationList', + ) as gax.protobuf.Type; + const updateCertificateRevocationListMetadata = protoFilesRoot.lookup( + '.google.cloud.security.privateca.v1beta1.OperationMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + activateCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + activateCertificateAuthorityResponse.decode.bind( + activateCertificateAuthorityResponse, + ), + activateCertificateAuthorityMetadata.decode.bind( + activateCertificateAuthorityMetadata, + ), + ), + createCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCertificateAuthorityResponse.decode.bind( + createCertificateAuthorityResponse, + ), + createCertificateAuthorityMetadata.decode.bind( + createCertificateAuthorityMetadata, + ), + ), + disableCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + disableCertificateAuthorityResponse.decode.bind( + disableCertificateAuthorityResponse, + ), + disableCertificateAuthorityMetadata.decode.bind( + disableCertificateAuthorityMetadata, + ), + ), + enableCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + enableCertificateAuthorityResponse.decode.bind( + enableCertificateAuthorityResponse, + ), + enableCertificateAuthorityMetadata.decode.bind( + enableCertificateAuthorityMetadata, + ), + ), + restoreCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreCertificateAuthorityResponse.decode.bind( + restoreCertificateAuthorityResponse, + ), + restoreCertificateAuthorityMetadata.decode.bind( + restoreCertificateAuthorityMetadata, + ), + ), + scheduleDeleteCertificateAuthority: + new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + scheduleDeleteCertificateAuthorityResponse.decode.bind( + scheduleDeleteCertificateAuthorityResponse, + ), + scheduleDeleteCertificateAuthorityMetadata.decode.bind( + scheduleDeleteCertificateAuthorityMetadata, + ), + ), + updateCertificateAuthority: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCertificateAuthorityResponse.decode.bind( + updateCertificateAuthorityResponse, + ), + updateCertificateAuthorityMetadata.decode.bind( + updateCertificateAuthorityMetadata, + ), + ), + updateCertificateRevocationList: + new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCertificateRevocationListResponse.decode.bind( + updateCertificateRevocationListResponse, + ), + updateCertificateRevocationListMetadata.decode.bind( + updateCertificateRevocationListMetadata, + ), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.security.privateca.v1beta1.CertificateAuthorityService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.certificateAuthorityServiceStub) { + return this.certificateAuthorityServiceStub; + } + + // Put together the "service stub" for + // google.cloud.security.privateca.v1beta1.CertificateAuthorityService. + this.certificateAuthorityServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.security.privateca.v1beta1.CertificateAuthorityService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.security.privateca.v1beta1 + .CertificateAuthorityService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const certificateAuthorityServiceStubMethods = [ + 'createCertificate', + 'getCertificate', + 'listCertificates', + 'revokeCertificate', + 'updateCertificate', + 'activateCertificateAuthority', + 'createCertificateAuthority', + 'disableCertificateAuthority', + 'enableCertificateAuthority', + 'fetchCertificateAuthorityCsr', + 'getCertificateAuthority', + 'listCertificateAuthorities', + 'restoreCertificateAuthority', + 'scheduleDeleteCertificateAuthority', + 'updateCertificateAuthority', + 'getCertificateRevocationList', + 'listCertificateRevocationLists', + 'updateCertificateRevocationList', + 'getReusableConfig', + 'listReusableConfigs', + ]; + for (const methodName of certificateAuthorityServiceStubMethods) { + const callPromise = this.certificateAuthorityServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.certificateAuthorityServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'privateca.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'privateca.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Create a new {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} in a given Project, Location from a particular + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location and {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} + * associated with the {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}, in the format + * `projects/* /locations/* /certificateAuthorities/*`. + * @param {string} [request.certificateId] + * Optional. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the Enterprise {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier|CertificateAuthority.Tier}, + * but is optional and its value is ignored otherwise. + * @param {google.cloud.security.privateca.v1beta1.Certificate} request.certificate + * Required. A {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} with initial field values. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.create_certificate.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_async + */ + createCertificate( + request?: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest + | undefined + ), + {} | undefined, + ] + >; + createCertificate( + request: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createCertificate( + request: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createCertificate( + request?: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCertificate response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns a {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The {@link protos.google.cloud.security.privateca.v1beta1.Certificate.name|name} of the {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} 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 {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.get_certificate.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_async + */ + getCertificate( + request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest + | undefined + ), + {} | undefined, + ] + >; + getCertificate( + request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificate( + request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificate( + request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCertificate response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Revoke a {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} in the + * format `projects/* /locations/* /certificateAuthorities/* /certificates/*`. + * @param {google.cloud.security.privateca.v1beta1.RevocationReason} request.reason + * Required. The {@link protos.google.cloud.security.privateca.v1beta1.RevocationReason|RevocationReason} for revoking this certificate. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_async + */ + revokeCertificate( + request?: protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest + | undefined + ), + {} | undefined, + ] + >; + revokeCertificate( + request: protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + revokeCertificate( + request: protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + revokeCertificate( + request?: protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('revokeCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('revokeCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .revokeCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('revokeCertificate response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Update a {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. Currently, the only field you can update is the + * {@link protos.google.cloud.security.privateca.v1beta1.Certificate.labels|labels} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.security.privateca.v1beta1.Certificate} request.certificate + * Required. {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} with updated values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A list of fields to be updated in this request. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.update_certificate.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_async + */ + updateCertificate( + request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest + | undefined + ), + {} | undefined, + ] + >; + updateCertificate( + request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateCertificate( + request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateCertificate( + request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'certificate.name': request.certificate!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificate, + | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1beta1.ICertificate, + ( + | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCertificate response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Fetch a certificate signing request (CSR) from a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} + * that is in state + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION|PENDING_ACTIVATION} and is + * of type {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE|SUBORDINATE}. The CSR must + * then be signed by the desired parent Certificate Authority, which could be + * another {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} resource, or could be an on-prem + * certificate authority. See also {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority|ActivateCertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the + * format `projects/* /locations/* /certificateAuthorities/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse|FetchCertificateAuthorityCsrResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async + */ + fetchCertificateAuthorityCsr( + request?: protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, + ( + | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest + | undefined + ), + {} | undefined, + ] + >; + fetchCertificateAuthorityCsr( + request: protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, + | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + fetchCertificateAuthorityCsr( + request: protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, + | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + fetchCertificateAuthorityCsr( + request?: protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, + | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, + | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, + ( + | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('fetchCertificateAuthorityCsr request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, + | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('fetchCertificateAuthorityCsr response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .fetchCertificateAuthorityCsr(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, + ( + | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('fetchCertificateAuthorityCsr response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.name|name} of the {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} 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 {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_async + */ + getCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest + | undefined + ), + {} | undefined, + ] + >; + getCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getCertificateAuthority request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCertificateAuthority response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCertificateAuthority response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns a {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList.name|name} of the + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList} 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 {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_async + */ + getCertificateRevocationList( + request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest + | undefined + ), + {} | undefined, + ] + >; + getCertificateRevocationList( + request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificateRevocationList( + request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCertificateRevocationList( + request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getCertificateRevocationList request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCertificateRevocationList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCertificateRevocationList(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCertificateRevocationList response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Returns a {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfig}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The {@link protos.ReusableConfigs.name|name} of the {@link protos.|ReusableConfigs} 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 {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_async + */ + getReusableConfig( + request?: protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.IReusableConfig, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest + | undefined + ), + {} | undefined, + ] + >; + getReusableConfig( + request: protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.IReusableConfig, + | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getReusableConfig( + request: protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, + callback: Callback< + protos.google.cloud.security.privateca.v1beta1.IReusableConfig, + | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getReusableConfig( + request?: protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.security.privateca.v1beta1.IReusableConfig, + | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.security.privateca.v1beta1.IReusableConfig, + | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.IReusableConfig, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getReusableConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.security.privateca.v1beta1.IReusableConfig, + | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getReusableConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getReusableConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.security.privateca.v1beta1.IReusableConfig, + ( + | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getReusableConfig response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Activate a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} that is in state + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION|PENDING_ACTIVATION} and is + * of type {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE|SUBORDINATE}. After the + * parent Certificate Authority signs a certificate signing request from + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr|FetchCertificateAuthorityCsr}, this method can complete the activation + * process. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the + * format `projects/* /locations/* /certificateAuthorities/*`. + * @param {string} request.pemCaCertificate + * Required. The signed CA certificate issued from + * {@link protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.pem_csr|FetchCertificateAuthorityCsrResponse.pem_csr}. + * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig} request.subordinateConfig + * Required. Must include information about the issuer of 'pem_ca_certificate', and any + * further issuers until the self-signed CA. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async + */ + activateCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + activateCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + activateCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + activateCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'activateCertificateAuthority response %j', + rawResponse, + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('activateCertificateAuthority request %j', request); + return this.innerApiCalls + .activateCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'activateCertificateAuthority response %j', + rawResponse, + ); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `activateCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async + */ + async checkActivateCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + > + > { + this._log.info('activateCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.activateCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + >; + } + /** + * Create a new {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} 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 + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities}, in the format + * `projects/* /locations/*`. + * @param {string} request.certificateAuthorityId + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority} request.certificateAuthority + * Required. A {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} with initial field values. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_async + */ + createCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCertificateAuthority response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCertificateAuthority request %j', request); + return this.innerApiCalls + .createCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCertificateAuthority response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_async + */ + async checkCreateCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + > + > { + this._log.info('createCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + >; + } + /** + * Disable a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the + * format `projects/* /locations/* /certificateAuthorities/*`. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_async + */ + disableCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + disableCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + disableCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + disableCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'disableCertificateAuthority response %j', + rawResponse, + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('disableCertificateAuthority request %j', request); + return this.innerApiCalls + .disableCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'disableCertificateAuthority response %j', + rawResponse, + ); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `disableCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_async + */ + async checkDisableCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + > + > { + this._log.info('disableCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.disableCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + >; + } + /** + * Enable a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the + * format `projects/* /locations/* /certificateAuthorities/*`. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_async + */ + enableCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + enableCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + enableCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + enableCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('enableCertificateAuthority response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('enableCertificateAuthority request %j', request); + return this.innerApiCalls + .enableCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('enableCertificateAuthority response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `enableCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_async + */ + async checkEnableCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + > + > { + this._log.info('enableCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.enableCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + >; + } + /** + * Restore a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} that is scheduled for deletion. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the + * format `projects/* /locations/* /certificateAuthorities/*`. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_async + */ + restoreCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + restoreCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + restoreCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + restoreCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'restoreCertificateAuthority response %j', + rawResponse, + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreCertificateAuthority request %j', request); + return this.innerApiCalls + .restoreCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'restoreCertificateAuthority response %j', + rawResponse, + ); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `restoreCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_async + */ + async checkRestoreCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + > + > { + this._log.info('restoreCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.restoreCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + >; + } + /** + * Schedule a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} for deletion. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the + * format `projects/* /locations/* /certificateAuthorities/*`. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_async + */ + scheduleDeleteCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + scheduleDeleteCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + scheduleDeleteCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + scheduleDeleteCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'scheduleDeleteCertificateAuthority response %j', + rawResponse, + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('scheduleDeleteCertificateAuthority request %j', request); + return this.innerApiCalls + .scheduleDeleteCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'scheduleDeleteCertificateAuthority response %j', + rawResponse, + ); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `scheduleDeleteCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_async + */ + async checkScheduleDeleteCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + > + > { + this._log.info('scheduleDeleteCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.scheduleDeleteCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + >; + } + /** + * Update a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority} request.certificateAuthority + * Required. {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} with updated values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A list of fields to be updated in this request. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async + */ + updateCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCertificateAuthority( + request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCertificateAuthority( + request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'certificate_authority.name': request.certificateAuthority!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCertificateAuthority response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCertificateAuthority request %j', request); + return this.innerApiCalls + .updateCertificateAuthority(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCertificateAuthority response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateCertificateAuthority()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async + */ + async checkUpdateCertificateAuthorityProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + > + > { + this._log.info('updateCertificateAuthority long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateCertificateAuthority, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + >; + } + /** + * Update a {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList} request.certificateRevocationList + * Required. {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList} with updated values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A list of fields to be updated in this request. + * @param {string} [request.requestId] + * Optional. An ID to identify requests. Specify a unique request ID so that if you must + * retry your request, the server will know to ignore the request if it has + * already been completed. The server will guarantee that for at least 60 + * minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async + */ + updateCertificateRevocationList( + request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateCertificateRevocationList( + request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCertificateRevocationList( + request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, + callback: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCertificateRevocationList( + request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'certificate_revocation_list.name': + request.certificateRevocationList!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'updateCertificateRevocationList response %j', + rawResponse, + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCertificateRevocationList request %j', request); + return this.innerApiCalls + .updateCertificateRevocationList(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'updateCertificateRevocationList response %j', + rawResponse, + ); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateCertificateRevocationList()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async + */ + async checkUpdateCertificateRevocationListProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + > + > { + this._log.info('updateCertificateRevocationList long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateCertificateRevocationList, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.OperationMetadata + >; + } + /** + * Lists {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates}, in the format + * `projects/* /locations/* /certificateauthorities/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} to include in the + * response. Further {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} can subsequently be obtained + * by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For details + * on supported filters and syntax, see [Certificates Filtering + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. For details on supported fields + * and syntax, see [Certificates Sorting + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCertificatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificates( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificate[], + protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse, + ] + >; + listCertificates( + request: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificate + >, + ): void; + listCertificates( + request: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificate + >, + ): void; + listCertificates( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificate + >, + callback?: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificate + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificate[], + protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificate + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCertificates values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCertificates request %j', request); + return this.innerApiCalls + .listCertificates(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.security.privateca.v1beta1.ICertificate[], + protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse, + ]) => { + this._log.info('listCertificates values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listCertificates`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates}, in the format + * `projects/* /locations/* /certificateauthorities/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} to include in the + * response. Further {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} can subsequently be obtained + * by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For details + * on supported filters and syntax, see [Certificates Filtering + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. For details on supported fields + * and syntax, see [Certificates Sorting + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCertificatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificatesStream( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCertificates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificates stream %j', request); + return this.descriptors.page.listCertificates.createStream( + this.innerApiCalls.listCertificates as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listCertificates`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates}, in the format + * `projects/* /locations/* /certificateauthorities/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} to include in the + * response. Further {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} can subsequently be obtained + * by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. For details + * on supported filters and syntax, see [Certificates Filtering + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. For details on supported fields + * and syntax, see [Certificates Sorting + * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.list_certificates.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_async + */ + listCertificatesAsync( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCertificates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificates iterate %j', request); + return this.descriptors.page.listCertificates.asyncIterate( + this.innerApiCalls['listCertificates'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities}, in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} to + * include in the response. + * Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} can subsequently be + * obtained by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCertificateAuthoritiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificateAuthorities( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[], + protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse, + ] + >; + listCertificateAuthorities( + request: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority + >, + ): void; + listCertificateAuthorities( + request: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority + >, + ): void; + listCertificateAuthorities( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority + >, + callback?: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[], + protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCertificateAuthorities values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCertificateAuthorities request %j', request); + return this.innerApiCalls + .listCertificateAuthorities(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[], + protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse, + ]) => { + this._log.info('listCertificateAuthorities values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listCertificateAuthorities`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities}, in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} to + * include in the response. + * Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} can subsequently be + * obtained by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCertificateAuthoritiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificateAuthoritiesStream( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCertificateAuthorities']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificateAuthorities stream %j', request); + return this.descriptors.page.listCertificateAuthorities.createStream( + this.innerApiCalls.listCertificateAuthorities as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listCertificateAuthorities`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities}, in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} to + * include in the response. + * Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} can subsequently be + * obtained by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_async + */ + listCertificateAuthoritiesAsync( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCertificateAuthorities']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificateAuthorities iterate %j', request); + return this.descriptors.page.listCertificateAuthorities.asyncIterate( + this.innerApiCalls['listCertificateAuthorities'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists}, in the format + * `projects/* /locations/* /certificateauthorities/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} to include in the + * response. Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCertificateRevocationListsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificateRevocationLists( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[], + protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse, + ] + >; + listCertificateRevocationLists( + request: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList + >, + ): void; + listCertificateRevocationLists( + request: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList + >, + ): void; + listCertificateRevocationLists( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList + >, + callback?: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[], + protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, + | protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCertificateRevocationLists values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCertificateRevocationLists request %j', request); + return this.innerApiCalls + .listCertificateRevocationLists(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[], + protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse, + ]) => { + this._log.info('listCertificateRevocationLists values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listCertificateRevocationLists`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists}, in the format + * `projects/* /locations/* /certificateauthorities/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} to include in the + * response. Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCertificateRevocationListsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCertificateRevocationListsStream( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = + this._defaults['listCertificateRevocationLists']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificateRevocationLists stream %j', request); + return this.descriptors.page.listCertificateRevocationLists.createStream( + this.innerApiCalls.listCertificateRevocationLists as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listCertificateRevocationLists`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists}, in the format + * `projects/* /locations/* /certificateauthorities/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} to include in the + * response. Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} + * can subsequently be obtained by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} in a subsequent + * request. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async + */ + listCertificateRevocationListsAsync( + request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = + this._defaults['listCertificateRevocationLists']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCertificateRevocationLists iterate %j', request); + return this.descriptors.page.listCertificateRevocationLists.asyncIterate( + this.innerApiCalls['listCertificateRevocationLists'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs}, in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} to include in the response. + * Further {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} can subsequently be + * obtained by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token} in a subsequent request. If + * unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfig}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listReusableConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listReusableConfigs( + request?: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.IReusableConfig[], + protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse, + ] + >; + listReusableConfigs( + request: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, + | protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.IReusableConfig + >, + ): void; + listReusableConfigs( + request: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, + | protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.IReusableConfig + >, + ): void; + listReusableConfigs( + request?: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, + | protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.IReusableConfig + >, + callback?: PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, + | protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.IReusableConfig + >, + ): Promise< + [ + protos.google.cloud.security.privateca.v1beta1.IReusableConfig[], + protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, + | protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse + | null + | undefined, + protos.google.cloud.security.privateca.v1beta1.IReusableConfig + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listReusableConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listReusableConfigs request %j', request); + return this.innerApiCalls + .listReusableConfigs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.security.privateca.v1beta1.IReusableConfig[], + protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest | null, + protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse, + ]) => { + this._log.info('listReusableConfigs values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listReusableConfigs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs}, in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} to include in the response. + * Further {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} can subsequently be + * obtained by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token} in a subsequent request. If + * unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfig} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listReusableConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listReusableConfigsStream( + request?: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listReusableConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listReusableConfigs stream %j', request); + return this.descriptors.page.listReusableConfigs.createStream( + this.innerApiCalls.listReusableConfigs as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listReusableConfigs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location associated with the + * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs}, in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Limit on the number of + * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} to include in the response. + * Further {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} can subsequently be + * obtained by including the + * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token} in a subsequent request. If + * unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. Pagination token, returned earlier via + * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token}. + * @param {string} [request.filter] + * Optional. Only include resources that match the filter in the response. + * @param {string} [request.orderBy] + * Optional. Specify how the results should be sorted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js + * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_async + */ + listReusableConfigsAsync( + request?: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listReusableConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listReusableConfigs iterate %j', request); + return this.descriptors.page.listReusableConfigs.asyncIterate( + this.innerApiCalls['listReusableConfigs'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified certificate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} certificate_authority + * @param {string} certificate + * @returns {string} Resource name string. + */ + certificatePath( + project: string, + location: string, + certificateAuthority: string, + certificate: string, + ) { + return this.pathTemplates.certificatePathTemplate.render({ + project: project, + location: location, + certificate_authority: certificateAuthority, + certificate: certificate, + }); + } + + /** + * Parse the project from Certificate resource. + * + * @param {string} certificateName + * A fully-qualified path representing Certificate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCertificateName(certificateName: string) { + return this.pathTemplates.certificatePathTemplate.match(certificateName) + .project; + } + + /** + * Parse the location from Certificate resource. + * + * @param {string} certificateName + * A fully-qualified path representing Certificate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCertificateName(certificateName: string) { + return this.pathTemplates.certificatePathTemplate.match(certificateName) + .location; + } + + /** + * Parse the certificate_authority from Certificate resource. + * + * @param {string} certificateName + * A fully-qualified path representing Certificate resource. + * @returns {string} A string representing the certificate_authority. + */ + matchCertificateAuthorityFromCertificateName(certificateName: string) { + return this.pathTemplates.certificatePathTemplate.match(certificateName) + .certificate_authority; + } + + /** + * Parse the certificate from Certificate resource. + * + * @param {string} certificateName + * A fully-qualified path representing Certificate resource. + * @returns {string} A string representing the certificate. + */ + matchCertificateFromCertificateName(certificateName: string) { + return this.pathTemplates.certificatePathTemplate.match(certificateName) + .certificate; + } + + /** + * Return a fully-qualified certificateAuthority resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} certificate_authority + * @returns {string} Resource name string. + */ + certificateAuthorityPath( + project: string, + location: string, + certificateAuthority: string, + ) { + return this.pathTemplates.certificateAuthorityPathTemplate.render({ + project: project, + location: location, + certificate_authority: certificateAuthority, + }); + } + + /** + * Parse the project from CertificateAuthority resource. + * + * @param {string} certificateAuthorityName + * A fully-qualified path representing CertificateAuthority resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCertificateAuthorityName(certificateAuthorityName: string) { + return this.pathTemplates.certificateAuthorityPathTemplate.match( + certificateAuthorityName, + ).project; + } + + /** + * Parse the location from CertificateAuthority resource. + * + * @param {string} certificateAuthorityName + * A fully-qualified path representing CertificateAuthority resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCertificateAuthorityName(certificateAuthorityName: string) { + return this.pathTemplates.certificateAuthorityPathTemplate.match( + certificateAuthorityName, + ).location; + } + + /** + * Parse the certificate_authority from CertificateAuthority resource. + * + * @param {string} certificateAuthorityName + * A fully-qualified path representing CertificateAuthority resource. + * @returns {string} A string representing the certificate_authority. + */ + matchCertificateAuthorityFromCertificateAuthorityName( + certificateAuthorityName: string, + ) { + return this.pathTemplates.certificateAuthorityPathTemplate.match( + certificateAuthorityName, + ).certificate_authority; + } + + /** + * Return a fully-qualified certificateRevocationList resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} certificate_authority + * @param {string} certificate_revocation_list + * @returns {string} Resource name string. + */ + certificateRevocationListPath( + project: string, + location: string, + certificateAuthority: string, + certificateRevocationList: string, + ) { + return this.pathTemplates.certificateRevocationListPathTemplate.render({ + project: project, + location: location, + certificate_authority: certificateAuthority, + certificate_revocation_list: certificateRevocationList, + }); + } + + /** + * Parse the project from CertificateRevocationList resource. + * + * @param {string} certificateRevocationListName + * A fully-qualified path representing CertificateRevocationList resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCertificateRevocationListName( + certificateRevocationListName: string, + ) { + return this.pathTemplates.certificateRevocationListPathTemplate.match( + certificateRevocationListName, + ).project; + } + + /** + * Parse the location from CertificateRevocationList resource. + * + * @param {string} certificateRevocationListName + * A fully-qualified path representing CertificateRevocationList resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCertificateRevocationListName( + certificateRevocationListName: string, + ) { + return this.pathTemplates.certificateRevocationListPathTemplate.match( + certificateRevocationListName, + ).location; + } + + /** + * Parse the certificate_authority from CertificateRevocationList resource. + * + * @param {string} certificateRevocationListName + * A fully-qualified path representing CertificateRevocationList resource. + * @returns {string} A string representing the certificate_authority. + */ + matchCertificateAuthorityFromCertificateRevocationListName( + certificateRevocationListName: string, + ) { + return this.pathTemplates.certificateRevocationListPathTemplate.match( + certificateRevocationListName, + ).certificate_authority; + } + + /** + * Parse the certificate_revocation_list from CertificateRevocationList resource. + * + * @param {string} certificateRevocationListName + * A fully-qualified path representing CertificateRevocationList resource. + * @returns {string} A string representing the certificate_revocation_list. + */ + matchCertificateRevocationListFromCertificateRevocationListName( + certificateRevocationListName: string, + ) { + return this.pathTemplates.certificateRevocationListPathTemplate.match( + certificateRevocationListName, + ).certificate_revocation_list; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified reusableConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reusable_config + * @returns {string} Resource name string. + */ + reusableConfigPath( + project: string, + location: string, + reusableConfig: string, + ) { + return this.pathTemplates.reusableConfigPathTemplate.render({ + project: project, + location: location, + reusable_config: reusableConfig, + }); + } + + /** + * Parse the project from ReusableConfig resource. + * + * @param {string} reusableConfigName + * A fully-qualified path representing ReusableConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReusableConfigName(reusableConfigName: string) { + return this.pathTemplates.reusableConfigPathTemplate.match( + reusableConfigName, + ).project; + } + + /** + * Parse the location from ReusableConfig resource. + * + * @param {string} reusableConfigName + * A fully-qualified path representing ReusableConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReusableConfigName(reusableConfigName: string) { + return this.pathTemplates.reusableConfigPathTemplate.match( + reusableConfigName, + ).location; + } + + /** + * Parse the reusable_config from ReusableConfig resource. + * + * @param {string} reusableConfigName + * A fully-qualified path representing ReusableConfig resource. + * @returns {string} A string representing the reusable_config. + */ + matchReusableConfigFromReusableConfigName(reusableConfigName: string) { + return this.pathTemplates.reusableConfigPathTemplate.match( + reusableConfigName, + ).reusable_config; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.certificateAuthorityServiceStub && !this._terminated) { + return this.certificateAuthorityServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client_config.json b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client_config.json new file mode 100644 index 000000000000..76b91dd1bea6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client_config.json @@ -0,0 +1,131 @@ +{ + "interfaces": { + "google.cloud.security.privateca.v1beta1.CertificateAuthorityService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unknown_deadline_exceeded_unavailable": [ + "UNKNOWN", + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "GetCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ListCertificates": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "RevokeCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "UpdateCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ActivateCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "CreateCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "DisableCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "EnableCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "FetchCertificateAuthorityCsr": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "GetCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ListCertificateAuthorities": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "RestoreCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ScheduleDeleteCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "UpdateCertificateAuthority": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "GetCertificateRevocationList": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ListCertificateRevocationLists": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "UpdateCertificateRevocationList": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "GetReusableConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + }, + "ListReusableConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_proto_list.json b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_proto_list.json new file mode 100644 index 000000000000..746af9091f33 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/security/privateca/v1beta1/resources.proto", + "../../protos/google/cloud/security/privateca/v1beta1/service.proto" +] diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..79c7f392e86f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/gapic_metadata.json @@ -0,0 +1,239 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.security.privateca.v1beta1", + "libraryPackage": "@google-cloud/security-private-ca", + "services": { + "CertificateAuthorityService": { + "clients": { + "grpc": { + "libraryClient": "CertificateAuthorityServiceClient", + "rpcs": { + "CreateCertificate": { + "methods": [ + "createCertificate" + ] + }, + "GetCertificate": { + "methods": [ + "getCertificate" + ] + }, + "RevokeCertificate": { + "methods": [ + "revokeCertificate" + ] + }, + "UpdateCertificate": { + "methods": [ + "updateCertificate" + ] + }, + "FetchCertificateAuthorityCsr": { + "methods": [ + "fetchCertificateAuthorityCsr" + ] + }, + "GetCertificateAuthority": { + "methods": [ + "getCertificateAuthority" + ] + }, + "GetCertificateRevocationList": { + "methods": [ + "getCertificateRevocationList" + ] + }, + "GetReusableConfig": { + "methods": [ + "getReusableConfig" + ] + }, + "ActivateCertificateAuthority": { + "methods": [ + "activateCertificateAuthority" + ] + }, + "CreateCertificateAuthority": { + "methods": [ + "createCertificateAuthority" + ] + }, + "DisableCertificateAuthority": { + "methods": [ + "disableCertificateAuthority" + ] + }, + "EnableCertificateAuthority": { + "methods": [ + "enableCertificateAuthority" + ] + }, + "RestoreCertificateAuthority": { + "methods": [ + "restoreCertificateAuthority" + ] + }, + "ScheduleDeleteCertificateAuthority": { + "methods": [ + "scheduleDeleteCertificateAuthority" + ] + }, + "UpdateCertificateAuthority": { + "methods": [ + "updateCertificateAuthority" + ] + }, + "UpdateCertificateRevocationList": { + "methods": [ + "updateCertificateRevocationList" + ] + }, + "ListCertificates": { + "methods": [ + "listCertificates", + "listCertificatesStream", + "listCertificatesAsync" + ] + }, + "ListCertificateAuthorities": { + "methods": [ + "listCertificateAuthorities", + "listCertificateAuthoritiesStream", + "listCertificateAuthoritiesAsync" + ] + }, + "ListCertificateRevocationLists": { + "methods": [ + "listCertificateRevocationLists", + "listCertificateRevocationListsStream", + "listCertificateRevocationListsAsync" + ] + }, + "ListReusableConfigs": { + "methods": [ + "listReusableConfigs", + "listReusableConfigsStream", + "listReusableConfigsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CertificateAuthorityServiceClient", + "rpcs": { + "CreateCertificate": { + "methods": [ + "createCertificate" + ] + }, + "GetCertificate": { + "methods": [ + "getCertificate" + ] + }, + "RevokeCertificate": { + "methods": [ + "revokeCertificate" + ] + }, + "UpdateCertificate": { + "methods": [ + "updateCertificate" + ] + }, + "FetchCertificateAuthorityCsr": { + "methods": [ + "fetchCertificateAuthorityCsr" + ] + }, + "GetCertificateAuthority": { + "methods": [ + "getCertificateAuthority" + ] + }, + "GetCertificateRevocationList": { + "methods": [ + "getCertificateRevocationList" + ] + }, + "GetReusableConfig": { + "methods": [ + "getReusableConfig" + ] + }, + "ActivateCertificateAuthority": { + "methods": [ + "activateCertificateAuthority" + ] + }, + "CreateCertificateAuthority": { + "methods": [ + "createCertificateAuthority" + ] + }, + "DisableCertificateAuthority": { + "methods": [ + "disableCertificateAuthority" + ] + }, + "EnableCertificateAuthority": { + "methods": [ + "enableCertificateAuthority" + ] + }, + "RestoreCertificateAuthority": { + "methods": [ + "restoreCertificateAuthority" + ] + }, + "ScheduleDeleteCertificateAuthority": { + "methods": [ + "scheduleDeleteCertificateAuthority" + ] + }, + "UpdateCertificateAuthority": { + "methods": [ + "updateCertificateAuthority" + ] + }, + "UpdateCertificateRevocationList": { + "methods": [ + "updateCertificateRevocationList" + ] + }, + "ListCertificates": { + "methods": [ + "listCertificates", + "listCertificatesStream", + "listCertificatesAsync" + ] + }, + "ListCertificateAuthorities": { + "methods": [ + "listCertificateAuthorities", + "listCertificateAuthoritiesStream", + "listCertificateAuthoritiesAsync" + ] + }, + "ListCertificateRevocationLists": { + "methods": [ + "listCertificateRevocationLists", + "listCertificateRevocationListsStream", + "listCertificateRevocationListsAsync" + ] + }, + "ListReusableConfigs": { + "methods": [ + "listReusableConfigs", + "listReusableConfigsStream", + "listReusableConfigsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/index.ts b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/index.ts new file mode 100644 index 000000000000..47de88d5715f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export { CertificateAuthorityServiceClient } from './certificate_authority_service_client'; diff --git a/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..1f15aaa53805 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const privateca = require('@google-cloud/security-private-ca'); + +function main() { + const certificateAuthorityServiceClient = new privateca.CertificateAuthorityServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..8a0f1aa9f773 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,37 @@ +// Copyright 2026 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 { CertificateAuthorityServiceClient } from '@google-cloud/security-private-ca'; + +// check that the client class type name can be used +function doStuffWithCertificateAuthorityServiceClient( + client: CertificateAuthorityServiceClient, +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const certificateAuthorityServiceClient = + new CertificateAuthorityServiceClient(); + doStuffWithCertificateAuthorityServiceClient( + certificateAuthorityServiceClient, + ); +} + +main(); diff --git a/owl-bot-staging/google-cloud-security-privateca/system-test/install.ts b/owl-bot-staging/google-cloud-security-privateca/system-test/install.ts new file mode 100644 index 000000000000..ccf167042d2e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts', + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + cjs: readFileSync( + './system-test/fixtures/sample/src/index.js', + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1.ts b/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1.ts new file mode 100644 index 000000000000..49fc8508f424 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1.ts @@ -0,0 +1,8138 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as certificateauthorityserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.CertificateAuthorityServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'privateca.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient + .servicePath; + assert.strictEqual(servicePath, 'privateca.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'privateca.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { universeDomain: 'example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'privateca.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { universe_domain: 'example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'privateca.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'privateca.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { universeDomain: 'configured.example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'privateca.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { universe_domain: 'example.com', universeDomain: 'example.net' }, + ); + }); + }); + + it('has port', () => { + const port = + certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + fallback: true, + }, + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + assert.strictEqual(client.certificateAuthorityServiceStub, undefined); + await client.initialize(); + assert(client.certificateAuthorityServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + client.initialize().catch((err) => { + throw err; + }); + assert(client.certificateAuthorityServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + assert.strictEqual(client.certificateAuthorityServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createCertificate', () => { + it('invokes createCertificate without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ); + client.innerApiCalls.createCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.createCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ); + client.innerApiCalls.createCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCertificate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1.ICertificate | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificate with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificate = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificate with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createCertificate(request), expectedError); + }); + }); + + describe('getCertificate', () => { + it('invokes getCertificate without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ); + client.innerApiCalls.getCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.getCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ); + client.innerApiCalls.getCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCertificate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1.ICertificate | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificate with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCertificate = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificate with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getCertificate(request), expectedError); + }); + }); + + describe('revokeCertificate', () => { + it('invokes revokeCertificate without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.RevokeCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.RevokeCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ); + client.innerApiCalls.revokeCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.revokeCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes revokeCertificate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.RevokeCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.RevokeCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ); + client.innerApiCalls.revokeCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.revokeCertificate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1.ICertificate | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes revokeCertificate with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.RevokeCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.RevokeCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.revokeCertificate = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.revokeCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes revokeCertificate with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.RevokeCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.RevokeCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.revokeCertificate(request), expectedError); + }); + }); + + describe('updateCertificate', () => { + it('invokes updateCertificate without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateRequest(), + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateRequest', + ['certificate', 'name'], + ); + request.certificate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ); + client.innerApiCalls.updateCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.updateCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateRequest(), + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateRequest', + ['certificate', 'name'], + ); + request.certificate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ); + client.innerApiCalls.updateCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCertificate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1.ICertificate | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificate with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateRequest(), + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateRequest', + ['certificate', 'name'], + ); + request.certificate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificate = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificate with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateRequest(), + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateRequest', + ['certificate', 'name'], + ); + request.certificate.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateCertificate(request), expectedError); + }); + }); + + describe('fetchCertificateAuthorityCsr', () => { + it('invokes fetchCertificateAuthorityCsr without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse(), + ); + client.innerApiCalls.fetchCertificateAuthorityCsr = + stubSimpleCall(expectedResponse); + const [response] = await client.fetchCertificateAuthorityCsr(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchCertificateAuthorityCsr without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse(), + ); + client.innerApiCalls.fetchCertificateAuthorityCsr = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchCertificateAuthorityCsr( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchCertificateAuthorityCsr with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchCertificateAuthorityCsr = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.fetchCertificateAuthorityCsr(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchCertificateAuthorityCsr with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.fetchCertificateAuthorityCsr(request), + expectedError, + ); + }); + }); + + describe('getCertificateAuthority', () => { + it('invokes getCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ); + client.innerApiCalls.getCertificateAuthority = + stubSimpleCall(expectedResponse); + const [response] = await client.getCertificateAuthority(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ); + client.innerApiCalls.getCertificateAuthority = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCertificateAuthority( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1.ICertificateAuthority | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateAuthority with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCertificateAuthority = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateAuthority with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getCertificateAuthority(request), + expectedError, + ); + }); + }); + + describe('getCaPool', () => { + it('invokes getCaPool without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCaPoolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ); + client.innerApiCalls.getCaPool = stubSimpleCall(expectedResponse); + const [response] = await client.getCaPool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCaPool without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCaPoolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ); + client.innerApiCalls.getCaPool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCaPool( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1.ICaPool | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCaPool with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCaPoolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCaPool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCaPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCaPool with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCaPoolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getCaPool(request), expectedError); + }); + }); + + describe('fetchCaCerts', () => { + it('invokes fetchCaCerts without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCaCertsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.FetchCaCertsRequest', + ['caPool'], + ); + request.caPool = defaultValue1; + const expectedHeaderRequestParams = `ca_pool=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCaCertsResponse(), + ); + client.innerApiCalls.fetchCaCerts = stubSimpleCall(expectedResponse); + const [response] = await client.fetchCaCerts(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchCaCerts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchCaCerts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchCaCerts without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCaCertsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.FetchCaCertsRequest', + ['caPool'], + ); + request.caPool = defaultValue1; + const expectedHeaderRequestParams = `ca_pool=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCaCertsResponse(), + ); + client.innerApiCalls.fetchCaCerts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchCaCerts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchCaCerts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchCaCerts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchCaCerts with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCaCertsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.FetchCaCertsRequest', + ['caPool'], + ); + request.caPool = defaultValue1; + const expectedHeaderRequestParams = `ca_pool=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchCaCerts = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.fetchCaCerts(request), expectedError); + const actualRequest = ( + client.innerApiCalls.fetchCaCerts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchCaCerts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchCaCerts with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.FetchCaCertsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.FetchCaCertsRequest', + ['caPool'], + ); + request.caPool = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.fetchCaCerts(request), expectedError); + }); + }); + + describe('getCertificateRevocationList', () => { + it('invokes getCertificateRevocationList without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ); + client.innerApiCalls.getCertificateRevocationList = + stubSimpleCall(expectedResponse); + const [response] = await client.getCertificateRevocationList(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateRevocationList without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ); + client.innerApiCalls.getCertificateRevocationList = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCertificateRevocationList( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1.ICertificateRevocationList | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateRevocationList with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCertificateRevocationList = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getCertificateRevocationList(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateRevocationList with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getCertificateRevocationList(request), + expectedError, + ); + }); + }); + + describe('getCertificateTemplate', () => { + it('invokes getCertificateTemplate without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateTemplateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ); + client.innerApiCalls.getCertificateTemplate = + stubSimpleCall(expectedResponse); + const [response] = await client.getCertificateTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateTemplate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateTemplateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ); + client.innerApiCalls.getCertificateTemplate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCertificateTemplate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1.ICertificateTemplate | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateTemplate with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateTemplateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCertificateTemplate = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getCertificateTemplate(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateTemplate with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.GetCertificateTemplateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getCertificateTemplate(request), + expectedError, + ); + }); + }); + + describe('activateCertificateAuthority', () => { + it('invokes activateCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.activateCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.activateCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes activateCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.activateCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.activateCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes activateCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.activateCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.activateCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes activateCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.activateCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.activateCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkActivateCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkActivateCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkActivateCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkActivateCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCertificateAuthority', () => { + it('invokes createCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkCreateCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('disableCertificateAuthority', () => { + it('invokes disableCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.disableCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.disableCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.disableCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disableCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.disableCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.disableCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.disableCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.disableCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDisableCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkDisableCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDisableCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkDisableCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('enableCertificateAuthority', () => { + it('invokes enableCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.enableCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.enableCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.enableCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enableCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enableCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.enableCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enableCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.enableCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkEnableCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkEnableCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkEnableCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkEnableCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('undeleteCertificateAuthority', () => { + it('invokes undeleteCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.undeleteCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.undeleteCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.undeleteCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeleteCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.undeleteCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.undeleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.undeleteCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.undeleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeleteCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUndeleteCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeleteCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUndeleteCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteCertificateAuthority', () => { + it('invokes deleteCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deleteCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkDeleteCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkDeleteCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCertificateAuthority', () => { + it('invokes updateCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(), + ); + request.certificateAuthority ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest', + ['certificateAuthority', 'name'], + ); + request.certificateAuthority.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(), + ); + request.certificateAuthority ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest', + ['certificateAuthority', 'name'], + ); + request.certificateAuthority.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(), + ); + request.certificateAuthority ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest', + ['certificateAuthority', 'name'], + ); + request.certificateAuthority.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(), + ); + request.certificateAuthority ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest', + ['certificateAuthority', 'name'], + ); + request.certificateAuthority.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCaPool', () => { + it('invokes createCaPool without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCaPoolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCaPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.createCaPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCaPool without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCaPoolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCaPool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCaPool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCaPool with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCaPoolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCaPool = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createCaPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCaPool with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCaPoolRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCaPool = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createCaPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCaPoolProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateCaPoolProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCaPoolProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkCreateCaPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCaPool', () => { + it('invokes updateCaPool without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCaPoolRequest(), + ); + request.caPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCaPoolRequest', + ['caPool', 'name'], + ); + request.caPool.name = defaultValue1; + const expectedHeaderRequestParams = `ca_pool.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCaPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCaPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCaPool without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCaPoolRequest(), + ); + request.caPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCaPoolRequest', + ['caPool', 'name'], + ); + request.caPool.name = defaultValue1; + const expectedHeaderRequestParams = `ca_pool.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCaPool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCaPool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICaPool, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCaPool with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCaPoolRequest(), + ); + request.caPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCaPoolRequest', + ['caPool', 'name'], + ); + request.caPool.name = defaultValue1; + const expectedHeaderRequestParams = `ca_pool.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCaPool = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateCaPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCaPool with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCaPoolRequest(), + ); + request.caPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCaPoolRequest', + ['caPool', 'name'], + ); + request.caPool.name = defaultValue1; + const expectedHeaderRequestParams = `ca_pool.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCaPool = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateCaPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCaPoolProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateCaPoolProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCaPoolProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkUpdateCaPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteCaPool', () => { + it('invokes deleteCaPool without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCaPoolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteCaPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCaPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCaPool without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCaPoolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteCaPool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCaPool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCaPool with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCaPoolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCaPool = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteCaPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCaPool with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCaPoolRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCaPoolRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCaPool = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteCaPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCaPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCaPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteCaPoolProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteCaPoolProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCaPoolProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkDeleteCaPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCertificateRevocationList', () => { + it('invokes updateCertificateRevocationList without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(), + ); + request.certificateRevocationList ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest', + ['certificateRevocationList', 'name'], + ); + request.certificateRevocationList.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCertificateRevocationList = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCertificateRevocationList(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateRevocationList without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(), + ); + request.certificateRevocationList ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest', + ['certificateRevocationList', 'name'], + ); + request.certificateRevocationList.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCertificateRevocationList = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCertificateRevocationList( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateRevocationList with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(), + ); + request.certificateRevocationList ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest', + ['certificateRevocationList', 'name'], + ); + request.certificateRevocationList.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateRevocationList = + stubLongRunningCall(undefined, expectedError); + await assert.rejects( + client.updateCertificateRevocationList(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateRevocationList with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(), + ); + request.certificateRevocationList ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest', + ['certificateRevocationList', 'name'], + ); + request.certificateRevocationList.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateRevocationList = + stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateCertificateRevocationList(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCertificateRevocationListProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateCertificateRevocationListProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCertificateRevocationListProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateCertificateRevocationListProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCertificateTemplate', () => { + it('invokes createCertificateTemplate without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCertificateTemplate = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCertificateTemplate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateTemplate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCertificateTemplate = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCertificateTemplate( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateTemplate with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateTemplate = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createCertificateTemplate(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateTemplate with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateTemplate = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createCertificateTemplate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCertificateTemplateProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkCreateCertificateTemplateProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCertificateTemplateProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateCertificateTemplateProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteCertificateTemplate', () => { + it('invokes deleteCertificateTemplate without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteCertificateTemplate = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCertificateTemplate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateTemplate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteCertificateTemplate = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCertificateTemplate( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateTemplate with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificateTemplate = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deleteCertificateTemplate(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deleteCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateTemplate with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificateTemplate = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteCertificateTemplate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteCertificateTemplateProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkDeleteCertificateTemplateProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCertificateTemplateProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkDeleteCertificateTemplateProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCertificateTemplate', () => { + it('invokes updateCertificateTemplate without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(), + ); + request.certificateTemplate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest', + ['certificateTemplate', 'name'], + ); + request.certificateTemplate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_template.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCertificateTemplate = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCertificateTemplate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateTemplate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(), + ); + request.certificateTemplate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest', + ['certificateTemplate', 'name'], + ); + request.certificateTemplate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_template.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCertificateTemplate = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCertificateTemplate( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1.ICertificateTemplate, + protos.google.cloud.security.privateca.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateTemplate with call error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(), + ); + request.certificateTemplate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest', + ['certificateTemplate', 'name'], + ); + request.certificateTemplate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_template.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateTemplate = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateCertificateTemplate(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateTemplate with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(), + ); + request.certificateTemplate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest', + ['certificateTemplate', 'name'], + ); + request.certificateTemplate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_template.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateTemplate = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateCertificateTemplate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificateTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCertificateTemplateProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateCertificateTemplateProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCertificateTemplateProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateCertificateTemplateProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listCertificates', () => { + it('invokes listCertificates without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + ]; + client.innerApiCalls.listCertificates = stubSimpleCall(expectedResponse); + const [response] = await client.listCertificates(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificates without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + ]; + client.innerApiCalls.listCertificates = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCertificates( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.security.privateca.v1.ICertificate[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificates with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCertificates = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listCertificates(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificatesStream without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + ]; + client.descriptors.page.listCertificates.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCertificatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1.Certificate[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.security.privateca.v1.Certificate) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listCertificates.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificates, request), + ); + assert( + (client.descriptors.page.listCertificates.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listCertificatesStream with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificates.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCertificatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1.Certificate[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.security.privateca.v1.Certificate) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCertificates.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificates, request), + ); + assert( + (client.descriptors.page.listCertificates.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listCertificates without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.Certificate(), + ), + ]; + client.descriptors.page.listCertificates.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.security.privateca.v1.ICertificate[] = + []; + const iterable = client.listCertificatesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificates.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listCertificates.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listCertificates with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificates.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCertificatesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.security.privateca.v1.ICertificate[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificates.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listCertificates.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listCertificateAuthorities', () => { + it('invokes listCertificateAuthorities without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + ]; + client.innerApiCalls.listCertificateAuthorities = + stubSimpleCall(expectedResponse); + const [response] = await client.listCertificateAuthorities(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateAuthorities without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + ]; + client.innerApiCalls.listCertificateAuthorities = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCertificateAuthorities( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.security.privateca.v1.ICertificateAuthority[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateAuthorities with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCertificateAuthorities = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listCertificateAuthorities(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateAuthoritiesStream without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + ]; + client.descriptors.page.listCertificateAuthorities.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCertificateAuthoritiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1.CertificateAuthority[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1.CertificateAuthority, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificateAuthorities, request), + ); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listCertificateAuthoritiesStream with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateAuthorities.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCertificateAuthoritiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1.CertificateAuthority[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1.CertificateAuthority, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificateAuthorities, request), + ); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listCertificateAuthorities without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateAuthority(), + ), + ]; + client.descriptors.page.listCertificateAuthorities.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.security.privateca.v1.ICertificateAuthority[] = + []; + const iterable = client.listCertificateAuthoritiesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateAuthorities + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listCertificateAuthorities with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateAuthorities.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCertificateAuthoritiesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.security.privateca.v1.ICertificateAuthority[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateAuthorities + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('listCaPools', () => { + it('invokes listCaPools without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCaPoolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + ]; + client.innerApiCalls.listCaPools = stubSimpleCall(expectedResponse); + const [response] = await client.listCaPools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCaPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCaPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCaPools without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCaPoolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + ]; + client.innerApiCalls.listCaPools = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCaPools( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1.ICaPool[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCaPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCaPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCaPools with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCaPoolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCaPools = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listCaPools(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCaPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCaPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCaPoolsStream without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCaPoolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + ]; + client.descriptors.page.listCaPools.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCaPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1.CaPool[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.security.privateca.v1.CaPool) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listCaPools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCaPools, request), + ); + assert( + (client.descriptors.page.listCaPools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listCaPoolsStream with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCaPoolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCaPools.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listCaPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1.CaPool[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.security.privateca.v1.CaPool) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCaPools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCaPools, request), + ); + assert( + (client.descriptors.page.listCaPools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listCaPools without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCaPoolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CaPool(), + ), + ]; + client.descriptors.page.listCaPools.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.security.privateca.v1.ICaPool[] = []; + const iterable = client.listCaPoolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCaPools.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listCaPools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listCaPools with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCaPoolsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCaPools.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listCaPoolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.security.privateca.v1.ICaPool[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCaPools.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listCaPools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listCertificateRevocationLists', () => { + it('invokes listCertificateRevocationLists without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + ]; + client.innerApiCalls.listCertificateRevocationLists = + stubSimpleCall(expectedResponse); + const [response] = await client.listCertificateRevocationLists(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateRevocationLists without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + ]; + client.innerApiCalls.listCertificateRevocationLists = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCertificateRevocationLists( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.security.privateca.v1.ICertificateRevocationList[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateRevocationLists with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCertificateRevocationLists = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listCertificateRevocationLists(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateRevocationListsStream without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + ]; + client.descriptors.page.listCertificateRevocationLists.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCertificateRevocationListsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1.CertificateRevocationList[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1.CertificateRevocationList, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listCertificateRevocationLists, + request, + ), + ); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listCertificateRevocationListsStream with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateRevocationLists.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCertificateRevocationListsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1.CertificateRevocationList[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1.CertificateRevocationList, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listCertificateRevocationLists, + request, + ), + ); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listCertificateRevocationLists without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), + ), + ]; + client.descriptors.page.listCertificateRevocationLists.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.security.privateca.v1.ICertificateRevocationList[] = + []; + const iterable = client.listCertificateRevocationListsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateRevocationLists + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listCertificateRevocationLists with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateRevocationLists.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCertificateRevocationListsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.security.privateca.v1.ICertificateRevocationList[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateRevocationLists + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('listCertificateTemplates', () => { + it('invokes listCertificateTemplates without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + ]; + client.innerApiCalls.listCertificateTemplates = + stubSimpleCall(expectedResponse); + const [response] = await client.listCertificateTemplates(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateTemplates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateTemplates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateTemplates without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + ]; + client.innerApiCalls.listCertificateTemplates = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCertificateTemplates( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.security.privateca.v1.ICertificateTemplate[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateTemplates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateTemplates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateTemplates with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCertificateTemplates = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listCertificateTemplates(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listCertificateTemplates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateTemplates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateTemplatesStream without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + ]; + client.descriptors.page.listCertificateTemplates.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCertificateTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1.CertificateTemplate[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1.CertificateTemplate, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listCertificateTemplates + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificateTemplates, request), + ); + assert( + ( + client.descriptors.page.listCertificateTemplates + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listCertificateTemplatesStream with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateTemplates.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCertificateTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1.CertificateTemplate[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1.CertificateTemplate, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listCertificateTemplates + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificateTemplates, request), + ); + assert( + ( + client.descriptors.page.listCertificateTemplates + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listCertificateTemplates without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1.CertificateTemplate(), + ), + ]; + client.descriptors.page.listCertificateTemplates.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.security.privateca.v1.ICertificateTemplate[] = + []; + const iterable = client.listCertificateTemplatesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateTemplates + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listCertificateTemplates + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listCertificateTemplates with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateTemplates.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCertificateTemplatesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.security.privateca.v1.ICertificateTemplate[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateTemplates + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listCertificateTemplates + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions, + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + }); + + describe('Path templates', () => { + describe('caPool', async () => { + const fakePath = '/rendered/path/caPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + ca_pool: 'caPoolValue', + }; + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.caPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.caPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('caPoolPath', () => { + const result = client.caPoolPath( + 'projectValue', + 'locationValue', + 'caPoolValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.caPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromCaPoolName', () => { + const result = client.matchProjectFromCaPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.caPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCaPoolName', () => { + const result = client.matchLocationFromCaPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.caPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCaPoolFromCaPoolName', () => { + const result = client.matchCaPoolFromCaPoolName(fakePath); + assert.strictEqual(result, 'caPoolValue'); + assert( + (client.pathTemplates.caPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('certificate', async () => { + const fakePath = '/rendered/path/certificate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + ca_pool: 'caPoolValue', + certificate: 'certificateValue', + }; + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.certificatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.certificatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('certificatePath', () => { + const result = client.certificatePath( + 'projectValue', + 'locationValue', + 'caPoolValue', + 'certificateValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.certificatePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromCertificateName', () => { + const result = client.matchProjectFromCertificateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.certificatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCertificateName', () => { + const result = client.matchLocationFromCertificateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.certificatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCaPoolFromCertificateName', () => { + const result = client.matchCaPoolFromCertificateName(fakePath); + assert.strictEqual(result, 'caPoolValue'); + assert( + (client.pathTemplates.certificatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCertificateFromCertificateName', () => { + const result = client.matchCertificateFromCertificateName(fakePath); + assert.strictEqual(result, 'certificateValue'); + assert( + (client.pathTemplates.certificatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('certificateAuthority', async () => { + const fakePath = '/rendered/path/certificateAuthority'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + ca_pool: 'caPoolValue', + certificate_authority: 'certificateAuthorityValue', + }; + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.certificateAuthorityPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.certificateAuthorityPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('certificateAuthorityPath', () => { + const result = client.certificateAuthorityPath( + 'projectValue', + 'locationValue', + 'caPoolValue', + 'certificateAuthorityValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.certificateAuthorityPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromCertificateAuthorityName', () => { + const result = + client.matchProjectFromCertificateAuthorityName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.certificateAuthorityPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCertificateAuthorityName', () => { + const result = + client.matchLocationFromCertificateAuthorityName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.certificateAuthorityPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCaPoolFromCertificateAuthorityName', () => { + const result = client.matchCaPoolFromCertificateAuthorityName(fakePath); + assert.strictEqual(result, 'caPoolValue'); + assert( + ( + client.pathTemplates.certificateAuthorityPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCertificateAuthorityFromCertificateAuthorityName', () => { + const result = + client.matchCertificateAuthorityFromCertificateAuthorityName( + fakePath, + ); + assert.strictEqual(result, 'certificateAuthorityValue'); + assert( + ( + client.pathTemplates.certificateAuthorityPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('certificateRevocationList', async () => { + const fakePath = '/rendered/path/certificateRevocationList'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + ca_pool: 'caPoolValue', + certificate_authority: 'certificateAuthorityValue', + certificate_revocation_list: 'certificateRevocationListValue', + }; + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.certificateRevocationListPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.certificateRevocationListPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('certificateRevocationListPath', () => { + const result = client.certificateRevocationListPath( + 'projectValue', + 'locationValue', + 'caPoolValue', + 'certificateAuthorityValue', + 'certificateRevocationListValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.certificateRevocationListPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromCertificateRevocationListName', () => { + const result = + client.matchProjectFromCertificateRevocationListName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.certificateRevocationListPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCertificateRevocationListName', () => { + const result = + client.matchLocationFromCertificateRevocationListName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.certificateRevocationListPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCaPoolFromCertificateRevocationListName', () => { + const result = + client.matchCaPoolFromCertificateRevocationListName(fakePath); + assert.strictEqual(result, 'caPoolValue'); + assert( + ( + client.pathTemplates.certificateRevocationListPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCertificateAuthorityFromCertificateRevocationListName', () => { + const result = + client.matchCertificateAuthorityFromCertificateRevocationListName( + fakePath, + ); + assert.strictEqual(result, 'certificateAuthorityValue'); + assert( + ( + client.pathTemplates.certificateRevocationListPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCertificateRevocationListFromCertificateRevocationListName', () => { + const result = + client.matchCertificateRevocationListFromCertificateRevocationListName( + fakePath, + ); + assert.strictEqual(result, 'certificateRevocationListValue'); + assert( + ( + client.pathTemplates.certificateRevocationListPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('certificateTemplate', async () => { + const fakePath = '/rendered/path/certificateTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + certificate_template: 'certificateTemplateValue', + }; + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.certificateTemplatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.certificateTemplatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('certificateTemplatePath', () => { + const result = client.certificateTemplatePath( + 'projectValue', + 'locationValue', + 'certificateTemplateValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.certificateTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromCertificateTemplateName', () => { + const result = client.matchProjectFromCertificateTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.certificateTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCertificateTemplateName', () => { + const result = + client.matchLocationFromCertificateTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.certificateTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCertificateTemplateFromCertificateTemplateName', () => { + const result = + client.matchCertificateTemplateFromCertificateTemplateName(fakePath); + assert.strictEqual(result, 'certificateTemplateValue'); + assert( + ( + client.pathTemplates.certificateTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts b/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts new file mode 100644 index 000000000000..2c08e1f6e051 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts @@ -0,0 +1,5151 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as certificateauthorityserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LROperation, operationsProtos } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.CertificateAuthorityServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'privateca.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + certificateauthorityserviceModule.v1beta1 + .CertificateAuthorityServiceClient.servicePath; + assert.strictEqual(servicePath, 'privateca.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + certificateauthorityserviceModule.v1beta1 + .CertificateAuthorityServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'privateca.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { universeDomain: 'example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'privateca.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { universe_domain: 'example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'privateca.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'privateca.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { universeDomain: 'configured.example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'privateca.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { universe_domain: 'example.com', universeDomain: 'example.net' }, + ); + }); + }); + + it('has port', () => { + const port = + certificateauthorityserviceModule.v1beta1 + .CertificateAuthorityServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + fallback: true, + }, + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + assert.strictEqual(client.certificateAuthorityServiceStub, undefined); + await client.initialize(); + assert(client.certificateAuthorityServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + client.initialize().catch((err) => { + throw err; + }); + assert(client.certificateAuthorityServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + assert.strictEqual(client.certificateAuthorityServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createCertificate', () => { + it('invokes createCertificate without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.CreateCertificateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ); + client.innerApiCalls.createCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.createCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.CreateCertificateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ); + client.innerApiCalls.createCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCertificate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1beta1.ICertificate | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificate with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.CreateCertificateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificate = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificate with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.CreateCertificateRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createCertificate(request), expectedError); + }); + }); + + describe('getCertificate', () => { + it('invokes getCertificate without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ); + client.innerApiCalls.getCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.getCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ); + client.innerApiCalls.getCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCertificate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1beta1.ICertificate | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificate with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCertificate = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificate with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getCertificate(request), expectedError); + }); + }); + + describe('revokeCertificate', () => { + it('invokes revokeCertificate without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ); + client.innerApiCalls.revokeCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.revokeCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes revokeCertificate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ); + client.innerApiCalls.revokeCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.revokeCertificate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1beta1.ICertificate | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes revokeCertificate with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.revokeCertificate = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.revokeCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.revokeCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes revokeCertificate with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.revokeCertificate(request), expectedError); + }); + }); + + describe('updateCertificate', () => { + it('invokes updateCertificate without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(), + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest', + ['certificate', 'name'], + ); + request.certificate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ); + client.innerApiCalls.updateCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.updateCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificate without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(), + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest', + ['certificate', 'name'], + ); + request.certificate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ); + client.innerApiCalls.updateCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCertificate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1beta1.ICertificate | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificate with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(), + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest', + ['certificate', 'name'], + ); + request.certificate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificate = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificate with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(), + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest', + ['certificate', 'name'], + ); + request.certificate.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateCertificate(request), expectedError); + }); + }); + + describe('fetchCertificateAuthorityCsr', () => { + it('invokes fetchCertificateAuthorityCsr without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse(), + ); + client.innerApiCalls.fetchCertificateAuthorityCsr = + stubSimpleCall(expectedResponse); + const [response] = await client.fetchCertificateAuthorityCsr(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchCertificateAuthorityCsr without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse(), + ); + client.innerApiCalls.fetchCertificateAuthorityCsr = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchCertificateAuthorityCsr( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchCertificateAuthorityCsr with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchCertificateAuthorityCsr = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.fetchCertificateAuthorityCsr(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchCertificateAuthorityCsr with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.fetchCertificateAuthorityCsr(request), + expectedError, + ); + }); + }); + + describe('getCertificateAuthority', () => { + it('invokes getCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ); + client.innerApiCalls.getCertificateAuthority = + stubSimpleCall(expectedResponse); + const [response] = await client.getCertificateAuthority(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ); + client.innerApiCalls.getCertificateAuthority = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCertificateAuthority( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateAuthority with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCertificateAuthority = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateAuthority with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getCertificateAuthority(request), + expectedError, + ); + }); + }); + + describe('getCertificateRevocationList', () => { + it('invokes getCertificateRevocationList without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ); + client.innerApiCalls.getCertificateRevocationList = + stubSimpleCall(expectedResponse); + const [response] = await client.getCertificateRevocationList(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateRevocationList without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ); + client.innerApiCalls.getCertificateRevocationList = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCertificateRevocationList( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateRevocationList with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCertificateRevocationList = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getCertificateRevocationList(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateRevocationList with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.getCertificateRevocationList(request), + expectedError, + ); + }); + }); + + describe('getReusableConfig', () => { + it('invokes getReusableConfig without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ); + client.innerApiCalls.getReusableConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getReusableConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getReusableConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReusableConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReusableConfig without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ); + client.innerApiCalls.getReusableConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getReusableConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.security.privateca.v1beta1.IReusableConfig | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getReusableConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReusableConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReusableConfig with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getReusableConfig = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getReusableConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getReusableConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReusableConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReusableConfig with closed client', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getReusableConfig(request), expectedError); + }); + }); + + describe('activateCertificateAuthority', () => { + it('invokes activateCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.activateCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.activateCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes activateCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.activateCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.activateCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes activateCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.activateCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.activateCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes activateCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.activateCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.activateCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkActivateCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkActivateCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkActivateCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkActivateCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCertificateAuthority', () => { + it('invokes createCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkCreateCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('disableCertificateAuthority', () => { + it('invokes disableCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.disableCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.disableCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.disableCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disableCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.disableCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.disableCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.disableCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.disableCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDisableCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkDisableCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDisableCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkDisableCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('enableCertificateAuthority', () => { + it('invokes enableCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.enableCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.enableCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.enableCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enableCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enableCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.enableCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enableCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.enableCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enableCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkEnableCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkEnableCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkEnableCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkEnableCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('restoreCertificateAuthority', () => { + it('invokes restoreCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.restoreCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.restoreCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.restoreCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.restoreCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.restoreCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkRestoreCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkRestoreCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('scheduleDeleteCertificateAuthority', () => { + it('invokes scheduleDeleteCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.scheduleDeleteCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = + await client.scheduleDeleteCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes scheduleDeleteCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.scheduleDeleteCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.scheduleDeleteCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes scheduleDeleteCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.scheduleDeleteCertificateAuthority = + stubLongRunningCall(undefined, expectedError); + await assert.rejects( + client.scheduleDeleteCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes scheduleDeleteCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.scheduleDeleteCertificateAuthority = + stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = + await client.scheduleDeleteCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkScheduleDeleteCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkScheduleDeleteCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkScheduleDeleteCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkScheduleDeleteCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCertificateAuthority', () => { + it('invokes updateCertificateAuthority without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(), + ); + request.certificateAuthority ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest', + ['certificateAuthority', 'name'], + ); + request.certificateAuthority.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCertificateAuthority = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCertificateAuthority(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateAuthority without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(), + ); + request.certificateAuthority ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest', + ['certificateAuthority', 'name'], + ); + request.certificateAuthority.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCertificateAuthority = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCertificateAuthority( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateAuthority with call error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(), + ); + request.certificateAuthority ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest', + ['certificateAuthority', 'name'], + ); + request.certificateAuthority.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateAuthority = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateCertificateAuthority(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateAuthority with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(), + ); + request.certificateAuthority ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest', + ['certificateAuthority', 'name'], + ); + request.certificateAuthority.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateAuthority = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateCertificateAuthority(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateAuthority as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCertificateAuthorityProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateCertificateAuthorityProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCertificateAuthorityProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateCertificateAuthorityProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCertificateRevocationList', () => { + it('invokes updateCertificateRevocationList without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(), + ); + request.certificateRevocationList ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest', + ['certificateRevocationList', 'name'], + ); + request.certificateRevocationList.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCertificateRevocationList = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCertificateRevocationList(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateRevocationList without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(), + ); + request.certificateRevocationList ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest', + ['certificateRevocationList', 'name'], + ); + request.certificateRevocationList.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCertificateRevocationList = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCertificateRevocationList( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, + protos.google.cloud.security.privateca.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateRevocationList with call error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(), + ); + request.certificateRevocationList ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest', + ['certificateRevocationList', 'name'], + ); + request.certificateRevocationList.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateRevocationList = + stubLongRunningCall(undefined, expectedError); + await assert.rejects( + client.updateCertificateRevocationList(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateRevocationList with LRO error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(), + ); + request.certificateRevocationList ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest', + ['certificateRevocationList', 'name'], + ); + request.certificateRevocationList.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateRevocationList = + stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateCertificateRevocationList(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateRevocationList as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCertificateRevocationListProgress without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateCertificateRevocationListProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCertificateRevocationListProgress with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateCertificateRevocationListProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listCertificates', () => { + it('invokes listCertificates without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + ]; + client.innerApiCalls.listCertificates = stubSimpleCall(expectedResponse); + const [response] = await client.listCertificates(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificates without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + ]; + client.innerApiCalls.listCertificates = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCertificates( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.security.privateca.v1beta1.ICertificate[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificates with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCertificates = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listCertificates(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificatesStream without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + ]; + client.descriptors.page.listCertificates.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCertificatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1beta1.Certificate[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1beta1.Certificate, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listCertificates.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificates, request), + ); + assert( + (client.descriptors.page.listCertificates.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listCertificatesStream with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificates.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCertificatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1beta1.Certificate[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1beta1.Certificate, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCertificates.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificates, request), + ); + assert( + (client.descriptors.page.listCertificates.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listCertificates without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.Certificate(), + ), + ]; + client.descriptors.page.listCertificates.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.security.privateca.v1beta1.ICertificate[] = + []; + const iterable = client.listCertificatesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificates.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listCertificates.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listCertificates with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificates.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCertificatesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.security.privateca.v1beta1.ICertificate[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificates.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listCertificates.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listCertificateAuthorities', () => { + it('invokes listCertificateAuthorities without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + ]; + client.innerApiCalls.listCertificateAuthorities = + stubSimpleCall(expectedResponse); + const [response] = await client.listCertificateAuthorities(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateAuthorities without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + ]; + client.innerApiCalls.listCertificateAuthorities = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCertificateAuthorities( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateAuthorities with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCertificateAuthorities = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listCertificateAuthorities(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateAuthorities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateAuthoritiesStream without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + ]; + client.descriptors.page.listCertificateAuthorities.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCertificateAuthoritiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1beta1.CertificateAuthority[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificateAuthorities, request), + ); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listCertificateAuthoritiesStream with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateAuthorities.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCertificateAuthoritiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1beta1.CertificateAuthority[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificateAuthorities, request), + ); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listCertificateAuthorities without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), + ), + ]; + client.descriptors.page.listCertificateAuthorities.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[] = + []; + const iterable = client.listCertificateAuthoritiesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateAuthorities + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listCertificateAuthorities with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateAuthorities.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCertificateAuthoritiesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateAuthorities + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listCertificateAuthorities + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('listCertificateRevocationLists', () => { + it('invokes listCertificateRevocationLists without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + ]; + client.innerApiCalls.listCertificateRevocationLists = + stubSimpleCall(expectedResponse); + const [response] = await client.listCertificateRevocationLists(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateRevocationLists without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + ]; + client.innerApiCalls.listCertificateRevocationLists = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCertificateRevocationLists( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateRevocationLists with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCertificateRevocationLists = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listCertificateRevocationLists(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateRevocationLists as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateRevocationListsStream without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + ]; + client.descriptors.page.listCertificateRevocationLists.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCertificateRevocationListsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listCertificateRevocationLists, + request, + ), + ); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listCertificateRevocationListsStream with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateRevocationLists.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCertificateRevocationListsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listCertificateRevocationLists, + request, + ), + ); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listCertificateRevocationLists without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), + ), + ]; + client.descriptors.page.listCertificateRevocationLists.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[] = + []; + const iterable = client.listCertificateRevocationListsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateRevocationLists + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listCertificateRevocationLists with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateRevocationLists.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCertificateRevocationListsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateRevocationLists + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listCertificateRevocationLists + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('listReusableConfigs', () => { + it('invokes listReusableConfigs without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + ]; + client.innerApiCalls.listReusableConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listReusableConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReusableConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReusableConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReusableConfigs without error using callback', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + ]; + client.innerApiCalls.listReusableConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listReusableConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.security.privateca.v1beta1.IReusableConfig[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReusableConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReusableConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReusableConfigs with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listReusableConfigs = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listReusableConfigs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listReusableConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReusableConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReusableConfigsStream without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + ]; + client.descriptors.page.listReusableConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listReusableConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1beta1.ReusableConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1beta1.ReusableConfig, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listReusableConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReusableConfigs, request), + ); + assert( + (client.descriptors.page.listReusableConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listReusableConfigsStream with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReusableConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listReusableConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.security.privateca.v1beta1.ReusableConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.security.privateca.v1beta1.ReusableConfig, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listReusableConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReusableConfigs, request), + ); + assert( + (client.descriptors.page.listReusableConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listReusableConfigs without error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), + ), + ]; + client.descriptors.page.listReusableConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.security.privateca.v1beta1.IReusableConfig[] = + []; + const iterable = client.listReusableConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listReusableConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listReusableConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listReusableConfigs with error', async () => { + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReusableConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listReusableConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.security.privateca.v1beta1.IReusableConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listReusableConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listReusableConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('Path templates', () => { + describe('certificate', async () => { + const fakePath = '/rendered/path/certificate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + certificate_authority: 'certificateAuthorityValue', + certificate: 'certificateValue', + }; + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.certificatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.certificatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('certificatePath', () => { + const result = client.certificatePath( + 'projectValue', + 'locationValue', + 'certificateAuthorityValue', + 'certificateValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.certificatePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromCertificateName', () => { + const result = client.matchProjectFromCertificateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.certificatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCertificateName', () => { + const result = client.matchLocationFromCertificateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.certificatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCertificateAuthorityFromCertificateName', () => { + const result = + client.matchCertificateAuthorityFromCertificateName(fakePath); + assert.strictEqual(result, 'certificateAuthorityValue'); + assert( + (client.pathTemplates.certificatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCertificateFromCertificateName', () => { + const result = client.matchCertificateFromCertificateName(fakePath); + assert.strictEqual(result, 'certificateValue'); + assert( + (client.pathTemplates.certificatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('certificateAuthority', async () => { + const fakePath = '/rendered/path/certificateAuthority'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + certificate_authority: 'certificateAuthorityValue', + }; + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.certificateAuthorityPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.certificateAuthorityPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('certificateAuthorityPath', () => { + const result = client.certificateAuthorityPath( + 'projectValue', + 'locationValue', + 'certificateAuthorityValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.certificateAuthorityPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromCertificateAuthorityName', () => { + const result = + client.matchProjectFromCertificateAuthorityName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.certificateAuthorityPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCertificateAuthorityName', () => { + const result = + client.matchLocationFromCertificateAuthorityName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.certificateAuthorityPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCertificateAuthorityFromCertificateAuthorityName', () => { + const result = + client.matchCertificateAuthorityFromCertificateAuthorityName( + fakePath, + ); + assert.strictEqual(result, 'certificateAuthorityValue'); + assert( + ( + client.pathTemplates.certificateAuthorityPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('certificateRevocationList', async () => { + const fakePath = '/rendered/path/certificateRevocationList'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + certificate_authority: 'certificateAuthorityValue', + certificate_revocation_list: 'certificateRevocationListValue', + }; + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.certificateRevocationListPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.certificateRevocationListPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('certificateRevocationListPath', () => { + const result = client.certificateRevocationListPath( + 'projectValue', + 'locationValue', + 'certificateAuthorityValue', + 'certificateRevocationListValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.certificateRevocationListPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromCertificateRevocationListName', () => { + const result = + client.matchProjectFromCertificateRevocationListName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.certificateRevocationListPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCertificateRevocationListName', () => { + const result = + client.matchLocationFromCertificateRevocationListName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.certificateRevocationListPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCertificateAuthorityFromCertificateRevocationListName', () => { + const result = + client.matchCertificateAuthorityFromCertificateRevocationListName( + fakePath, + ); + assert.strictEqual(result, 'certificateAuthorityValue'); + assert( + ( + client.pathTemplates.certificateRevocationListPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCertificateRevocationListFromCertificateRevocationListName', () => { + const result = + client.matchCertificateRevocationListFromCertificateRevocationListName( + fakePath, + ); + assert.strictEqual(result, 'certificateRevocationListValue'); + assert( + ( + client.pathTemplates.certificateRevocationListPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('reusableConfig', async () => { + const fakePath = '/rendered/path/reusableConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reusable_config: 'reusableConfigValue', + }; + const client = + new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.reusableConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reusableConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reusableConfigPath', () => { + const result = client.reusableConfigPath( + 'projectValue', + 'locationValue', + 'reusableConfigValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reusableConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromReusableConfigName', () => { + const result = client.matchProjectFromReusableConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reusableConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromReusableConfigName', () => { + const result = client.matchLocationFromReusableConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reusableConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchReusableConfigFromReusableConfigName', () => { + const result = + client.matchReusableConfigFromReusableConfigName(fakePath); + assert.strictEqual(result, 'reusableConfigValue'); + assert( + (client.pathTemplates.reusableConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-security-privateca/tsconfig.json b/owl-bot-staging/google-cloud-security-privateca/tsconfig.json new file mode 100644 index 000000000000..ca73e7bfc824 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/google-cloud-security-privateca/webpack.config.js b/owl-bot-staging/google-cloud-security-privateca/webpack.config.js new file mode 100644 index 000000000000..a18753845591 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-privateca/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'CertificateAuthorityService', + filename: './certificate-authority-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 7ce118254c2d7323895331f7b39b233d36e52cb2 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 27 May 2026 02:40:14 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../.eslintignore | 7 - .../.eslintrc.json | 4 - .../.gitignore | 14 - .../google-cloud-security-privateca/.jsdoc.js | 55 - .../.mocharc.js | 33 - .../google-cloud-security-privateca/.nycrc | 24 - .../google-cloud-security-privateca/README.md | 164 - .../security/privateca/v1/resources.proto | 1656 - .../cloud/security/privateca/v1/service.proto | 1484 - .../privateca/v1beta1/resources.proto | 902 - .../security/privateca/v1beta1/service.proto | 870 - .../protos/protos.d.ts | 26491 ------ .../protos/protos.js | 68543 ---------------- .../protos/protos.json | 7802 -- ..._service.activate_certificate_authority.js | 90 - ...ficate_authority_service.create_ca_pool.js | 90 - ...te_authority_service.create_certificate.js | 126 - ...ty_service.create_certificate_authority.js | 92 - ...ity_service.create_certificate_template.js | 91 - ...ficate_authority_service.delete_ca_pool.js | 85 - ...ty_service.delete_certificate_authority.js | 96 - ...ity_service.delete_certificate_template.js | 78 - ...y_service.disable_certificate_authority.js | 85 - ...ty_service.enable_certificate_authority.js | 78 - ...ficate_authority_service.fetch_ca_certs.js | 77 - ...service.fetch_certificate_authority_csr.js | 63 - ...rtificate_authority_service.get_ca_pool.js | 62 - ...icate_authority_service.get_certificate.js | 63 - ...ority_service.get_certificate_authority.js | 64 - ...service.get_certificate_revocation_list.js | 65 - ...hority_service.get_certificate_template.js | 64 - ...ificate_authority_service.list_ca_pools.js | 88 - ...ty_service.list_certificate_authorities.js | 90 - ...rvice.list_certificate_revocation_lists.js | 89 - ...rity_service.list_certificate_templates.js | 89 - ...ate_authority_service.list_certificates.js | 100 - ...te_authority_service.revoke_certificate.js | 84 - ..._service.undelete_certificate_authority.js | 78 - ...ficate_authority_service.update_ca_pool.js | 82 - ...te_authority_service.update_certificate.js | 81 - ...ty_service.update_certificate_authority.js | 83 - ...vice.update_certificate_revocation_list.js | 83 - ...ity_service.update_certificate_template.js | 83 - ...ta_google.cloud.security.privateca.v1.json | 1419 - ..._service.activate_certificate_authority.js | 89 - ...te_authority_service.create_certificate.js | 89 - ...ty_service.create_certificate_authority.js | 89 - ...y_service.disable_certificate_authority.js | 77 - ...ty_service.enable_certificate_authority.js | 77 - ...service.fetch_certificate_authority_csr.js | 62 - ...icate_authority_service.get_certificate.js | 61 - ...ority_service.get_certificate_authority.js | 62 - ...service.get_certificate_revocation_list.js | 62 - ...e_authority_service.get_reusable_config.js | 61 - ...ty_service.list_certificate_authorities.js | 87 - ...rvice.list_certificate_revocation_lists.js | 87 - ...ate_authority_service.list_certificates.js | 91 - ...authority_service.list_reusable_configs.js | 87 - ...y_service.restore_certificate_authority.js | 77 - ...te_authority_service.revoke_certificate.js | 81 - ...e.schedule_delete_certificate_authority.js | 77 - ...te_authority_service.update_certificate.js | 80 - ...ty_service.update_certificate_authority.js | 81 - ...vice.update_certificate_revocation_list.js | 81 - ...ogle.cloud.security.privateca.v1beta1.json | 963 - .../src/index.ts | 28 - .../certificate_authority_service_client.ts | 7233 -- ...icate_authority_service_client_config.json | 176 - ...tificate_authority_service_proto_list.json | 4 - .../src/v1/gapic_metadata.json | 333 - .../src/v1/index.ts | 19 - .../certificate_authority_service_client.ts | 4703 -- ...icate_authority_service_client_config.json | 131 - ...tificate_authority_service_proto_list.json | 4 - .../src/v1beta1/gapic_metadata.json | 239 - .../src/v1beta1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 37 - .../system-test/install.ts | 51 - .../gapic_certificate_authority_service_v1.ts | 8138 -- ...c_certificate_authority_service_v1beta1.ts | 5151 -- .../tsconfig.json | 22 - .../webpack.config.js | 64 - .../security/privateca/v1/resources.proto | 64 +- .../cloud/security/privateca/v1/service.proto | 15 +- .../protos/protos.d.ts | 115 + .../protos/protos.js | 284 + .../protos/protos.json | 29 + ...ate_authority_service.list_certificates.js | 11 +- ...ta_google.cloud.security.privateca.v1.json | 2 +- .../certificate_authority_service_client.ts | 39 +- 91 files changed, 539 insertions(+), 140787 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-security-privateca/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-security-privateca/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-security-privateca/.gitignore delete mode 100644 owl-bot-staging/google-cloud-security-privateca/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/.nycrc delete mode 100644 owl-bot-staging/google-cloud-security-privateca/README.md delete mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto delete mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto delete mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/resources.proto delete mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/service.proto delete mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.activate_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_ca_pool.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_template.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_template.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.enable_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_ca_certs.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_ca_pool.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_template.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_ca_pools.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_authorities.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_templates.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.revoke_certificate.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_ca_pool.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_template.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificates.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata_google.cloud.security.privateca.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-security-privateca/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-security-privateca/src/v1beta1/index.ts delete mode 100644 owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-security-privateca/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-security-privateca/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-security-privateca/webpack.config.js diff --git a/owl-bot-staging/google-cloud-security-privateca/.eslintignore b/owl-bot-staging/google-cloud-security-privateca/.eslintignore deleted file mode 100644 index cfc348ec4d11..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-security-privateca/.eslintrc.json b/owl-bot-staging/google-cloud-security-privateca/.eslintrc.json deleted file mode 100644 index 3e8d97ccb390..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./node_modules/gts", - "root": true -} diff --git a/owl-bot-staging/google-cloud-security-privateca/.gitignore b/owl-bot-staging/google-cloud-security-privateca/.gitignore deleted file mode 100644 index d4f03a0df2e8..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-security-privateca/.jsdoc.js b/owl-bot-staging/google-cloud-security-privateca/.jsdoc.js deleted file mode 100644 index e4555d1293b8..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/security-private-ca', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-security-privateca/.mocharc.js b/owl-bot-staging/google-cloud-security-privateca/.mocharc.js deleted file mode 100644 index 5eb34e86c874..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-security-privateca/.nycrc b/owl-bot-staging/google-cloud-security-privateca/.nycrc deleted file mode 100644 index 81a95fc94b00..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "report-dir": "./.coverage", - "reporter": ["text", "lcov"], - "exclude": [ - "**/*-test", - "**/.coverage", - "**/apis", - "**/benchmark", - "**/conformance", - "**/docs", - "**/samples", - "**/scripts", - "**/protos", - "**/test", - "**/*.d.ts", - ".jsdoc.js", - "**/.jsdoc.js", - "karma.conf.js", - "webpack-tests.config.js", - "webpack.config.js" - ], - "exclude-after-remap": false, - "all": true -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-privateca/README.md b/owl-bot-staging/google-cloud-security-privateca/README.md deleted file mode 100644 index 144374d14e4c..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/README.md +++ /dev/null @@ -1,164 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [Certificate Authority API: Nodejs Client][homepage] - -This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways -unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **stable** libraries -are addressed with the highest priority - -[![npm version](https://img.shields.io/npm/v/@google-cloud/security-private-ca.svg)](https://www.npmjs.org/package/@google-cloud/security-private-ca) - -Certificate Authority API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Certificate Authority API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/privateca/latest) - - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Certificate Authority API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @google-cloud/security-private-ca -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | -| --------------------------- | --------------------------------- | -| activate certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.activate_certificate_authority.js) | -| create ca pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_ca_pool.js) | -| create certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate.js) | -| create certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_authority.js) | -| create certificate template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_template.js) | -| delete ca pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js) | -| delete certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js) | -| delete certificate template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_template.js) | -| disable certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js) | -| enable certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.enable_certificate_authority.js) | -| fetch ca certs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_ca_certs.js) | -| fetch certificate authority csr | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js) | -| get ca pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_ca_pool.js) | -| get certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate.js) | -| get certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_authority.js) | -| get certificate revocation list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js) | -| get certificate template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_template.js) | -| list ca pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_ca_pools.js) | -| list certificate authorities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_authorities.js) | -| list certificate revocation lists | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js) | -| list certificate templates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_templates.js) | -| list certificates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js) | -| revoke certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.revoke_certificate.js) | -| undelete certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js) | -| update ca pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_ca_pool.js) | -| update certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate.js) | -| update certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_authority.js) | -| update certificate revocation list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js) | -| update certificate template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_template.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json) | -| activate certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js) | -| create certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate.js) | -| create certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js) | -| disable certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js) | -| enable certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js) | -| fetch certificate authority csr | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js) | -| get certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate.js) | -| get certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js) | -| get certificate revocation list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js) | -| get reusable config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js) | -| list certificate authorities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js) | -| list certificate revocation lists | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js) | -| list certificates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificates.js) | -| list reusable configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js) | -| restore certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js) | -| revoke certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js) | -| schedule delete certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js) | -| update certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate.js) | -| update certificate authority | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js) | -| update certificate revocation list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata_google.cloud.security.privateca.v1beta1.json) | - - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/security-private-ca@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=privateca.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-security-privateca diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto deleted file mode 100644 index ba54ee133ad0..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto +++ /dev/null @@ -1,1656 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.security.privateca.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/type/expr.proto"; - -option csharp_namespace = "Google.Cloud.Security.PrivateCA.V1"; -option go_package = "cloud.google.com/go/security/privateca/apiv1/privatecapb;privatecapb"; -option java_multiple_files = true; -option java_outer_classname = "PrivateCaResourcesProto"; -option java_package = "com.google.cloud.security.privateca.v1"; -option php_namespace = "Google\\Cloud\\Security\\PrivateCA\\V1"; -option ruby_package = "Google::Cloud::Security::PrivateCA::V1"; - -// A -// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] -// represents an individual Certificate Authority. A -// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] -// can be used to create -// [Certificates][google.cloud.security.privateca.v1.Certificate]. -message CertificateAuthority { - option (google.api.resource) = { - type: "privateca.googleapis.com/CertificateAuthority" - pattern: "projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}" - }; - - // The type of a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority], - // indicating its issuing chain. - enum Type { - // Not specified. - TYPE_UNSPECIFIED = 0; - - // Self-signed CA. - SELF_SIGNED = 1; - - // Subordinate CA. Could be issued by a Private CA - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // or an unmanaged CA. - SUBORDINATE = 2; - } - - // The state of a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority], - // indicating if it can be used. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // Certificates can be issued from this CA. CRLs will be generated for this - // CA. The CA will be part of the - // [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and - // will be used to issue certificates from the - // [CaPool][google.cloud.security.privateca.v1.CaPool]. - ENABLED = 1; - - // Certificates cannot be issued from this CA. CRLs will still be generated. - // The CA will be part of the - // [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, but - // will not be used to issue certificates from the - // [CaPool][google.cloud.security.privateca.v1.CaPool]. - DISABLED = 2; - - // Certificates can be issued from this CA. CRLs will be generated for this - // CA. The CA will be part of the - // [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, but - // will not be used to issue certificates from the - // [CaPool][google.cloud.security.privateca.v1.CaPool]. - STAGED = 3; - - // Certificates cannot be issued from this CA. CRLs will not be generated. - // The CA will not be part of the - // [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and - // will not be used to issue certificates from the - // [CaPool][google.cloud.security.privateca.v1.CaPool]. - AWAITING_USER_ACTIVATION = 4; - - // Certificates cannot be issued from this CA. CRLs will not be generated. - // The CA may still be recovered by calling - // [CertificateAuthorityService.UndeleteCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority] - // before - // [expire_time][google.cloud.security.privateca.v1.CertificateAuthority.expire_time]. - // The CA will not be part of the - // [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and - // will not be used to issue certificates from the - // [CaPool][google.cloud.security.privateca.v1.CaPool]. - DELETED = 5; - } - - // URLs where a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // will publish content. - message AccessUrls { - // The URL where this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s - // CA certificate is published. This will only be set for CAs that have been - // activated. - string ca_certificate_access_url = 1; - - // The URLs where this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s - // CRLs are published. This will only be set for CAs that have been - // activated. - repeated string crl_access_urls = 2; - } - - // A Cloud KMS key configuration that a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // will use. - message KeyVersionSpec { - oneof KeyVersion { - // The resource name for an existing Cloud KMS CryptoKeyVersion in the - // format - // `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. - // This option enables full flexibility in the key's capabilities and - // properties. - string cloud_kms_key_version = 1; - - // The algorithm to use for creating a managed Cloud KMS key for a for a - // simplified experience. All managed keys will be have their - // [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`. - SignHashAlgorithm algorithm = 2; - } - } - - // The algorithm of a Cloud KMS CryptoKeyVersion of a - // [CryptoKey][google.cloud.kms.v1.CryptoKey] with the - // [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] value - // `ASYMMETRIC_SIGN`. These values correspond to the - // [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - // values. For RSA signing algorithms, the PSS algorithms should be preferred, - // use PKCS1 algorithms if required for compatibility. For further - // recommendations, see - // https://cloud.google.com/kms/docs/algorithms#algorithm_recommendations. - enum SignHashAlgorithm { - // Not specified. - SIGN_HASH_ALGORITHM_UNSPECIFIED = 0; - - // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256 - RSA_PSS_2048_SHA256 = 1; - - // maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256 - RSA_PSS_3072_SHA256 = 2; - - // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256 - RSA_PSS_4096_SHA256 = 3; - - // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256 - RSA_PKCS1_2048_SHA256 = 6; - - // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256 - RSA_PKCS1_3072_SHA256 = 7; - - // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256 - RSA_PKCS1_4096_SHA256 = 8; - - // maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256 - EC_P256_SHA256 = 4; - - // maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384 - EC_P384_SHA384 = 5; - } - - // User-defined URLs for accessing content published by this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - message UserDefinedAccessUrls { - // Optional. A list of URLs where the issuer CA certificate may be - // downloaded, which appears in the "Authority Information Access" extension - // in the certificate. If specified, the default [Cloud Storage - // URLs][google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.ca_certificate_access_url] - // will be omitted. - repeated string aia_issuing_certificate_urls = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of URLs where to obtain CRL information, i.e. - // the DistributionPoint.fullName described by - // https://tools.ietf.org/html/rfc5280#section-4.2.1.13. - // If specified, the default - // [Cloud Storage - // URLs][google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.crl_access_urls] - // will be omitted. - repeated string crl_access_urls = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Identifier. The resource name for this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Immutable. The - // [Type][google.cloud.security.privateca.v1.CertificateAuthority.Type] of - // this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - Type type = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Immutable. The config used to create a self-signed X.509 - // certificate or CSR. - CertificateConfig config = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Immutable. The desired lifetime of the CA certificate. Used to - // create the "not_before_time" and "not_after_time" fields inside an X.509 - // certificate. - google.protobuf.Duration lifetime = 4 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Immutable. Used when issuing certificates for this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - // If this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // is a self-signed CertificateAuthority, this key is also used to sign the - // self-signed CA certificate. Otherwise, it is used to sign a CSR. - KeyVersionSpec key_spec = 5 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. If this is a subordinate - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority], - // this field will be set with the subordinate configuration, which describes - // its issuers. This may be updated, but this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // must continue to validate. - SubordinateConfig subordinate_config = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The - // [CaPool.Tier][google.cloud.security.privateca.v1.CaPool.Tier] of the - // [CaPool][google.cloud.security.privateca.v1.CaPool] that includes this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - CaPool.Tier tier = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The - // [State][google.cloud.security.privateca.v1.CertificateAuthority.State] for - // this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. This - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s - // certificate chain, including the current - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s - // certificate. Ordered such that the root issuer is the final element - // (consistent with RFC 5246). For a self-signed CA, this will only list the - // current - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s - // certificate. - repeated string pem_ca_certificates = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A structured description of this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s - // CA certificate and its issuers. Ordered as self-to-root. - repeated CertificateDescription ca_certificate_descriptions = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The name of a Cloud Storage bucket where this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // will publish content, such as the CA certificate and CRLs. This must be a - // bucket name, without any prefixes (such as `gs://`) or suffixes (such as - // `.googleapis.com`). For example, to use a bucket named `my-bucket`, you - // would simply specify `my-bucket`. If not specified, a managed bucket will - // be created. - string gcs_bucket = 11 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. URLs for accessing content published by this CA, such as the - // CA certificate and CRLs. - AccessUrls access_urls = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // was created. - google.protobuf.Timestamp create_time = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // was last updated. - google.protobuf.Timestamp update_time = 14 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // was soft deleted, if it is in the - // [DELETED][google.cloud.security.privateca.v1.CertificateAuthority.State.DELETED] - // state. - google.protobuf.Timestamp delete_time = 15 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // will be permanently purged, if it is in the - // [DELETED][google.cloud.security.privateca.v1.CertificateAuthority.State.DELETED] - // state. - google.protobuf.Timestamp expire_time = 16 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Labels with user-defined metadata. - map labels = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. User-defined URLs for CA certificate and CRLs. The service does - // not publish content to these URLs. It is up to the user to mirror content - // to these URLs. - UserDefinedAccessUrls user_defined_access_urls = 18 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzi = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A [CaPool][google.cloud.security.privateca.v1.CaPool] represents a group of -// [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority] -// that form a trust anchor. A -// [CaPool][google.cloud.security.privateca.v1.CaPool] can be used to manage -// issuance policies for one or more -// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] -// resources and to rotate CA certificates in and out of the trust anchor. -message CaPool { - option (google.api.resource) = { - type: "privateca.googleapis.com/CaPool" - pattern: "projects/{project}/locations/{location}/caPools/{ca_pool}" - }; - - // The tier of a [CaPool][google.cloud.security.privateca.v1.CaPool], - // indicating its supported functionality and/or billing SKU. - enum Tier { - // Not specified. - TIER_UNSPECIFIED = 0; - - // Enterprise tier. - ENTERPRISE = 1; - - // DevOps tier. - DEVOPS = 2; - } - - // Options relating to the publication of each - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s - // CA certificate and CRLs and their inclusion as extensions in issued - // [Certificates][google.cloud.security.privateca.v1.Certificate]. The options - // set here apply to certificates issued by any - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in the [CaPool][google.cloud.security.privateca.v1.CaPool]. - message PublishingOptions { - // Supported encoding formats for publishing. - enum EncodingFormat { - // Not specified. By default, PEM format will be used. - ENCODING_FORMAT_UNSPECIFIED = 0; - - // The - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s - // CA certificate and CRLs will be published in PEM format. - PEM = 1; - - // The - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s - // CA certificate and CRLs will be published in DER format. - DER = 2; - } - - // Optional. When true, publishes each - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s - // CA certificate and includes its URL in the "Authority Information Access" - // X.509 extension in all issued - // [Certificates][google.cloud.security.privateca.v1.Certificate]. If this - // is false, the CA certificate will not be published and the corresponding - // X.509 extension will not be written in issued certificates. - bool publish_ca_cert = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When true, publishes each - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s - // CRL and includes its URL in the "CRL Distribution Points" X.509 extension - // in all issued - // [Certificates][google.cloud.security.privateca.v1.Certificate]. If this - // is false, CRLs will not be published and the corresponding X.509 - // extension will not be written in issued certificates. CRLs will expire 7 - // days from their creation. However, we will rebuild daily. CRLs are also - // rebuilt shortly after a certificate is revoked. - bool publish_crl = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the encoding format of each - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // resource's CA certificate and CRLs. If this is omitted, CA certificates - // and CRLs will be published in PEM. - EncodingFormat encoding_format = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Defines controls over all certificate issuance within a - // [CaPool][google.cloud.security.privateca.v1.CaPool]. - message IssuancePolicy { - // Describes a "type" of key that may be used in a - // [Certificate][google.cloud.security.privateca.v1.Certificate] issued from - // a [CaPool][google.cloud.security.privateca.v1.CaPool]. Note that a single - // [AllowedKeyType][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType] - // may refer to either a fully-qualified key algorithm, such as RSA 4096, or - // a family of key algorithms, such as any RSA key. - message AllowedKeyType { - // Describes an RSA key that may be used in a - // [Certificate][google.cloud.security.privateca.v1.Certificate] issued - // from a [CaPool][google.cloud.security.privateca.v1.CaPool]. - message RsaKeyType { - // Optional. The minimum allowed RSA modulus size (inclusive), in bits. - // If this is not set, or if set to zero, the service-level min RSA - // modulus size will continue to apply. - int64 min_modulus_size = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum allowed RSA modulus size (inclusive), in bits. - // If this is not set, or if set to zero, the service will not enforce - // an explicit upper bound on RSA modulus sizes. - int64 max_modulus_size = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Describes an Elliptic Curve key that may be used in a - // [Certificate][google.cloud.security.privateca.v1.Certificate] issued - // from a [CaPool][google.cloud.security.privateca.v1.CaPool]. - message EcKeyType { - // Describes an elliptic curve-based signature algorithm that may be - // used in a - // [Certificate][google.cloud.security.privateca.v1.Certificate] issued - // from a [CaPool][google.cloud.security.privateca.v1.CaPool]. - enum EcSignatureAlgorithm { - // Not specified. Signifies that any signature algorithm may be used. - EC_SIGNATURE_ALGORITHM_UNSPECIFIED = 0; - - // Refers to the Elliptic Curve Digital Signature Algorithm over the - // NIST P-256 curve. - ECDSA_P256 = 1; - - // Refers to the Elliptic Curve Digital Signature Algorithm over the - // NIST P-384 curve. - ECDSA_P384 = 2; - - // Refers to the Edwards-curve Digital Signature Algorithm over curve - // 25519, as described in RFC 8410. - EDDSA_25519 = 3; - } - - // Optional. A signature algorithm that must be used. If this is - // omitted, any EC-based signature algorithm will be allowed. - EcSignatureAlgorithm signature_algorithm = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - oneof key_type { - // Represents an allowed RSA key type. - RsaKeyType rsa = 1; - - // Represents an allowed Elliptic Curve key type. - EcKeyType elliptic_curve = 2; - } - } - - // [IssuanceModes][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes] - // specifies the allowed ways in which - // [Certificates][google.cloud.security.privateca.v1.Certificate] may be - // requested from this [CaPool][google.cloud.security.privateca.v1.CaPool]. - message IssuanceModes { - // Optional. When true, allows callers to create - // [Certificates][google.cloud.security.privateca.v1.Certificate] by - // specifying a CSR. - bool allow_csr_based_issuance = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When true, allows callers to create - // [Certificates][google.cloud.security.privateca.v1.Certificate] by - // specifying a - // [CertificateConfig][google.cloud.security.privateca.v1.CertificateConfig]. - bool allow_config_based_issuance = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. If any - // [AllowedKeyType][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType] - // is specified, then the certificate request's public key must match one of - // the key types listed here. Otherwise, any key may be used. - repeated AllowedKeyType allowed_key_types = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, all certificates issued from this - // [CaPool][google.cloud.security.privateca.v1.CaPool] will be backdated by - // this duration. The 'not_before_time' will be the issuance time minus this - // [backdate_duration][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdate_duration], - // and the 'not_after_time' will be adjusted to preserve the requested - // lifetime. The maximum duration that a certificate can be backdated with - // these options is 48 hours in the past. - // This option cannot be set if - // [allow_requester_specified_not_before_time][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allow_requester_specified_not_before_time] - // is set. - google.protobuf.Duration backdate_duration = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, allows requesters to specify the - // [requested_not_before_time][google.cloud.security.privateca.v1.Certificate.requested_not_before_time] - // field when creating a - // [Certificate][google.cloud.security.privateca.v1.Certificate]. - // Certificates requested with this option enabled will have a - // 'not_before_time' equal to the value specified in the request. The - // 'not_after_time' will be adjusted to preserve the requested lifetime. The - // maximum time that a certificate can be backdated with these options is 48 - // hours in the past. This option cannot be set if - // [backdate_duration][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdate_duration] - // is set. - bool allow_requester_specified_not_before_time = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum lifetime allowed for issued - // [Certificates][google.cloud.security.privateca.v1.Certificate]. Note that - // if the issuing - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // expires before a - // [Certificate][google.cloud.security.privateca.v1.Certificate] resource's - // requested maximum_lifetime, the effective lifetime will be explicitly - // truncated to match it. - google.protobuf.Duration maximum_lifetime = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If specified, then only methods allowed in the - // [IssuanceModes][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes] - // may be used to issue - // [Certificates][google.cloud.security.privateca.v1.Certificate]. - IssuanceModes allowed_issuance_modes = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A set of X.509 values that will be applied to all certificates - // issued through this [CaPool][google.cloud.security.privateca.v1.CaPool]. - // If a certificate request includes conflicting values for the same - // properties, they will be overwritten by the values defined here. If a - // certificate request uses a - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - // that defines conflicting - // [predefined_values][google.cloud.security.privateca.v1.CertificateTemplate.predefined_values] - // for the same properties, the certificate issuance request will fail. - X509Parameters baseline_values = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes constraints on identities that may appear in - // [Certificates][google.cloud.security.privateca.v1.Certificate] issued - // through this [CaPool][google.cloud.security.privateca.v1.CaPool]. If this - // is omitted, then this [CaPool][google.cloud.security.privateca.v1.CaPool] - // will not add restrictions on a certificate's identity. - CertificateIdentityConstraints identity_constraints = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes the set of X.509 extensions that may appear in a - // [Certificate][google.cloud.security.privateca.v1.Certificate] issued - // through this [CaPool][google.cloud.security.privateca.v1.CaPool]. If a - // certificate request sets extensions that don't appear in the - // [passthrough_extensions][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.passthrough_extensions], - // those extensions will be dropped. If a certificate request uses a - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - // with - // [predefined_values][google.cloud.security.privateca.v1.CertificateTemplate.predefined_values] - // that don't appear here, the certificate issuance request will fail. If - // this is omitted, then this - // [CaPool][google.cloud.security.privateca.v1.CaPool] will not add - // restrictions on a certificate's X.509 extensions. These constraints do - // not apply to X.509 extensions set in this - // [CaPool][google.cloud.security.privateca.v1.CaPool]'s - // [baseline_values][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values]. - CertificateExtensionConstraints passthrough_extensions = 6 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Identifier. The resource name for this - // [CaPool][google.cloud.security.privateca.v1.CaPool] in the format - // `projects/*/locations/*/caPools/*`. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Immutable. The - // [Tier][google.cloud.security.privateca.v1.CaPool.Tier] of this - // [CaPool][google.cloud.security.privateca.v1.CaPool]. - Tier tier = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. The - // [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy] - // to control how - // [Certificates][google.cloud.security.privateca.v1.Certificate] will be - // issued from this [CaPool][google.cloud.security.privateca.v1.CaPool]. - IssuancePolicy issuance_policy = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The - // [PublishingOptions][google.cloud.security.privateca.v1.CaPool.PublishingOptions] - // to follow when issuing - // [Certificates][google.cloud.security.privateca.v1.Certificate] from any - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in this [CaPool][google.cloud.security.privateca.v1.CaPool]. - PublishingOptions publishing_options = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When - // [EncryptionSpec][google.cloud.security.privateca.v1.EncryptionSpec] is - // provided, the [Subject][google.cloud.security.privateca.v1.Subject], - // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames], and - // the PEM-encoded certificate fields will be encrypted at rest. - EncryptionSpec encryption_spec = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Labels with user-defined metadata. - map labels = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration used for encrypting data at rest. -message EncryptionSpec { - // The resource name for a Cloud KMS key in the format - // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - string cloud_kms_key = 1; -} - -// A -// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] -// corresponds to a signed X.509 certificate Revocation List (CRL). A CRL -// contains the serial numbers of certificates that should no longer be trusted. -message CertificateRevocationList { - option (google.api.resource) = { - type: "privateca.googleapis.com/CertificateRevocationList" - pattern: "projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}" - }; - - // Describes a revoked - // [Certificate][google.cloud.security.privateca.v1.Certificate]. - message RevokedCertificate { - // The resource name for the - // [Certificate][google.cloud.security.privateca.v1.Certificate] in the - // format `projects/*/locations/*/caPools/*/certificates/*`. - string certificate = 1 [(google.api.resource_reference) = { - type: "privateca.googleapis.com/Certificate" - }]; - - // The serial number of the - // [Certificate][google.cloud.security.privateca.v1.Certificate]. - string hex_serial_number = 2; - - // The reason the - // [Certificate][google.cloud.security.privateca.v1.Certificate] was - // revoked. - RevocationReason revocation_reason = 3; - } - - // The state of a - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList], - // indicating if it is current. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] - // is up to date. - ACTIVE = 1; - - // The - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] - // is no longer current. - SUPERSEDED = 2; - } - - // Identifier. The resource name for this - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] - // in the format `projects/*/locations/*/caPools/*certificateAuthorities/*/ - // certificateRevocationLists/*`. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. The CRL sequence number that appears in pem_crl. - int64 sequence_number = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The revoked serial numbers that appear in pem_crl. - repeated RevokedCertificate revoked_certificates = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The PEM-encoded X.509 CRL. - string pem_crl = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The location where 'pem_crl' can be accessed. - string access_url = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The - // [State][google.cloud.security.privateca.v1.CertificateRevocationList.State] - // for this - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. - State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] - // was created. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] - // was updated. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The revision ID of this - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. - // A new revision is committed whenever a new CRL is published. The format is - // an 8-character hexadecimal string. - string revision_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Labels with user-defined metadata. - map labels = 10 [(google.api.field_behavior) = OPTIONAL]; -} - -// A [Certificate][google.cloud.security.privateca.v1.Certificate] corresponds -// to a signed X.509 certificate issued by a -// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. -message Certificate { - option (google.api.resource) = { - type: "privateca.googleapis.com/Certificate" - pattern: "projects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}" - }; - - // Describes fields that are relavent to the revocation of a - // [Certificate][google.cloud.security.privateca.v1.Certificate]. - message RevocationDetails { - // Indicates why a - // [Certificate][google.cloud.security.privateca.v1.Certificate] was - // revoked. - RevocationReason revocation_state = 1; - - // The time at which this - // [Certificate][google.cloud.security.privateca.v1.Certificate] was - // revoked. - google.protobuf.Timestamp revocation_time = 2; - } - - // Identifier. The resource name for this - // [Certificate][google.cloud.security.privateca.v1.Certificate] in the format - // `projects/*/locations/*/caPools/*/certificates/*`. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // The config used to create a signed X.509 certificate. - oneof certificate_config { - // Immutable. A pem-encoded X.509 certificate signing request (CSR). - string pem_csr = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. A description of the certificate and key that does not require - // X.509 or ASN.1. - CertificateConfig config = 3 [(google.api.field_behavior) = IMMUTABLE]; - } - - // Output only. The resource name of the issuing - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - string issuer_certificate_authority = 4 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Required. Immutable. The desired lifetime of a certificate. Used to create - // the "not_before_time" and "not_after_time" fields inside an X.509 - // certificate. Note that the lifetime may be truncated if it would extend - // past the life of any certificate authority in the issuing chain. - google.protobuf.Duration lifetime = 5 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Immutable. The resource name for a - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - // used to issue this certificate, in the format - // `projects/*/locations/*/certificateTemplates/*`. - // If this is specified, the caller must have the necessary permission to - // use this template. If this is omitted, no template will be used. - // This template must be in the same location as the - // [Certificate][google.cloud.security.privateca.v1.Certificate]. - string certificate_template = 6 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateTemplate" - } - ]; - - // Immutable. Specifies how the - // [Certificate][google.cloud.security.privateca.v1.Certificate]'s identity - // fields are to be decided. If this is omitted, the `DEFAULT` subject mode - // will be used. - SubjectRequestMode subject_mode = 7 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. Details regarding the revocation of this - // [Certificate][google.cloud.security.privateca.v1.Certificate]. This - // [Certificate][google.cloud.security.privateca.v1.Certificate] is considered - // revoked if and only if this field is present. - RevocationDetails revocation_details = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The pem-encoded, signed X.509 certificate. - string pem_certificate = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A structured description of the issued X.509 certificate. - CertificateDescription certificate_description = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The chain that may be used to verify the X.509 certificate. - // Expected to be in issuer-to-root order according to RFC 5246. - repeated string pem_certificate_chain = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this - // [Certificate][google.cloud.security.privateca.v1.Certificate] was created. - google.protobuf.Timestamp create_time = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this - // [Certificate][google.cloud.security.privateca.v1.Certificate] was updated. - google.protobuf.Timestamp update_time = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Labels with user-defined metadata. - map labels = 14 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The requested - // [not_before_time][google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.not_before_time] - // of this [Certificate][google.cloud.security.privateca.v1.Certificate]. This - // field may only be set if the - // [CaPool.IssuancePolicy.allow_requester_specified_not_before_time][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allow_requester_specified_not_before_time] - // field is set to true for the issuing - // [CaPool][google.cloud.security.privateca.v1.CaPool]. - // - // If this field is specified, the certificate will be issued with this - // 'not_before_time'. If this is not specified, the 'not_before_time' will be - // set to the issuance time or issuance time minus - // [backdate_duration][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdate_duration] - // depending on the [CaPool][google.cloud.security.privateca.v1.CaPool] - // configuration. - google.protobuf.Timestamp requested_not_before_time = 15 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A -// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] -// refers to a managed template for certificate issuance. -message CertificateTemplate { - option (google.api.resource) = { - type: "privateca.googleapis.com/CertificateTemplate" - pattern: "projects/{project}/locations/{location}/certificateTemplates/{certificate_template}" - }; - - // Identifier. The resource name for this - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - // in the format `projects/*/locations/*/certificateTemplates/*`. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. The maximum lifetime allowed for issued - // [Certificates][google.cloud.security.privateca.v1.Certificate] that use - // this template. If the issuing - // [CaPool][google.cloud.security.privateca.v1.CaPool] resource's - // [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy] - // specifies a - // [maximum_lifetime][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.maximum_lifetime] - // the minimum of the two durations will be the maximum lifetime for issued - // [Certificates][google.cloud.security.privateca.v1.Certificate]. Note that - // if the issuing - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // expires before a - // [Certificate][google.cloud.security.privateca.v1.Certificate]'s requested - // maximum_lifetime, the effective lifetime will be explicitly truncated - // to match it. - google.protobuf.Duration maximum_lifetime = 9 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A set of X.509 values that will be applied to all issued - // certificates that use this template. If the certificate request includes - // conflicting values for the same properties, they will be overwritten by the - // values defined here. If the issuing - // [CaPool][google.cloud.security.privateca.v1.CaPool]'s - // [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy] - // defines conflicting - // [baseline_values][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values] - // for the same properties, the certificate issuance request will fail. - X509Parameters predefined_values = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes constraints on identities that may be appear in - // [Certificates][google.cloud.security.privateca.v1.Certificate] issued using - // this template. If this is omitted, then this template will not add - // restrictions on a certificate's identity. - CertificateIdentityConstraints identity_constraints = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes the set of X.509 extensions that may appear in a - // [Certificate][google.cloud.security.privateca.v1.Certificate] issued using - // this - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. - // If a certificate request sets extensions that don't appear in the - // [passthrough_extensions][google.cloud.security.privateca.v1.CertificateTemplate.passthrough_extensions], - // those extensions will be dropped. If the issuing - // [CaPool][google.cloud.security.privateca.v1.CaPool]'s - // [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy] - // defines - // [baseline_values][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values] - // that don't appear here, the certificate issuance request will fail. If this - // is omitted, then this template will not add restrictions on a certificate's - // X.509 extensions. These constraints do not apply to X.509 extensions set in - // this - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]'s - // [predefined_values][google.cloud.security.privateca.v1.CertificateTemplate.predefined_values]. - CertificateExtensionConstraints passthrough_extensions = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A human-readable description of scenarios this template is - // intended for. - string description = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The time at which this - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - // was created. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - // was updated. - google.protobuf.Timestamp update_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Labels with user-defined metadata. - map labels = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// An [X509Parameters][google.cloud.security.privateca.v1.X509Parameters] is -// used to describe certain fields of an X.509 certificate, such as the key -// usage fields, fields specific to CA certificates, certificate policy -// extensions and custom extensions. -message X509Parameters { - // Describes the X.509 basic constraints extension, per [RFC 5280 - // section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9) - message CaOptions { - // Optional. Refers to the "CA" boolean field in the X.509 extension. - // When this value is missing, the basic constraints extension will be - // omitted from the certificate. - optional bool is_ca = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Refers to the path length constraint field in the X.509 - // extension. For a CA certificate, this value describes the depth of - // subordinate CA certificates that are allowed. If this value is less than - // 0, the request will fail. If this value is missing, the max path length - // will be omitted from the certificate. - optional int32 max_issuer_path_length = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Describes the X.509 name constraints extension, per - // https://tools.ietf.org/html/rfc5280#section-4.2.1.10 - message NameConstraints { - // Indicates whether or not the name constraints are marked critical. - bool critical = 1; - - // Contains permitted DNS names. Any DNS name that can be - // constructed by simply adding zero or more labels to - // the left-hand side of the name satisfies the name constraint. - // For example, `example.com`, `www.example.com`, `www.sub.example.com` - // would satisfy `example.com` while `example1.com` does not. - repeated string permitted_dns_names = 2; - - // Contains excluded DNS names. Any DNS name that can be - // constructed by simply adding zero or more labels to - // the left-hand side of the name satisfies the name constraint. - // For example, `example.com`, `www.example.com`, `www.sub.example.com` - // would satisfy `example.com` while `example1.com` does not. - repeated string excluded_dns_names = 3; - - // Contains the permitted IP ranges. For IPv4 addresses, the ranges - // are expressed using CIDR notation as specified in RFC 4632. - // For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 - // addresses. - repeated string permitted_ip_ranges = 4; - - // Contains the excluded IP ranges. For IPv4 addresses, the ranges - // are expressed using CIDR notation as specified in RFC 4632. - // For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 - // addresses. - repeated string excluded_ip_ranges = 5; - - // Contains the permitted email addresses. The value can be a particular - // email address, a hostname to indicate all email addresses on that host or - // a domain with a leading period (e.g. `.example.com`) to indicate - // all email addresses in that domain. - repeated string permitted_email_addresses = 6; - - // Contains the excluded email addresses. The value can be a particular - // email address, a hostname to indicate all email addresses on that host or - // a domain with a leading period (e.g. `.example.com`) to indicate - // all email addresses in that domain. - repeated string excluded_email_addresses = 7; - - // Contains the permitted URIs that apply to the host part of the name. - // The value can be a hostname or a domain with a - // leading period (like `.example.com`) - repeated string permitted_uris = 8; - - // Contains the excluded URIs that apply to the host part of the name. - // The value can be a hostname or a domain with a - // leading period (like `.example.com`) - repeated string excluded_uris = 9; - } - - // Optional. Indicates the intended use for keys that correspond to a - // certificate. - KeyUsage key_usage = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes options in this - // [X509Parameters][google.cloud.security.privateca.v1.X509Parameters] that - // are relevant in a CA certificate. If not specified, a default basic - // constraints extension with `is_ca=false` will be added for leaf - // certificates. - CaOptions ca_options = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes the X.509 certificate policy object identifiers, per - // https://tools.ietf.org/html/rfc5280#section-4.2.1.4. - repeated ObjectId policy_ids = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes Online Certificate Status Protocol (OCSP) endpoint - // addresses that appear in the "Authority Information Access" extension in - // the certificate. - repeated string aia_ocsp_servers = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes the X.509 name constraints extension. - NameConstraints name_constraints = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes custom X.509 extensions. - repeated X509Extension additional_extensions = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Describes a subordinate CA's issuers. This is either a resource name to a -// known issuing -// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority], -// or a PEM issuer certificate chain. -message SubordinateConfig { - // This message describes a subordinate CA's issuer certificate chain. This - // wrapper exists for compatibility reasons. - message SubordinateConfigChain { - // Required. Expected to be in leaf-to-root order according to RFC 5246. - repeated string pem_certificates = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - oneof subordinate_config { - // Required. This can refer to a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // that was used to create a subordinate - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - // This field is used for information and usability purposes only. The - // resource name is in the format - // `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - string certificate_authority = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Required. Contains the PEM certificate chain for the issuers of this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority], - // but not pem certificate for this CA itself. - SubordinateConfigChain pem_issuer_chain = 2 - [(google.api.field_behavior) = REQUIRED]; - } -} - -// A [PublicKey][google.cloud.security.privateca.v1.PublicKey] describes a -// public key. -message PublicKey { - // Types of public keys formats that are supported. Currently, only `PEM` - // format is supported. - enum KeyFormat { - // Default unspecified value. - KEY_FORMAT_UNSPECIFIED = 0; - - // The key is PEM-encoded as defined in [RFC - // 7468](https://tools.ietf.org/html/rfc7468). It can be any of the - // following: a PEM-encoded PKCS#1/RFC 3447 RSAPublicKey - // structure, an RFC 5280 - // [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) - // or a PEM-encoded X.509 certificate signing request (CSR). If a - // [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) - // is specified, it can contain a A PEM-encoded PKCS#1/RFC 3447 RSAPublicKey - // or a NIST P-256/secp256r1/prime256v1 or P-384 key. If a CSR is specified, - // it will used solely for the purpose of extracting the public key. When - // generated by the service, it will always be an RFC 5280 - // [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) - // structure containing an algorithm identifier and a key. - PEM = 1; - } - - // Required. A public key. The padding and encoding - // must match with the `KeyFormat` value specified for the `format` field. - bytes key = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The format of the public key. - KeyFormat format = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// A [CertificateConfig][google.cloud.security.privateca.v1.CertificateConfig] -// describes an X.509 certificate or CSR that is to be created, as an -// alternative to using ASN.1. -message CertificateConfig { - // These values are used to create the distinguished name and subject - // alternative name fields in an X.509 certificate. - message SubjectConfig { - // Optional. Contains distinguished name fields such as the common name, - // location and organization. - Subject subject = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The subject alternative name fields. - SubjectAltNames subject_alt_name = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // A KeyId identifies a specific public key, usually by hashing the public - // key. - message KeyId { - // Required. The value of this KeyId encoded in lowercase hexadecimal. This - // is most likely the 160 bit SHA-1 hash of the public key. - string key_id = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Specifies some of the values in a certificate that are related to - // the subject. - SubjectConfig subject_config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Describes how some of the technical X.509 fields in a certificate - // should be populated. - X509Parameters x509_config = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The public key that corresponds to this config. This is, for - // example, used when issuing - // [Certificates][google.cloud.security.privateca.v1.Certificate], but not - // when creating a self-signed - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // or - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // CSR. - PublicKey public_key = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When specified this provides a custom SKI to be used in the - // certificate. This should only be used to maintain a SKI of an existing CA - // originally created outside CA service, which was not generated using method - // (1) described in RFC 5280 section 4.2.1.2. - KeyId subject_key_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// A -// [CertificateDescription][google.cloud.security.privateca.v1.CertificateDescription] -// describes an X.509 certificate or CSR that has been issued, as an alternative -// to using ASN.1 / X.509. -message CertificateDescription { - // These values describe fields in an issued X.509 certificate such as the - // distinguished name, subject alternative names, serial number, and lifetime. - message SubjectDescription { - // Contains distinguished name fields such as the common name, location and - // / organization. - Subject subject = 1; - - // The subject alternative name fields. - SubjectAltNames subject_alt_name = 2; - - // The serial number encoded in lowercase hexadecimal. - string hex_serial_number = 3; - - // For convenience, the actual lifetime of an issued certificate. - google.protobuf.Duration lifetime = 4; - - // The time at which the certificate becomes valid. - google.protobuf.Timestamp not_before_time = 5; - - // The time after which the certificate is expired. - // Per RFC 5280, the validity period for a certificate is the period of time - // from not_before_time through not_after_time, inclusive. - // Corresponds to 'not_before_time' + 'lifetime' - 1 second. - google.protobuf.Timestamp not_after_time = 6; - } - - // A KeyId identifies a specific public key, usually by hashing the public - // key. - message KeyId { - // Optional. The value of this KeyId encoded in lowercase hexadecimal. This - // is most likely the 160 bit SHA-1 hash of the public key. - string key_id = 1 [(google.api.field_behavior) = OPTIONAL]; - } - - // A group of fingerprints for the x509 certificate. - message CertificateFingerprint { - // The SHA 256 hash, encoded in hexadecimal, of the DER x509 certificate. - string sha256_hash = 1; - } - - // Describes some of the values in a certificate that are related to the - // subject and lifetime. - SubjectDescription subject_description = 1; - - // Describes some of the technical X.509 fields in a certificate. - X509Parameters x509_description = 2; - - // The public key that corresponds to an issued certificate. - PublicKey public_key = 3; - - // Provides a means of identifiying certificates that contain a particular - // public key, per https://tools.ietf.org/html/rfc5280#section-4.2.1.2. - KeyId subject_key_id = 4; - - // Identifies the subject_key_id of the parent certificate, per - // https://tools.ietf.org/html/rfc5280#section-4.2.1.1 - KeyId authority_key_id = 5; - - // Describes a list of locations to obtain CRL information, i.e. - // the DistributionPoint.fullName described by - // https://tools.ietf.org/html/rfc5280#section-4.2.1.13 - repeated string crl_distribution_points = 6; - - // Describes lists of issuer CA certificate URLs that appear in the - // "Authority Information Access" extension in the certificate. - repeated string aia_issuing_certificate_urls = 7; - - // The hash of the x.509 certificate. - CertificateFingerprint cert_fingerprint = 8; - - // The hash of the pre-signed certificate, which will be signed by the CA. - // Corresponds to the TBS Certificate in - // https://tools.ietf.org/html/rfc5280#section-4.1.2. The field will always be - // populated. - string tbs_certificate_digest = 9; -} - -// An [ObjectId][google.cloud.security.privateca.v1.ObjectId] specifies an -// object identifier (OID). These provide context and describe types in ASN.1 -// messages. -message ObjectId { - // Required. The parts of an OID path. The most significant parts of the path - // come first. - repeated int32 object_id_path = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// An [X509Extension][google.cloud.security.privateca.v1.X509Extension] -// specifies an X.509 extension, which may be used in different parts of X.509 -// objects like certificates, CSRs, and CRLs. -message X509Extension { - // Required. The OID for this X.509 extension. - ObjectId object_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Indicates whether or not this extension is critical (i.e., if the - // client does not know how to handle this extension, the client should - // consider this to be an error). - bool critical = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The value of this X.509 extension. - bytes value = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// A [KeyUsage][google.cloud.security.privateca.v1.KeyUsage] describes key usage -// values that may appear in an X.509 certificate. -message KeyUsage { - // [KeyUsage.KeyUsageOptions][google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions] - // corresponds to the key usage values described in - // https://tools.ietf.org/html/rfc5280#section-4.2.1.3. - message KeyUsageOptions { - // The key may be used for digital signatures. - bool digital_signature = 1; - - // The key may be used for cryptographic commitments. Note that this may - // also be referred to as "non-repudiation". - bool content_commitment = 2; - - // The key may be used to encipher other keys. - bool key_encipherment = 3; - - // The key may be used to encipher data. - bool data_encipherment = 4; - - // The key may be used in a key agreement protocol. - bool key_agreement = 5; - - // The key may be used to sign certificates. - bool cert_sign = 6; - - // The key may be used sign certificate revocation lists. - bool crl_sign = 7; - - // The key may be used to encipher only. - bool encipher_only = 8; - - // The key may be used to decipher only. - bool decipher_only = 9; - } - - // [KeyUsage.ExtendedKeyUsageOptions][google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions] - // has fields that correspond to certain common OIDs that could be specified - // as an extended key usage value. - message ExtendedKeyUsageOptions { - // Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW - // server authentication", though regularly used for non-WWW TLS. - bool server_auth = 1; - - // Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW - // client authentication", though regularly used for non-WWW TLS. - bool client_auth = 2; - - // Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of - // downloadable executable code client authentication". - bool code_signing = 3; - - // Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email - // protection". - bool email_protection = 4; - - // Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding - // the hash of an object to a time". - bool time_stamping = 5; - - // Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing - // OCSP responses". - bool ocsp_signing = 6; - } - - // Describes high-level ways in which a key may be used. - KeyUsageOptions base_key_usage = 1; - - // Detailed scenarios in which a key may be used. - ExtendedKeyUsageOptions extended_key_usage = 2; - - // Used to describe extended key usages that are not listed in the - // [KeyUsage.ExtendedKeyUsageOptions][google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions] - // message. - repeated ObjectId unknown_extended_key_usages = 3; -} - -// [AttributeTypeAndValue][google.cloud.security.privateca.v1.AttributeTypeAndValue] -// specifies an attribute type and value. It can use either a OID or enum value -// to specify the attribute type. -message AttributeTypeAndValue { - // The attribute type for the attribute and value pair. - oneof attribute_type { - // The attribute type of the attribute and value pair. - AttributeType type = 1; - - // Object ID for an attribute type of an attribute and value pair. - ObjectId object_id = 2; - } - - // The value for the attribute type. - string value = 3; -} - -// [RelativeDistinguishedName][google.cloud.security.privateca.v1.RelativeDistinguishedName] -// specifies a relative distinguished name which will be used to build a -// distinguished name. -message RelativeDistinguishedName { - // Attributes describes the attribute value assertions in the RDN. - repeated AttributeTypeAndValue attributes = 1; -} - -// [Subject][google.cloud.security.privateca.v1.Subject] describes parts of a -// distinguished name that, in turn, describes the subject of the certificate. -message Subject { - // The "common name" of the subject. - string common_name = 1; - - // The country code of the subject. - string country_code = 2; - - // The organization of the subject. - string organization = 3; - - // The organizational_unit of the subject. - string organizational_unit = 4; - - // The locality or city of the subject. - string locality = 5; - - // The province, territory, or regional state of the subject. - string province = 6; - - // The street address of the subject. - string street_address = 7; - - // The postal code of the subject. - string postal_code = 8; - - // This field can be used in place of the named subject fields. - repeated RelativeDistinguishedName rdn_sequence = 9; -} - -// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] -// corresponds to a more modern way of listing what the asserted identity is in -// a certificate (i.e., compared to the "common name" in the distinguished -// name). -message SubjectAltNames { - // Contains only valid, fully-qualified host names. - repeated string dns_names = 1; - - // Contains only valid RFC 3986 URIs. - repeated string uris = 2; - - // Contains only valid RFC 2822 E-mail addresses. - repeated string email_addresses = 3; - - // Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses. - repeated string ip_addresses = 4; - - // Contains additional subject alternative name values. - // For each custom_san, the `value` field must contain an ASN.1 encoded - // UTF8String. - repeated X509Extension custom_sans = 5; -} - -// Describes constraints on a -// [Certificate][google.cloud.security.privateca.v1.Certificate]'s -// [Subject][google.cloud.security.privateca.v1.Subject] and -// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]. -message CertificateIdentityConstraints { - // Optional. A CEL expression that may be used to validate the resolved X.509 - // Subject and/or Subject Alternative Name before a certificate is signed. To - // see the full allowed syntax and some examples, see - // https://cloud.google.com/certificate-authority-service/docs/using-cel - google.type.Expr cel_expression = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. If this is true, the - // [Subject][google.cloud.security.privateca.v1.Subject] field may be copied - // from a certificate request into the signed certificate. Otherwise, the - // requested [Subject][google.cloud.security.privateca.v1.Subject] will be - // discarded. - optional bool allow_subject_passthrough = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Required. If this is true, the - // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] - // extension may be copied from a certificate request into the signed - // certificate. Otherwise, the requested - // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] will - // be discarded. - optional bool allow_subject_alt_names_passthrough = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// Describes a set of X.509 extensions that may be part of some certificate -// issuance controls. -message CertificateExtensionConstraints { - // Describes well-known X.509 extensions that can appear in a - // [Certificate][google.cloud.security.privateca.v1.Certificate], not - // including the - // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] - // extension. - enum KnownCertificateExtension { - // Not specified. - KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED = 0; - - // Refers to a certificate's Key Usage extension, as described in [RFC 5280 - // section 4.2.1.3](https://tools.ietf.org/html/rfc5280#section-4.2.1.3). - // This corresponds to the - // [KeyUsage.base_key_usage][google.cloud.security.privateca.v1.KeyUsage.base_key_usage] - // field. - BASE_KEY_USAGE = 1; - - // Refers to a certificate's Extended Key Usage extension, as described in - // [RFC 5280 - // section 4.2.1.12](https://tools.ietf.org/html/rfc5280#section-4.2.1.12). - // This corresponds to the - // [KeyUsage.extended_key_usage][google.cloud.security.privateca.v1.KeyUsage.extended_key_usage] - // message. - EXTENDED_KEY_USAGE = 2; - - // Refers to a certificate's Basic Constraints extension, as described in - // [RFC 5280 - // section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9). - // This corresponds to the - // [X509Parameters.ca_options][google.cloud.security.privateca.v1.X509Parameters.ca_options] - // field. - CA_OPTIONS = 3; - - // Refers to a certificate's Policy object identifiers, as described in - // [RFC 5280 - // section 4.2.1.4](https://tools.ietf.org/html/rfc5280#section-4.2.1.4). - // This corresponds to the - // [X509Parameters.policy_ids][google.cloud.security.privateca.v1.X509Parameters.policy_ids] - // field. - POLICY_IDS = 4; - - // Refers to OCSP servers in a certificate's Authority Information Access - // extension, as described in - // [RFC 5280 - // section 4.2.2.1](https://tools.ietf.org/html/rfc5280#section-4.2.2.1), - // This corresponds to the - // [X509Parameters.aia_ocsp_servers][google.cloud.security.privateca.v1.X509Parameters.aia_ocsp_servers] - // field. - AIA_OCSP_SERVERS = 5; - - // Refers to Name Constraints extension as described in - // [RFC 5280 - // section 4.2.1.10](https://tools.ietf.org/html/rfc5280#section-4.2.1.10) - NAME_CONSTRAINTS = 6; - } - - // Optional. A set of named X.509 extensions. Will be combined with - // [additional_extensions][google.cloud.security.privateca.v1.CertificateExtensionConstraints.additional_extensions] - // to determine the full set of X.509 extensions. - repeated KnownCertificateExtension known_extensions = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A set of [ObjectIds][google.cloud.security.privateca.v1.ObjectId] - // identifying custom X.509 extensions. Will be combined with - // [known_extensions][google.cloud.security.privateca.v1.CertificateExtensionConstraints.known_extensions] - // to determine the full set of X.509 extensions. - repeated ObjectId additional_extensions = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// [AttributeType][google.cloud.security.privateca.v1.AttributeType] specifies -// the type of Attribute in a relative distinguished name. -enum AttributeType { - // Attribute type is unspecified. - ATTRIBUTE_TYPE_UNSPECIFIED = 0; - - // The "common name" of the subject. - COMMON_NAME = 1; - - // The country code of the subject. - COUNTRY_CODE = 2; - - // The organization of the subject. - ORGANIZATION = 3; - - // The organizational unit of the subject. - ORGANIZATIONAL_UNIT = 4; - - // The locality or city of the subject. - LOCALITY = 5; - - // The province, territory, or regional state of the subject. - PROVINCE = 6; - - // The street address of the subject. - STREET_ADDRESS = 7; - - // The postal code of the subject. - POSTAL_CODE = 8; -} - -// A [RevocationReason][google.cloud.security.privateca.v1.RevocationReason] -// indicates whether a -// [Certificate][google.cloud.security.privateca.v1.Certificate] has been -// revoked, and the reason for revocation. These correspond to standard -// revocation reasons from RFC 5280. Note that the enum labels and values in -// this definition are not the same ASN.1 values defined in RFC 5280. These -// values will be translated to the correct ASN.1 values when a CRL is created. -enum RevocationReason { - // Default unspecified value. This value does indicate that a - // [Certificate][google.cloud.security.privateca.v1.Certificate] has been - // revoked, but that a reason has not been recorded. - REVOCATION_REASON_UNSPECIFIED = 0; - - // Key material for this - // [Certificate][google.cloud.security.privateca.v1.Certificate] may have - // leaked. - KEY_COMPROMISE = 1; - - // The key material for a certificate authority in the issuing path may have - // leaked. - CERTIFICATE_AUTHORITY_COMPROMISE = 2; - - // The subject or other attributes in this - // [Certificate][google.cloud.security.privateca.v1.Certificate] have changed. - AFFILIATION_CHANGED = 3; - - // This [Certificate][google.cloud.security.privateca.v1.Certificate] has been - // superseded. - SUPERSEDED = 4; - - // This [Certificate][google.cloud.security.privateca.v1.Certificate] or - // entities in the issuing path have ceased to operate. - CESSATION_OF_OPERATION = 5; - - // This [Certificate][google.cloud.security.privateca.v1.Certificate] should - // not be considered valid, it is expected that it may become valid in the - // future. - CERTIFICATE_HOLD = 6; - - // This [Certificate][google.cloud.security.privateca.v1.Certificate] no - // longer has permission to assert the listed attributes. - PRIVILEGE_WITHDRAWN = 7; - - // The authority which determines appropriate attributes for a - // [Certificate][google.cloud.security.privateca.v1.Certificate] may have been - // compromised. - ATTRIBUTE_AUTHORITY_COMPROMISE = 8; -} - -// Describes the way in which a -// [Certificate][google.cloud.security.privateca.v1.Certificate]'s -// [Subject][google.cloud.security.privateca.v1.Subject] and/or -// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] will be -// resolved. -enum SubjectRequestMode { - // Not specified. - SUBJECT_REQUEST_MODE_UNSPECIFIED = 0; - - // The default mode used in most cases. Indicates that the certificate's - // [Subject][google.cloud.security.privateca.v1.Subject] and/or - // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] are - // specified in the certificate request. This mode requires the caller to have - // the `privateca.certificates.create` permission. - DEFAULT = 1; - - // A mode used to get an accurate representation of the Subject - // field's distinguished name. Indicates that the certificate's - // [Subject][google.cloud.security.privateca.v1.Subject] and/or - // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] are - // specified in the certificate request. When parsing a PEM CSR this mode will - // maintain the sequence of RDNs found in the CSR's subject field in the - // issued [Certificate][google.cloud.security.privateca.v1.Certificate]. This - // mode requires the caller to have the `privateca.certificates.create` - // permission. - RDN_SEQUENCE = 3; - - // A mode reserved for special cases. Indicates that the certificate should - // have one SPIFFE - // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] set - // by the service based on the caller's identity. This mode will ignore any - // explicitly specified [Subject][google.cloud.security.privateca.v1.Subject] - // and/or - // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] in - // the certificate request. This mode requires the caller to have the - // `privateca.certificates.createForSelf` permission. - REFLECTED_SPIFFE = 2; -} diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto deleted file mode 100644 index 28e67660da66..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto +++ /dev/null @@ -1,1484 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.security.privateca.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/security/privateca/v1/resources.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Security.PrivateCA.V1"; -option go_package = "cloud.google.com/go/security/privateca/apiv1/privatecapb;privatecapb"; -option java_multiple_files = true; -option java_outer_classname = "PrivateCaProto"; -option java_package = "com.google.cloud.security.privateca.v1"; -option php_namespace = "Google\\Cloud\\Security\\PrivateCA\\V1"; -option ruby_package = "Google::Cloud::Security::PrivateCA::V1"; - -// [Certificate Authority -// Service][google.cloud.security.privateca.v1.CertificateAuthorityService] -// manages private certificate authorities and issued certificates. -service CertificateAuthorityService { - option (google.api.default_host) = "privateca.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Create a new [Certificate][google.cloud.security.privateca.v1.Certificate] - // in a given Project, Location from a particular - // [CaPool][google.cloud.security.privateca.v1.CaPool]. - rpc CreateCertificate(CreateCertificateRequest) returns (Certificate) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/caPools/*}/certificates" - body: "certificate" - }; - option (google.api.method_signature) = "parent,certificate,certificate_id"; - } - - // Returns a [Certificate][google.cloud.security.privateca.v1.Certificate]. - rpc GetCertificate(GetCertificateRequest) returns (Certificate) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists [Certificates][google.cloud.security.privateca.v1.Certificate]. - rpc ListCertificates(ListCertificatesRequest) - returns (ListCertificatesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/caPools/*}/certificates" - }; - option (google.api.method_signature) = "parent"; - } - - // Revoke a [Certificate][google.cloud.security.privateca.v1.Certificate]. - rpc RevokeCertificate(RevokeCertificateRequest) returns (Certificate) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}:revoke" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Update a [Certificate][google.cloud.security.privateca.v1.Certificate]. - // Currently, the only field you can update is the - // [labels][google.cloud.security.privateca.v1.Certificate.labels] field. - rpc UpdateCertificate(UpdateCertificateRequest) returns (Certificate) { - option (google.api.http) = { - patch: "/v1/{certificate.name=projects/*/locations/*/caPools/*/certificates/*}" - body: "certificate" - }; - option (google.api.method_signature) = "certificate,update_mask"; - } - - // Activate a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // that is in state - // [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] - // and is of type - // [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. - // After the parent Certificate Authority signs a certificate signing request - // from - // [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr], - // this method can complete the activation process. - rpc ActivateCertificateAuthority(ActivateCertificateAuthorityRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:activate" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Create a new - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in a given Project and Location. - rpc CreateCertificateAuthority(CreateCertificateAuthorityRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities" - body: "certificate_authority" - }; - option (google.api.method_signature) = - "parent,certificate_authority,certificate_authority_id"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Disable a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc DisableCertificateAuthority(DisableCertificateAuthorityRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:disable" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Enable a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc EnableCertificateAuthority(EnableCertificateAuthorityRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:enable" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Fetch a certificate signing request (CSR) from a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // that is in state - // [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] - // and is of type - // [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. - // The CSR must then be signed by the desired parent Certificate Authority, - // which could be another - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // resource, or could be an on-prem certificate authority. See also - // [ActivateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority]. - rpc FetchCertificateAuthorityCsr(FetchCertificateAuthorityCsrRequest) - returns (FetchCertificateAuthorityCsrResponse) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:fetch" - }; - option (google.api.method_signature) = "name"; - } - - // Returns a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc GetCertificateAuthority(GetCertificateAuthorityRequest) - returns (CertificateAuthority) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists - // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc ListCertificateAuthorities(ListCertificateAuthoritiesRequest) - returns (ListCertificateAuthoritiesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities" - }; - option (google.api.method_signature) = "parent"; - } - - // Undelete a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // that has been deleted. - rpc UndeleteCertificateAuthority(UndeleteCertificateAuthorityRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:undelete" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Delete a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc DeleteCertificateAuthority(DeleteCertificateAuthorityRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Update a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc UpdateCertificateAuthority(UpdateCertificateAuthorityRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{certificate_authority.name=projects/*/locations/*/caPools/*/certificateAuthorities/*}" - body: "certificate_authority" - }; - option (google.api.method_signature) = "certificate_authority,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Create a [CaPool][google.cloud.security.privateca.v1.CaPool]. - rpc CreateCaPool(CreateCaPoolRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/caPools" - body: "ca_pool" - }; - option (google.api.method_signature) = "parent,ca_pool,ca_pool_id"; - option (google.longrunning.operation_info) = { - response_type: "CaPool" - metadata_type: "OperationMetadata" - }; - } - - // Update a [CaPool][google.cloud.security.privateca.v1.CaPool]. - rpc UpdateCaPool(UpdateCaPoolRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{ca_pool.name=projects/*/locations/*/caPools/*}" - body: "ca_pool" - }; - option (google.api.method_signature) = "ca_pool,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "CaPool" - metadata_type: "OperationMetadata" - }; - } - - // Returns a [CaPool][google.cloud.security.privateca.v1.CaPool]. - rpc GetCaPool(GetCaPoolRequest) returns (CaPool) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/caPools/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists [CaPools][google.cloud.security.privateca.v1.CaPool]. - rpc ListCaPools(ListCaPoolsRequest) returns (ListCaPoolsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/caPools" - }; - option (google.api.method_signature) = "parent"; - } - - // Delete a [CaPool][google.cloud.security.privateca.v1.CaPool]. - rpc DeleteCaPool(DeleteCaPoolRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/caPools/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // FetchCaCerts returns the current trust anchor for the - // [CaPool][google.cloud.security.privateca.v1.CaPool]. This will include CA - // certificate chains for all certificate authorities in the ENABLED, - // DISABLED, or STAGED states. - rpc FetchCaCerts(FetchCaCertsRequest) returns (FetchCaCertsResponse) { - option (google.api.http) = { - post: "/v1/{ca_pool=projects/*/locations/*/caPools/*}:fetchCaCerts" - body: "*" - }; - option (google.api.method_signature) = "ca_pool"; - } - - // Returns a - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. - rpc GetCertificateRevocationList(GetCertificateRevocationListRequest) - returns (CertificateRevocationList) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists - // [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList]. - rpc ListCertificateRevocationLists(ListCertificateRevocationListsRequest) - returns (ListCertificateRevocationListsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/caPools/*/certificateAuthorities/*}/certificateRevocationLists" - }; - option (google.api.method_signature) = "parent"; - } - - // Update a - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. - rpc UpdateCertificateRevocationList(UpdateCertificateRevocationListRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{certificate_revocation_list.name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}" - body: "certificate_revocation_list" - }; - option (google.api.method_signature) = - "certificate_revocation_list,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "CertificateRevocationList" - metadata_type: "OperationMetadata" - }; - } - - // Create a new - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - // in a given Project and Location. - rpc CreateCertificateTemplate(CreateCertificateTemplateRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/certificateTemplates" - body: "certificate_template" - }; - option (google.api.method_signature) = - "parent,certificate_template,certificate_template_id"; - option (google.longrunning.operation_info) = { - response_type: "CertificateTemplate" - metadata_type: "OperationMetadata" - }; - } - - // DeleteCertificateTemplate deletes a - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. - rpc DeleteCertificateTemplate(DeleteCertificateTemplateRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/certificateTemplates/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.cloud.security.privateca.v1.OperationMetadata" - }; - } - - // Returns a - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. - rpc GetCertificateTemplate(GetCertificateTemplateRequest) - returns (CertificateTemplate) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/certificateTemplates/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists - // [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate]. - rpc ListCertificateTemplates(ListCertificateTemplatesRequest) - returns (ListCertificateTemplatesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/certificateTemplates" - }; - option (google.api.method_signature) = "parent"; - } - - // Update a - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. - rpc UpdateCertificateTemplate(UpdateCertificateTemplateRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{certificate_template.name=projects/*/locations/*/certificateTemplates/*}" - body: "certificate_template" - }; - option (google.api.method_signature) = "certificate_template,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "CertificateTemplate" - metadata_type: "OperationMetadata" - }; - } -} - -// Request message for -// [CertificateAuthorityService.CreateCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate]. -message CreateCertificateRequest { - // Required. The resource name of the - // [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the - // [Certificate][google.cloud.security.privateca.v1.Certificate], in the - // format `projects/*/locations/*/caPools/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CaPool" - } - ]; - - // Optional. It must be unique within a location and match the regular - // expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in the Enterprise - // [CertificateAuthority.tier][google.cloud.security.privateca.v1.CertificateAuthority.tier], - // but is optional and its value is ignored otherwise. - string certificate_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. A [Certificate][google.cloud.security.privateca.v1.Certificate] - // with initial field values. - Certificate certificate = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and the - // request times out. If you make the request again with the same request ID, - // the server can check if original operation with the same request ID was - // received, and if so, will ignore the second request. This prevents clients - // from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If this is true, no - // [Certificate][google.cloud.security.privateca.v1.Certificate] resource will - // be persisted regardless of the - // [CaPool][google.cloud.security.privateca.v1.CaPool]'s - // [tier][google.cloud.security.privateca.v1.CaPool.tier], and the returned - // [Certificate][google.cloud.security.privateca.v1.Certificate] will not - // contain the - // [pem_certificate][google.cloud.security.privateca.v1.Certificate.pem_certificate] - // field. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The resource ID of the - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // that should issue the certificate. This optional field will ignore the - // load-balancing scheme of the Pool and directly issue the certificate from - // the CA with the specified ID, contained in the same - // [CaPool][google.cloud.security.privateca.v1.CaPool] referenced by `parent`. - // Per-CA quota rules apply. If left empty, a - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // will be chosen from the [CaPool][google.cloud.security.privateca.v1.CaPool] - // by the service. For example, to issue a - // [Certificate][google.cloud.security.privateca.v1.Certificate] from a - // Certificate Authority with resource name - // "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", - // you can set the - // [parent][google.cloud.security.privateca.v1.CreateCertificateRequest.parent] - // to "projects/my-project/locations/us-central1/caPools/my-pool" and the - // [issuing_certificate_authority_id][google.cloud.security.privateca.v1.CreateCertificateRequest.issuing_certificate_authority_id] - // to "my-ca". - string issuing_certificate_authority_id = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.GetCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificate]. -message GetCertificateRequest { - // Required. The [name][google.cloud.security.privateca.v1.Certificate.name] - // of the [Certificate][google.cloud.security.privateca.v1.Certificate] to - // get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/Certificate" - } - ]; -} - -// Request message for -// [CertificateAuthorityService.ListCertificates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates]. -message ListCertificatesRequest { - // Required. The resource name of the parent associated with the - // [Certificates][google.cloud.security.privateca.v1.Certificate], in the - // format `projects/*/locations/*/caPools/*`. The parent resource name can be - // in one of two forms: - // - // 1. **Specific CA Pool:** To list certificates within a single CA Pool: - // `projects/*/locations/*/caPools/*` - // - // 2. **All CA Pools in a Location:** To list certificates across *all* CA - // Pools in a given project and location, use the wildcard character (`-`) - // in place of the CA Pool ID. - // Example: `projects/*/locations/*/caPools/-` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CaPool" - } - ]; - - // Optional. Limit on the number of - // [Certificates][google.cloud.security.privateca.v1.Certificate] to include - // in the response. Further - // [Certificates][google.cloud.security.privateca.v1.Certificate] can - // subsequently be obtained by including the - // [ListCertificatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token] - // in a subsequent request. If unspecified, the server will pick an - // appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Pagination token, returned earlier via - // [ListCertificatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token]. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only include resources that match the filter in the response. For - // details on supported filters and syntax, see [Certificates Filtering - // documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specify how the results should be sorted. For details on - // supported fields and syntax, see [Certificates Sorting - // documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [CertificateAuthorityService.ListCertificates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates]. -message ListCertificatesResponse { - // The list of [Certificates][google.cloud.security.privateca.v1.Certificate]. - repeated Certificate certificates = 1; - - // A token to retrieve next page of results. Pass this value in - // [ListCertificatesRequest.page_token][google.cloud.security.privateca.v1.ListCertificatesRequest.page_token] - // to retrieve the next page of results. - string next_page_token = 2; - - // A list of locations (e.g. "us-west1") that could not be reached. - repeated string unreachable = 3; -} - -// Request message for -// [CertificateAuthorityService.RevokeCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificate]. -message RevokeCertificateRequest { - // Required. The resource name for this - // [Certificate][google.cloud.security.privateca.v1.Certificate] in the format - // `projects/*/locations/*/caPools/*/certificates/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/Certificate" - } - ]; - - // Required. The - // [RevocationReason][google.cloud.security.privateca.v1.RevocationReason] for - // revoking this certificate. - RevocationReason reason = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.UpdateCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificate]. -message UpdateCertificateRequest { - // Required. [Certificate][google.cloud.security.privateca.v1.Certificate] - // with updated values. - Certificate certificate = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of fields to be updated in this request. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.ActivateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority]. -message ActivateCertificateAuthorityRequest { - // Required. The resource name for this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Required. The signed CA certificate issued from - // [FetchCertificateAuthorityCsrResponse.pem_csr][google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.pem_csr]. - string pem_ca_certificate = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Must include information about the issuer of - // 'pem_ca_certificate', and any further issuers until the self-signed CA. - SubordinateConfig subordinate_config = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for -// [CertificateAuthorityService.CreateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthority]. -message CreateCertificateAuthorityRequest { - // Required. The resource name of the - // [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the - // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority], - // in the format `projects/*/locations/*/caPools/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CaPool" - } - ]; - - // Required. It must be unique within a location and match the regular - // expression `[a-zA-Z0-9_-]{1,63}` - string certificate_authority_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. A - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // with initial field values. - CertificateAuthority certificate_authority = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.DisableCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthority]. -message DisableCertificateAuthorityRequest { - // Required. The resource name for this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. This field allows this CA to be disabled even if it's being - // depended on by another resource. However, doing so may result in unintended - // and unrecoverable effects on any dependent resources since the CA will - // no longer be able to issue certificates. - bool ignore_dependent_resources = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.EnableCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthority]. -message EnableCertificateAuthorityRequest { - // Required. The resource name for this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for -// [CertificateAuthorityService.FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr]. -message FetchCertificateAuthorityCsrRequest { - // Required. The resource name for this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; -} - -// Response message for -// [CertificateAuthorityService.FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr]. -message FetchCertificateAuthorityCsrResponse { - // Output only. The PEM-encoded signed certificate signing request (CSR). - string pem_csr = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for -// [CertificateAuthorityService.GetCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthority]. -message GetCertificateAuthorityRequest { - // Required. The - // [name][google.cloud.security.privateca.v1.CertificateAuthority.name] of the - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; -} - -// Request message for -// [CertificateAuthorityService.ListCertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities]. -message ListCertificateAuthoritiesRequest { - // Required. The resource name of the - // [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the - // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority], - // in the format `projects/*/locations/*/caPools/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CaPool" - } - ]; - - // Optional. Limit on the number of - // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority] - // to include in the response. Further - // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority] - // can subsequently be obtained by including the - // [ListCertificateAuthoritiesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token] - // in a subsequent request. If unspecified, the server will pick an - // appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Pagination token, returned earlier via - // [ListCertificateAuthoritiesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token]. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only include resources that match the filter in the response. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specify how the results should be sorted. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [CertificateAuthorityService.ListCertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities]. -message ListCertificateAuthoritiesResponse { - // The list of - // [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority]. - repeated CertificateAuthority certificate_authorities = 1; - - // A token to retrieve next page of results. Pass this value in - // [ListCertificateAuthoritiesRequest.page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.page_token] - // to retrieve the next page of results. - string next_page_token = 2; - - // A list of locations (e.g. "us-west1") that could not be reached. - repeated string unreachable = 3; -} - -// Request message for -// [CertificateAuthorityService.UndeleteCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority]. -message UndeleteCertificateAuthorityRequest { - // Required. The resource name for this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for -// [CertificateAuthorityService.DeleteCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthority]. -message DeleteCertificateAuthorityRequest { - // Required. The resource name for this - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. This field allows the CA to be deleted even if the CA has - // active certs. Active certs include both unrevoked and unexpired certs. - bool ignore_active_certificates = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If this flag is set, the Certificate Authority will be deleted as - // soon as possible without a 30-day grace period where undeletion would have - // been allowed. If you proceed, there will be no way to recover this CA. - bool skip_grace_period = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. This field allows this CA to be deleted even if it's being - // depended on by another resource. However, doing so may result in unintended - // and unrecoverable effects on any dependent resources since the CA will - // no longer be able to issue certificates. - bool ignore_dependent_resources = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.UpdateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthority]. -message UpdateCertificateAuthorityRequest { - // Required. - // [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - // with updated values. - CertificateAuthority certificate_authority = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of fields to be updated in this request. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for -// [CertificateAuthorityService.CreateCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPool]. -message CreateCaPoolRequest { - // Required. The resource name of the location associated with the - // [CaPool][google.cloud.security.privateca.v1.CaPool], in the format - // `projects/*/locations/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. It must be unique within a location and match the regular - // expression `[a-zA-Z0-9_-]{1,63}` - string ca_pool_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. A [CaPool][google.cloud.security.privateca.v1.CaPool] with - // initial field values. - CaPool ca_pool = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for -// [CertificateAuthorityService.UpdateCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPool]. -message UpdateCaPoolRequest { - // Required. [CaPool][google.cloud.security.privateca.v1.CaPool] with updated - // values. - CaPool ca_pool = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of fields to be updated in this request. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for -// [CertificateAuthorityService.DeleteCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPool]. -message DeleteCaPoolRequest { - // Required. The resource name for this - // [CaPool][google.cloud.security.privateca.v1.CaPool] in the format - // `projects/*/locations/*/caPools/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CaPool" - } - ]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. This field allows this pool to be deleted even if it's being - // depended on by another resource. However, doing so may result in unintended - // and unrecoverable effects on any dependent resources since the pool will - // no longer be able to issue certificates. - bool ignore_dependent_resources = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.FetchCaCerts][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts]. -message FetchCaCertsRequest { - // Required. The resource name for the - // [CaPool][google.cloud.security.privateca.v1.CaPool] in the format - // `projects/*/locations/*/caPools/*`. - string ca_pool = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CaPool" - } - ]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [CertificateAuthorityService.FetchCaCerts][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts]. -message FetchCaCertsResponse { - message CertChain { - // The certificates that form the CA chain, from leaf to root order. - repeated string certificates = 1; - } - - // The PEM encoded CA certificate chains of all certificate authorities in - // this [CaPool][google.cloud.security.privateca.v1.CaPool] in the ENABLED, - // DISABLED, or STAGED states. - repeated CertChain ca_certs = 1; -} - -// Request message for -// [CertificateAuthorityService.GetCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPool]. -message GetCaPoolRequest { - // Required. The [name][google.cloud.security.privateca.v1.CaPool.name] of the - // [CaPool][google.cloud.security.privateca.v1.CaPool] to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CaPool" - } - ]; -} - -// Request message for -// [CertificateAuthorityService.ListCaPools][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools]. -message ListCaPoolsRequest { - // Required. The resource name of the location associated with the - // [CaPools][google.cloud.security.privateca.v1.CaPool], in the format - // `projects/*/locations/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. Limit on the number of - // [CaPools][google.cloud.security.privateca.v1.CaPool] to include in the - // response. Further [CaPools][google.cloud.security.privateca.v1.CaPool] can - // subsequently be obtained by including the - // [ListCaPoolsResponse.next_page_token][google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token] - // in a subsequent request. If unspecified, the server will pick an - // appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Pagination token, returned earlier via - // [ListCaPoolsResponse.next_page_token][google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token]. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only include resources that match the filter in the response. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specify how the results should be sorted. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [CertificateAuthorityService.ListCaPools][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools]. -message ListCaPoolsResponse { - // The list of [CaPools][google.cloud.security.privateca.v1.CaPool]. - repeated CaPool ca_pools = 1; - - // A token to retrieve next page of results. Pass this value in - // [ListCertificateAuthoritiesRequest.page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.page_token] - // to retrieve the next page of results. - string next_page_token = 2; - - // A list of locations (e.g. "us-west1") that could not be reached. - repeated string unreachable = 3; -} - -// Request message for -// [CertificateAuthorityService.GetCertificateRevocationList][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationList]. -message GetCertificateRevocationListRequest { - // Required. The - // [name][google.cloud.security.privateca.v1.CertificateRevocationList.name] - // of the - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] - // to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateRevocationList" - } - ]; -} - -// Request message for -// [CertificateAuthorityService.ListCertificateRevocationLists][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists]. -message ListCertificateRevocationListsRequest { - // Required. The resource name of the location associated with the - // [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList], - // in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. Limit on the number of - // [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList] - // to include in the response. Further - // [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList] - // can subsequently be obtained by including the - // [ListCertificateRevocationListsResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token] - // in a subsequent request. If unspecified, the server will pick an - // appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Pagination token, returned earlier via - // [ListCertificateRevocationListsResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token]. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only include resources that match the filter in the response. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specify how the results should be sorted. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [CertificateAuthorityService.ListCertificateRevocationLists][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists]. -message ListCertificateRevocationListsResponse { - // The list of - // [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList]. - repeated CertificateRevocationList certificate_revocation_lists = 1; - - // A token to retrieve next page of results. Pass this value in - // [ListCertificateRevocationListsRequest.page_token][google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.page_token] - // to retrieve the next page of results. - string next_page_token = 2; - - // A list of locations (e.g. "us-west1") that could not be reached. - repeated string unreachable = 3; -} - -// Request message for -// [CertificateAuthorityService.UpdateCertificateRevocationList][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationList]. -message UpdateCertificateRevocationListRequest { - // Required. - // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] - // with updated values. - CertificateRevocationList certificate_revocation_list = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of fields to be updated in this request. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.CreateCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplate]. -message CreateCertificateTemplateRequest { - // Required. The resource name of the location associated with the - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate], - // in the format `projects/*/locations/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. It must be unique within a location and match the regular - // expression `[a-zA-Z0-9_-]{1,63}` - string certificate_template_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. A - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - // with initial field values. - CertificateTemplate certificate_template = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for -// [CertificateAuthorityService.DeleteCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplate]. -message DeleteCertificateTemplateRequest { - // Required. The resource name for this - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - // in the format `projects/*/locations/*/certificateTemplates/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateTemplate" - } - ]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for -// [CertificateAuthorityService.GetCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplate]. -message GetCertificateTemplateRequest { - // Required. The - // [name][google.cloud.security.privateca.v1.CertificateTemplate.name] of the - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - // to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateTemplate" - } - ]; -} - -// Request message for -// [CertificateAuthorityService.ListCertificateTemplates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates]. -message ListCertificateTemplatesRequest { - // Required. The resource name of the location associated with the - // [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate], - // in the format `projects/*/locations/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. Limit on the number of - // [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate] - // to include in the response. Further - // [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate] - // can subsequently be obtained by including the - // [ListCertificateTemplatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token] - // in a subsequent request. If unspecified, the server will pick an - // appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Pagination token, returned earlier via - // [ListCertificateTemplatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token]. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only include resources that match the filter in the response. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specify how the results should be sorted. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [CertificateAuthorityService.ListCertificateTemplates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates]. -message ListCertificateTemplatesResponse { - // The list of - // [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate]. - repeated CertificateTemplate certificate_templates = 1; - - // A token to retrieve next page of results. Pass this value in - // [ListCertificateTemplatesRequest.page_token][google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.page_token] - // to retrieve the next page of results. - string next_page_token = 2; - - // A list of locations (e.g. "us-west1") that could not be reached. - repeated string unreachable = 3; -} - -// Request message for -// [CertificateAuthorityService.UpdateCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplate]. -message UpdateCertificateTemplateRequest { - // Required. - // [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - // with updated values. - CertificateTemplate certificate_template = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of fields to be updated in this request. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that - // if you must retry your request, the server will know to ignore the request - // if it has already been completed. The server will guarantee that for at - // least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Human-readable status of the operation, if any. - string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have - // [google.longrunning.Operation.error][google.longrunning.Operation.error] - // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/resources.proto b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/resources.proto deleted file mode 100644 index 211ed3eaf892..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/resources.proto +++ /dev/null @@ -1,902 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.security.privateca.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.Security.PrivateCA.V1Beta1"; -option go_package = "cloud.google.com/go/security/privateca/apiv1beta1/privatecapb;privatecapb"; -option java_multiple_files = true; -option java_outer_classname = "PrivateCaResourcesProto"; -option java_package = "com.google.cloud.security.privateca.v1beta1"; -option php_namespace = "Google\\Cloud\\Security\\PrivateCA\\V1beta1"; -option ruby_package = "Google::Cloud::Security::PrivateCA::V1beta1"; - -// A [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] represents an individual Certificate Authority. -// A [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] can be used to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. -message CertificateAuthority { - option (google.api.resource) = { - type: "privateca.googleapis.com/CertificateAuthority" - pattern: "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}" - }; - - // Options that affect all certificates issued by a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - message IssuingOptions { - // Required. When true, includes a URL to the issuing CA certificate in the - // "authority information access" X.509 extension. - bool include_ca_cert_url = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. When true, includes a URL to the CRL corresponding to certificates - // issued from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - // CRLs will expire 7 days from their creation. However, we will rebuild - // daily. CRLs are also rebuilt shortly after a certificate is revoked. - bool include_crl_access_url = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // The issuing policy for a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] will not be successfully issued from this - // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] if they violate the policy. - message CertificateAuthorityPolicy { - message AllowedConfigList { - // Required. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] - // must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper]. If a - // [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] has an empty field, any value will be - // allowed for that field. - repeated ReusableConfigWrapper allowed_config_values = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] specifies the allowed values for - // [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames] by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] when issuing - // [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. - message AllowedSubjectAltNames { - // Optional. Contains valid, fully-qualified host names. Glob patterns are also - // supported. To allow an explicit wildcard certificate, escape with - // backlash (i.e. `\*`). - // E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not - // `*.bar.com`, unless the [allow_globbing_dns_wildcards][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allow_globbing_dns_wildcards] field is set. - // E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not - // `foo.bar.com`. - repeated string allowed_dns_names = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To - // match across path seperators (i.e. '/') use the double star glob - // pattern (i.e. '**'). - repeated string allowed_uris = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also - // supported. - repeated string allowed_email_addresses = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6 - // addresses and subnet ranges. Subnet ranges are specified using the - // '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns - // are supported only for ip address entries (i.e. not for subnet ranges). - repeated string allowed_ips = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies if glob patterns used for [allowed_dns_names][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowed_dns_names] allows - // wildcard certificates. - bool allow_globbing_dns_wildcards = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies if to allow custom X509Extension values. - bool allow_custom_sans = 6 [(google.api.field_behavior) = OPTIONAL]; - } - - // [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] specifies the allowed ways in which - // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] may be requested from this - // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - message IssuanceModes { - // Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by - // specifying a CSR. - bool allow_csr_based_issuance = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. When true, allows callers to create [Certificates][google.cloud.security.privateca.v1beta1.Certificate] by - // specifying a [CertificateConfig][google.cloud.security.privateca.v1beta1.CertificateConfig]. - bool allow_config_based_issuance = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Allowed configurations or a single configuration for all issued - // certificates. - oneof config_policy { - // Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] - // must match at least one listed [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] in the list. - AllowedConfigList allowed_config_list = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. All [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] - // will use the provided configuration values, overwriting any requested - // configuration values. - ReusableConfigWrapper overwrite_config_values = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. If any [Subject][google.cloud.security.privateca.v1beta1.Subject] is specified here, then all - // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must - // match at least one listed [Subject][google.cloud.security.privateca.v1beta1.Subject]. If a [Subject][google.cloud.security.privateca.v1beta1.Subject] has an empty - // field, any value will be allowed for that field. - repeated Subject allowed_locations_and_organizations = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If any value is specified here, then all - // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must - // match at least one listed value. If no value is specified, all values - // will be allowed for this fied. Glob patterns are also supported. - repeated string allowed_common_names = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If a [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames] is specified here, then all - // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] issued by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must - // match [AllowedSubjectAltNames][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames]. If no value or an empty value - // is specified, any value will be allowed for the [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames] - // field. - AllowedSubjectAltNames allowed_sans = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum lifetime allowed by the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. Note that - // if the any part if the issuing chain expires before a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]'s - // requested maximum_lifetime, the effective lifetime will be explicitly - // truncated. - google.protobuf.Duration maximum_lifetime = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If specified, then only methods allowed in the [IssuanceModes][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes] may be - // used to issue [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. - IssuanceModes allowed_issuance_modes = 8 [(google.api.field_behavior) = OPTIONAL]; - } - - // URLs where a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will publish content. - message AccessUrls { - // The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate is - // published. This will only be set for CAs that have been activated. - string ca_certificate_access_url = 1; - - // The URL where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CRLs are published. This - // will only be set for CAs that have been activated. - string crl_access_url = 2; - } - - // A Cloud KMS key configuration that a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will use. - message KeyVersionSpec { - oneof KeyVersion { - // Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the - // format - // `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. - // This option enables full flexibility in the key's capabilities and - // properties. - string cloud_kms_key_version = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The algorithm to use for creating a managed Cloud KMS key for a for a - // simplified experience. All managed keys will be have their - // [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`. - SignHashAlgorithm algorithm = 2 [(google.api.field_behavior) = REQUIRED]; - } - } - - // The type of a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], indicating its issuing chain. - enum Type { - // Not specified. - TYPE_UNSPECIFIED = 0; - - // Self-signed CA. - SELF_SIGNED = 1; - - // Subordinate CA. Could be issued by a Private CA [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] - // or an unmanaged CA. - SUBORDINATE = 2; - } - - // The tier of a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], indicating its supported - // functionality and/or billing SKU. - enum Tier { - // Not specified. - TIER_UNSPECIFIED = 0; - - // Enterprise tier. - ENTERPRISE = 1; - - // DevOps tier. - DEVOPS = 2; - } - - // The state of a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], indicating if it can be used. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // Certificates can be issued from this CA. CRLs will be generated for this - // CA. - ENABLED = 1; - - // Certificates cannot be issued from this CA. CRLs will still be generated. - DISABLED = 2; - - // Certificates cannot be issued from this CA. CRLs will not be generated. - PENDING_ACTIVATION = 3; - - // Certificates cannot be issued from this CA. CRLs will not be generated. - PENDING_DELETION = 4; - } - - // The algorithm of a Cloud KMS CryptoKeyVersion of a - // [CryptoKey][google.cloud.kms.v1.CryptoKey] with the - // [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] value - // `ASYMMETRIC_SIGN`. These values correspond to the - // [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - // values. For RSA signing algorithms, the PSS algorithms should be preferred, - // use PKCS1 algorithms if required for compatibility. For further - // recommandations, see - // https://cloud.google.com/kms/docs/algorithms#algorithm_recommendations. - enum SignHashAlgorithm { - // Not specified. - SIGN_HASH_ALGORITHM_UNSPECIFIED = 0; - - // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256 - RSA_PSS_2048_SHA256 = 1; - - // maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256 - RSA_PSS_3072_SHA256 = 2; - - // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256 - RSA_PSS_4096_SHA256 = 3; - - // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256 - RSA_PKCS1_2048_SHA256 = 6; - - // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256 - RSA_PKCS1_3072_SHA256 = 7; - - // maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256 - RSA_PKCS1_4096_SHA256 = 8; - - // maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256 - EC_P256_SHA256 = 4; - - // maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384 - EC_P384_SHA384 = 5; - } - - // Output only. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the - // format `projects/*/locations/*/certificateAuthorities/*`. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Immutable. The [Type][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - Type type = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Immutable. The [Tier][google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier] of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - Tier tier = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Immutable. The config used to create a self-signed X.509 certificate or CSR. - CertificateConfig config = 4 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. The desired lifetime of the CA certificate. Used to create the - // "not_before_time" and "not_after_time" fields inside an X.509 - // certificate. - google.protobuf.Duration lifetime = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. Immutable. Used when issuing certificates for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. If this - // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] is a self-signed CertificateAuthority, this key - // is also used to sign the self-signed CA certificate. Otherwise, it - // is used to sign a CSR. - KeyVersionSpec key_spec = 6 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. The [CertificateAuthorityPolicy][google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy] to enforce when issuing - // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - CertificateAuthorityPolicy certificate_policy = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The [IssuingOptions][google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions] to follow when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate] - // from this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - IssuingOptions issuing_options = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If this is a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], this field will be set - // with the subordinate configuration, which describes its issuers. This may - // be updated, but this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] must continue to validate. - SubordinateConfig subordinate_config = 19 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The [State][google.cloud.security.privateca.v1beta1.CertificateAuthority.State] for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. This [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate chain, including the current - // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. Ordered such that the root issuer - // is the final element (consistent with RFC 5246). For a self-signed CA, this - // will only list the current [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s certificate. - repeated string pem_ca_certificates = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A structured description of this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]'s CA certificate - // and its issuers. Ordered as self-to-root. - repeated CertificateDescription ca_certificate_descriptions = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The name of a Cloud Storage bucket where this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will - // publish content, such as the CA certificate and CRLs. This must be a bucket - // name, without any prefixes (such as `gs://`) or suffixes (such as - // `.googleapis.com`). For example, to use a bucket named `my-bucket`, you - // would simply specify `my-bucket`. If not specified, a managed bucket will - // be created. - string gcs_bucket = 13 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. URLs for accessing content published by this CA, such as the CA certificate - // and CRLs. - AccessUrls access_urls = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was created. - google.protobuf.Timestamp create_time = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] was updated. - google.protobuf.Timestamp update_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] will be deleted, if - // scheduled for deletion. - google.protobuf.Timestamp delete_time = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Labels with user-defined metadata. - map labels = 18 [(google.api.field_behavior) = OPTIONAL]; -} - -// A [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] corresponds to a signed X.509 certificate -// Revocation List (CRL). A CRL contains the serial numbers of certificates that -// should no longer be trusted. -message CertificateRevocationList { - option (google.api.resource) = { - type: "privateca.googleapis.com/CertificateRevocationList" - pattern: "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}" - }; - - // Describes a revoked [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. - message RevokedCertificate { - // The resource path for the [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in the format - // `projects/*/locations/*/certificateAuthorities/*/certificates/*`. - string certificate = 1; - - // The serial number of the [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. - string hex_serial_number = 2; - - // The reason the [Certificate][google.cloud.security.privateca.v1beta1.Certificate] was revoked. - RevocationReason revocation_reason = 3; - } - - // The state of a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList], indicating if it is current. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] is up to date. - ACTIVE = 1; - - // The [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] is no longer current. - SUPERSEDED = 2; - } - - // Output only. The resource path for this [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] in - // the format - // `projects/*/locations/*/certificateAuthorities/*/ - // certificateRevocationLists/*`. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The CRL sequence number that appears in pem_crl. - int64 sequence_number = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The revoked serial numbers that appear in pem_crl. - repeated RevokedCertificate revoked_certificates = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The PEM-encoded X.509 CRL. - string pem_crl = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The location where 'pem_crl' can be accessed. - string access_url = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The [State][google.cloud.security.privateca.v1beta1.CertificateRevocationList.State] for this [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. - State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] was created. - google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] was updated. - google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Labels with user-defined metadata. - map labels = 9 [(google.api.field_behavior) = OPTIONAL]; -} - -// A [Certificate][google.cloud.security.privateca.v1beta1.Certificate] corresponds to a signed X.509 certificate issued by a -// [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. -message Certificate { - option (google.api.resource) = { - type: "privateca.googleapis.com/Certificate" - pattern: "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificates/{certificate}" - }; - - // Describes fields that are relavent to the revocation of a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. - message RevocationDetails { - // Indicates why a [Certificate][google.cloud.security.privateca.v1beta1.Certificate] was revoked. - RevocationReason revocation_state = 1; - - // The time at which this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] was revoked. - google.protobuf.Timestamp revocation_time = 2; - } - - // Output only. The resource path for this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in the format - // `projects/*/locations/*/certificateAuthorities/*/certificates/*`. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The config used to create a signed X.509 certificate. - oneof certificate_config { - // Immutable. A pem-encoded X.509 certificate signing request (CSR). - string pem_csr = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. A description of the certificate and key that does not require X.509 or - // ASN.1. - CertificateConfig config = 3 [(google.api.field_behavior) = IMMUTABLE]; - } - - // Required. Immutable. The desired lifetime of a certificate. Used to create the - // "not_before_time" and "not_after_time" fields inside an X.509 - // certificate. Note that the lifetime may be truncated if it would extend - // past the life of any certificate authority in the issuing chain. - google.protobuf.Duration lifetime = 4 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Output only. Details regarding the revocation of this [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. This - // [Certificate][google.cloud.security.privateca.v1beta1.Certificate] is considered revoked if and only if this field is present. - RevocationDetails revocation_details = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The pem-encoded, signed X.509 certificate. - string pem_certificate = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A structured description of the issued X.509 certificate. - CertificateDescription certificate_description = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The chain that may be used to verify the X.509 certificate. Expected to be - // in issuer-to-root order according to RFC 5246. - repeated string pem_certificate_chain = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] was created. - google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] was updated. - google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Labels with user-defined metadata. - map labels = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// A [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig] refers to a managed [ReusableConfigValues][google.cloud.security.privateca.v1beta1.ReusableConfigValues]. Those, in -// turn, are used to describe certain fields of an X.509 certificate, such as -// the key usage fields, fields specific to CA certificates, certificate policy -// extensions and custom extensions. -message ReusableConfig { - option (google.api.resource) = { - type: "privateca.googleapis.com/ReusableConfig" - pattern: "projects/{project}/locations/{location}/reusableConfigs/{reusable_config}" - }; - - // Output only. The resource path for this [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig] in the format - // `projects/*/locations/*/reusableConfigs/*`. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The config values. - ReusableConfigValues values = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A human-readable description of scenarios these ReusableConfigValues may be - // compatible with. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The time at which this [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig] was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig] was updated. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Labels with user-defined metadata. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// A [ReusableConfigValues][google.cloud.security.privateca.v1beta1.ReusableConfigValues] is used to describe certain fields of an -// X.509 certificate, such as the key usage fields, fields specific to CA -// certificates, certificate policy extensions and custom extensions. -message ReusableConfigValues { - // Describes values that are relevant in a CA certificate. - message CaOptions { - // Optional. Refers to the "CA" X.509 extension, which is a boolean value. When this - // value is missing, the extension will be omitted from the CA certificate. - google.protobuf.BoolValue is_ca = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Refers to the path length restriction X.509 extension. For a CA - // certificate, this value describes the depth of subordinate CA - // certificates that are allowed. - // If this value is less than 0, the request will fail. - // If this value is missing, the max path length will be omitted from the - // CA certificate. - google.protobuf.Int32Value max_issuer_path_length = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. Indicates the intended use for keys that correspond to a certificate. - KeyUsage key_usage = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes options in this [ReusableConfigValues][google.cloud.security.privateca.v1beta1.ReusableConfigValues] that are - // relevant in a CA certificate. - CaOptions ca_options = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes the X.509 certificate policy object identifiers, per - // https://tools.ietf.org/html/rfc5280#section-4.2.1.4. - repeated ObjectId policy_ids = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes Online Certificate Status Protocol (OCSP) endpoint addresses - // that appear in the "Authority Information Access" extension in the - // certificate. - repeated string aia_ocsp_servers = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Describes custom X.509 extensions. - repeated X509Extension additional_extensions = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// A [ReusableConfigWrapper][google.cloud.security.privateca.v1beta1.ReusableConfigWrapper] describes values that may assist in creating an -// X.509 certificate, or a reference to a pre-defined set of values. -message ReusableConfigWrapper { - // Reusable or inline config values. - oneof config_values { - // Required. A resource path to a [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig] in the format - // `projects/*/locations/*/reusableConfigs/*`. - string reusable_config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A user-specified inline [ReusableConfigValues][google.cloud.security.privateca.v1beta1.ReusableConfigValues]. - ReusableConfigValues reusable_config_values = 2 [(google.api.field_behavior) = REQUIRED]; - } -} - -// Describes a subordinate CA's issuers. This is either a resource path to a -// known issuing [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], or a PEM issuer certificate chain. -message SubordinateConfig { - // This message describes a subordinate CA's issuer certificate chain. This - // wrapper exists for compatibility reasons. - message SubordinateConfigChain { - // Required. Expected to be in leaf-to-root order according to RFC 5246. - repeated string pem_certificates = 1 [(google.api.field_behavior) = REQUIRED]; - } - - oneof subordinate_config { - // Required. This can refer to a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the same project that - // was used to create a subordinate [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. This field - // is used for information and usability purposes only. The resource name - // is in the format `projects/*/locations/*/certificateAuthorities/*`. - string certificate_authority = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Contains the PEM certificate chain for the issuers of this - // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], but not pem certificate for this CA itself. - SubordinateConfigChain pem_issuer_chain = 2 [(google.api.field_behavior) = REQUIRED]; - } -} - -// A [PublicKey][google.cloud.security.privateca.v1beta1.PublicKey] describes a public key. -message PublicKey { - // Types of public keys that are supported. - // At a minimum, we support RSA and ECDSA, for the key sizes or curves listed: - // https://cloud.google.com/kms/docs/algorithms#asymmetric_signing_algorithms - enum KeyType { - // Default unspecified value. - KEY_TYPE_UNSPECIFIED = 0; - - // A PEM-encoded PKCS#1/RFC 3447 RSAPrivateKey structure. - PEM_RSA_KEY = 1; - - // A PEM-encoded compressed NIST P-256/secp256r1/prime256v1 or P-384 key. - PEM_EC_KEY = 2; - } - - // Required. The type of public key. - KeyType type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A public key. Padding and encoding varies by 'KeyType' and is described - // along with the KeyType values. - bytes key = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// A [CertificateConfig][google.cloud.security.privateca.v1beta1.CertificateConfig] describes an X.509 certificate or CSR that is to be -// created, as an alternative to using ASN.1. -message CertificateConfig { - // These values are used to create the distinguished name and subject - // alternative name fields in an X.509 certificate. - message SubjectConfig { - // Required. Contains distinguished name fields such as the location and organization. - Subject subject = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The "common name" of the distinguished name. - string common_name = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The subject alternative name fields. - SubjectAltNames subject_alt_name = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. Specifies some of the values in a certificate that are related to the - // subject. - SubjectConfig subject_config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Describes how some of the technical fields in a certificate should be - // populated. - ReusableConfigWrapper reusable_config = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The public key that corresponds to this config. This is, for example, used - // when issuing [Certificates][google.cloud.security.privateca.v1beta1.Certificate], but not when creating a - // self-signed [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] or [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] CSR. - PublicKey public_key = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// A [CertificateDescription][google.cloud.security.privateca.v1beta1.CertificateDescription] describes an X.509 certificate or CSR that has -// been issued, as an alternative to using ASN.1 / X.509. -message CertificateDescription { - // These values describe fields in an issued X.509 certificate such as the - // distinguished name, subject alternative names, serial number, and lifetime. - message SubjectDescription { - // Contains distinguished name fields such as the location and organization. - Subject subject = 1; - - // The "common name" of the distinguished name. - string common_name = 2; - - // The subject alternative name fields. - SubjectAltNames subject_alt_name = 3; - - // The serial number encoded in lowercase hexadecimal. - string hex_serial_number = 4; - - // For convenience, the actual lifetime of an issued certificate. - // Corresponds to 'not_after_time' - 'not_before_time'. - google.protobuf.Duration lifetime = 5; - - // The time at which the certificate becomes valid. - google.protobuf.Timestamp not_before_time = 6; - - // The time at which the certificate expires. - google.protobuf.Timestamp not_after_time = 7; - } - - // A KeyId identifies a specific public key, usually by hashing the public - // key. - message KeyId { - // Optional. The value of this KeyId encoded in lowercase hexadecimal. This is most - // likely the 160 bit SHA-1 hash of the public key. - string key_id = 1 [(google.api.field_behavior) = OPTIONAL]; - } - - // A group of fingerprints for the x509 certificate. - message CertificateFingerprint { - // The SHA 256 hash, encoded in hexadecimal, of the DER x509 certificate. - string sha256_hash = 1; - } - - // Describes some of the values in a certificate that are related to the - // subject and lifetime. - SubjectDescription subject_description = 1; - - // Describes some of the technical fields in a certificate. - ReusableConfigValues config_values = 2; - - // The public key that corresponds to an issued certificate. - PublicKey public_key = 3; - - // Provides a means of identifiying certificates that contain a particular - // public key, per https://tools.ietf.org/html/rfc5280#section-4.2.1.2. - KeyId subject_key_id = 4; - - // Identifies the subject_key_id of the parent certificate, per - // https://tools.ietf.org/html/rfc5280#section-4.2.1.1 - KeyId authority_key_id = 5; - - // Describes a list of locations to obtain CRL information, i.e. - // the DistributionPoint.fullName described by - // https://tools.ietf.org/html/rfc5280#section-4.2.1.13 - repeated string crl_distribution_points = 6; - - // Describes lists of issuer CA certificate URLs that appear in the - // "Authority Information Access" extension in the certificate. - repeated string aia_issuing_certificate_urls = 7; - - // The hash of the x.509 certificate. - CertificateFingerprint cert_fingerprint = 8; -} - -// An [ObjectId][google.cloud.security.privateca.v1beta1.ObjectId] specifies an object identifier (OID). These provide context -// and describe types in ASN.1 messages. -message ObjectId { - // Required. The parts of an OID path. The most significant parts of the path come - // first. - repeated int32 object_id_path = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// An [X509Extension][google.cloud.security.privateca.v1beta1.X509Extension] specifies an X.509 extension, which may be used in -// different parts of X.509 objects like certificates, CSRs, and CRLs. -message X509Extension { - // Required. The OID for this X.509 extension. - ObjectId object_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Indicates whether or not this extension is critical (i.e., if the client - // does not know how to handle this extension, the client should consider this - // to be an error). - bool critical = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The value of this X.509 extension. - bytes value = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// A [KeyUsage][google.cloud.security.privateca.v1beta1.KeyUsage] describes key usage values that may appear in an X.509 -// certificate. -message KeyUsage { - // [KeyUsage.KeyUsageOptions][google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions] corresponds to the key usage values - // described in https://tools.ietf.org/html/rfc5280#section-4.2.1.3. - message KeyUsageOptions { - // The key may be used for digital signatures. - bool digital_signature = 1; - - // The key may be used for cryptographic commitments. Note that this may - // also be referred to as "non-repudiation". - bool content_commitment = 2; - - // The key may be used to encipher other keys. - bool key_encipherment = 3; - - // The key may be used to encipher data. - bool data_encipherment = 4; - - // The key may be used in a key agreement protocol. - bool key_agreement = 5; - - // The key may be used to sign certificates. - bool cert_sign = 6; - - // The key may be used sign certificate revocation lists. - bool crl_sign = 7; - - // The key may be used to encipher only. - bool encipher_only = 8; - - // The key may be used to decipher only. - bool decipher_only = 9; - } - - // [KeyUsage.ExtendedKeyUsageOptions][google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions] has fields that correspond to - // certain common OIDs that could be specified as an extended key usage value. - message ExtendedKeyUsageOptions { - // Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW - // server authentication", though regularly used for non-WWW TLS. - bool server_auth = 1; - - // Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW - // client authentication", though regularly used for non-WWW TLS. - bool client_auth = 2; - - // Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of - // downloadable executable code client authentication". - bool code_signing = 3; - - // Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email - // protection". - bool email_protection = 4; - - // Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding - // the hash of an object to a time". - bool time_stamping = 5; - - // Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing - // OCSP responses". - bool ocsp_signing = 6; - } - - // Describes high-level ways in which a key may be used. - KeyUsageOptions base_key_usage = 1; - - // Detailed scenarios in which a key may be used. - ExtendedKeyUsageOptions extended_key_usage = 2; - - // Used to describe extended key usages that are not listed in the - // [KeyUsage.ExtendedKeyUsageOptions][google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions] message. - repeated ObjectId unknown_extended_key_usages = 3; -} - -// [Subject][google.cloud.security.privateca.v1beta1.Subject] describes parts of a distinguished name that, in turn, -// describes the subject of the certificate. -message Subject { - // The country code of the subject. - string country_code = 1; - - // The organization of the subject. - string organization = 2; - - // The organizational_unit of the subject. - string organizational_unit = 3; - - // The locality or city of the subject. - string locality = 4; - - // The province, territory, or regional state of the subject. - string province = 5; - - // The street address of the subject. - string street_address = 6; - - // The postal code of the subject. - string postal_code = 7; -} - -// [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames] corresponds to a more modern way of listing what -// the asserted identity is in a certificate (i.e., compared to the "common -// name" in the distinguished name). -message SubjectAltNames { - // Contains only valid, fully-qualified host names. - repeated string dns_names = 1; - - // Contains only valid RFC 3986 URIs. - repeated string uris = 2; - - // Contains only valid RFC 2822 E-mail addresses. - repeated string email_addresses = 3; - - // Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses. - repeated string ip_addresses = 4; - - // Contains additional subject alternative name values. - repeated X509Extension custom_sans = 5; -} - -// A [RevocationReason][google.cloud.security.privateca.v1beta1.RevocationReason] indicates whether a [Certificate][google.cloud.security.privateca.v1beta1.Certificate] has been revoked, -// and the reason for revocation. These correspond to standard revocation -// reasons from RFC 5280. Note that the enum labels and values in this -// definition are not the same ASN.1 values defined in RFC 5280. These values -// will be translated to the correct ASN.1 values when a CRL is created. -enum RevocationReason { - // Default unspecified value. This value does indicate that a [Certificate][google.cloud.security.privateca.v1beta1.Certificate] - // has been revoked, but that a reason has not been recorded. - REVOCATION_REASON_UNSPECIFIED = 0; - - // Key material for this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] may have leaked. - KEY_COMPROMISE = 1; - - // The key material for a certificate authority in the issuing path may have - // leaked. - CERTIFICATE_AUTHORITY_COMPROMISE = 2; - - // The subject or other attributes in this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] have changed. - AFFILIATION_CHANGED = 3; - - // This [Certificate][google.cloud.security.privateca.v1beta1.Certificate] has been superseded. - SUPERSEDED = 4; - - // This [Certificate][google.cloud.security.privateca.v1beta1.Certificate] or entities in the issuing path have ceased to - // operate. - CESSATION_OF_OPERATION = 5; - - // This [Certificate][google.cloud.security.privateca.v1beta1.Certificate] should not be considered valid, it is expected that it - // may become valid in the future. - CERTIFICATE_HOLD = 6; - - // This [Certificate][google.cloud.security.privateca.v1beta1.Certificate] no longer has permission to assert the listed - // attributes. - PRIVILEGE_WITHDRAWN = 7; - - // The authority which determines appropriate attributes for a [Certificate][google.cloud.security.privateca.v1beta1.Certificate] - // may have been compromised. - ATTRIBUTE_AUTHORITY_COMPROMISE = 8; -} diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/service.proto b/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/service.proto deleted file mode 100644 index b37883da1ff1..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1beta1/service.proto +++ /dev/null @@ -1,870 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.security.privateca.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/security/privateca/v1beta1/resources.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.Security.PrivateCA.V1Beta1"; -option go_package = "cloud.google.com/go/security/privateca/apiv1beta1/privatecapb;privatecapb"; -option java_multiple_files = true; -option java_outer_classname = "PrivateCaProto"; -option java_package = "com.google.cloud.security.privateca.v1beta1"; -option php_namespace = "Google\\Cloud\\Security\\PrivateCA\\V1beta1"; -option ruby_package = "Google::Cloud::Security::PrivateCA::V1beta1"; - -// [Certificate Authority Service][google.cloud.security.privateca.v1beta1.CertificateAuthorityService] manages private -// certificate authorities and issued certificates. -service CertificateAuthorityService { - option (google.api.default_host) = "privateca.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Create a new [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in a given Project, Location from a particular - // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc CreateCertificate(CreateCertificateRequest) returns (Certificate) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates" - body: "certificate" - }; - option (google.api.method_signature) = "parent,certificate,certificate_id"; - } - - // Returns a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. - rpc GetCertificate(GetCertificateRequest) returns (Certificate) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. - rpc ListCertificates(ListCertificatesRequest) returns (ListCertificatesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates" - }; - option (google.api.method_signature) = "parent"; - } - - // Revoke a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. - rpc RevokeCertificate(RevokeCertificateRequest) returns (Certificate) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}:revoke" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Update a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. Currently, the only field you can update is the - // [labels][google.cloud.security.privateca.v1beta1.Certificate.labels] field. - rpc UpdateCertificate(UpdateCertificateRequest) returns (Certificate) { - option (google.api.http) = { - patch: "/v1beta1/{certificate.name=projects/*/locations/*/certificateAuthorities/*/certificates/*}" - body: "certificate" - }; - option (google.api.method_signature) = "certificate,update_mask"; - } - - // Activate a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is in state - // [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is - // of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. After the - // parent Certificate Authority signs a certificate signing request from - // [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr], this method can complete the activation - // process. - rpc ActivateCertificateAuthority(ActivateCertificateAuthorityRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:activate" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Create a new [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in a given Project and Location. - rpc CreateCertificateAuthority(CreateCertificateAuthorityRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities" - body: "certificate_authority" - }; - option (google.api.method_signature) = "parent,certificate_authority,certificate_authority_id"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Disable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc DisableCertificateAuthority(DisableCertificateAuthorityRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:disable" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Enable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc EnableCertificateAuthority(EnableCertificateAuthorityRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:enable" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Fetch a certificate signing request (CSR) from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] - // that is in state - // [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is - // of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. The CSR must - // then be signed by the desired parent Certificate Authority, which could be - // another [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] resource, or could be an on-prem - // certificate authority. See also [ActivateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority]. - rpc FetchCertificateAuthorityCsr(FetchCertificateAuthorityCsrRequest) returns (FetchCertificateAuthorityCsrResponse) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:fetch" - }; - option (google.api.method_signature) = "name"; - } - - // Returns a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc GetCertificateAuthority(GetCertificateAuthorityRequest) returns (CertificateAuthority) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc ListCertificateAuthorities(ListCertificateAuthoritiesRequest) returns (ListCertificateAuthoritiesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities" - }; - option (google.api.method_signature) = "parent"; - } - - // Restore a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is scheduled for deletion. - rpc RestoreCertificateAuthority(RestoreCertificateAuthorityRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:restore" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Schedule a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] for deletion. - rpc ScheduleDeleteCertificateAuthority(ScheduleDeleteCertificateAuthorityRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:scheduleDelete" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Update a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc UpdateCertificateAuthority(UpdateCertificateAuthorityRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta1/{certificate_authority.name=projects/*/locations/*/certificateAuthorities/*}" - body: "certificate_authority" - }; - option (google.api.method_signature) = "certificate_authority,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "CertificateAuthority" - metadata_type: "OperationMetadata" - }; - } - - // Returns a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. - rpc GetCertificateRevocationList(GetCertificateRevocationListRequest) returns (CertificateRevocationList) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. - rpc ListCertificateRevocationLists(ListCertificateRevocationListsRequest) returns (ListCertificateRevocationListsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificateRevocationLists" - }; - option (google.api.method_signature) = "parent"; - } - - // Update a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. - rpc UpdateCertificateRevocationList(UpdateCertificateRevocationListRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta1/{certificate_revocation_list.name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}" - body: "certificate_revocation_list" - }; - option (google.api.method_signature) = "certificate_revocation_list,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "CertificateRevocationList" - metadata_type: "OperationMetadata" - }; - } - - // Returns a [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig]. - rpc GetReusableConfig(GetReusableConfigRequest) returns (ReusableConfig) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/reusableConfigs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig]. - rpc ListReusableConfigs(ListReusableConfigsRequest) returns (ListReusableConfigsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/reusableConfigs" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for [CertificateAuthorityService.CreateCertificate][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificate]. -message CreateCertificateRequest { - // Required. The resource name of the location and [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] - // associated with the [Certificate][google.cloud.security.privateca.v1beta1.Certificate], in the format - // `projects/*/locations/*/certificateAuthorities/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. It must be unique within a location and match the regular - // expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - // [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the Enterprise [CertificateAuthority.Tier][google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier], - // but is optional and its value is ignored otherwise. - string certificate_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. A [Certificate][google.cloud.security.privateca.v1beta1.Certificate] with initial field values. - Certificate certificate = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that if you must - // retry your request, the server will know to ignore the request if it has - // already been completed. The server will guarantee that for at least 60 - // minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.GetCertificate][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificate]. -message GetCertificateRequest { - // Required. The [name][google.cloud.security.privateca.v1beta1.Certificate.name] of the [Certificate][google.cloud.security.privateca.v1beta1.Certificate] to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/Certificate" - } - ]; -} - -// Request message for [CertificateAuthorityService.ListCertificates][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificates]. -message ListCertificatesRequest { - // Required. The resource name of the location associated with the - // [Certificates][google.cloud.security.privateca.v1beta1.Certificate], in the format - // `projects/*/locations/*/certificateauthorities/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. Limit on the number of - // [Certificates][google.cloud.security.privateca.v1beta1.Certificate] to include in the - // response. Further [Certificates][google.cloud.security.privateca.v1beta1.Certificate] can subsequently be obtained - // by including the - // [ListCertificatesResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token] in a subsequent - // request. If unspecified, the server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Pagination token, returned earlier via - // [ListCertificatesResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token]. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only include resources that match the filter in the response. For details - // on supported filters and syntax, see [Certificates Filtering - // documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specify how the results should be sorted. For details on supported fields - // and syntax, see [Certificates Sorting - // documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [CertificateAuthorityService.ListCertificates][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificates]. -message ListCertificatesResponse { - // The list of [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. - repeated Certificate certificates = 1; - - // A token to retrieve next page of results. Pass this value in - // [ListCertificatesRequest.next_page_token][] to retrieve the - // next page of results. - string next_page_token = 2; - - // A list of locations (e.g. "us-west1") that could not be reached. - repeated string unreachable = 3; -} - -// Request message for -// [CertificateAuthorityService.RevokeCertificate][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificate]. -message RevokeCertificateRequest { - // Required. The resource name for this [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in the - // format `projects/*/locations/*/certificateAuthorities/*/certificates/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/Certificate" - } - ]; - - // Required. The [RevocationReason][google.cloud.security.privateca.v1beta1.RevocationReason] for revoking this certificate. - RevocationReason reason = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that if you must - // retry your request, the server will know to ignore the request if it has - // already been completed. The server will guarantee that for at least 60 - // minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for [CertificateAuthorityService.UpdateCertificate][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificate]. -message UpdateCertificateRequest { - // Required. [Certificate][google.cloud.security.privateca.v1beta1.Certificate] with updated values. - Certificate certificate = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of fields to be updated in this request. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that if you must - // retry your request, the server will know to ignore the request if it has - // already been completed. The server will guarantee that for at least 60 - // minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.ActivateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority]. -message ActivateCertificateAuthorityRequest { - // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the - // format `projects/*/locations/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Required. The signed CA certificate issued from - // [FetchCertificateAuthorityCsrResponse.pem_csr][google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.pem_csr]. - string pem_ca_certificate = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Must include information about the issuer of 'pem_ca_certificate', and any - // further issuers until the self-signed CA. - SubordinateConfig subordinate_config = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that if you must - // retry your request, the server will know to ignore the request if it has - // already been completed. The server will guarantee that for at least 60 - // minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.CreateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthority]. -message CreateCertificateAuthorityRequest { - // Required. The resource name of the location associated with the - // [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority], in the format - // `projects/*/locations/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. It must be unique within a location and match the regular - // expression `[a-zA-Z0-9_-]{1,63}` - string certificate_authority_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. A [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] with initial field values. - CertificateAuthority certificate_authority = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that if you must - // retry your request, the server will know to ignore the request if it has - // already been completed. The server will guarantee that for at least 60 - // minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.DisableCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthority]. -message DisableCertificateAuthorityRequest { - // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the - // format `projects/*/locations/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. An ID to identify requests. Specify a unique request ID so that if you must - // retry your request, the server will know to ignore the request if it has - // already been completed. The server will guarantee that for at least 60 - // minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.EnableCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthority]. -message EnableCertificateAuthorityRequest { - // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the - // format `projects/*/locations/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. An ID to identify requests. Specify a unique request ID so that if you must - // retry your request, the server will know to ignore the request if it has - // already been completed. The server will guarantee that for at least 60 - // minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr]. -message FetchCertificateAuthorityCsrRequest { - // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the - // format `projects/*/locations/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; -} - -// Response message for -// [CertificateAuthorityService.FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr]. -message FetchCertificateAuthorityCsrResponse { - // Output only. The PEM-encoded signed certificate signing request (CSR). - string pem_csr = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for [CertificateAuthorityService.GetCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthority]. -message GetCertificateAuthorityRequest { - // Required. The [name][google.cloud.security.privateca.v1beta1.CertificateAuthority.name] of the [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] to - // get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; -} - -// Request message for -// [CertificateAuthorityService.ListCertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthorities]. -message ListCertificateAuthoritiesRequest { - // Required. The resource name of the location associated with the - // [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority], in the format - // `projects/*/locations/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. Limit on the number of [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority] to - // include in the response. - // Further [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority] can subsequently be - // obtained by including the - // [ListCertificateAuthoritiesResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token] in a subsequent - // request. If unspecified, the server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Pagination token, returned earlier via - // [ListCertificateAuthoritiesResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token]. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only include resources that match the filter in the response. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specify how the results should be sorted. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [CertificateAuthorityService.ListCertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthorities]. -message ListCertificateAuthoritiesResponse { - // The list of [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - repeated CertificateAuthority certificate_authorities = 1; - - // A token to retrieve next page of results. Pass this value in - // [ListCertificateAuthoritiesRequest.next_page_token][] to retrieve the next - // page of results. - string next_page_token = 2; - - // A list of locations (e.g. "us-west1") that could not be reached. - repeated string unreachable = 3; -} - -// Request message for -// [CertificateAuthorityService.RestoreCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthority]. -message RestoreCertificateAuthorityRequest { - // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the - // format `projects/*/locations/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. An ID to identify requests. Specify a unique request ID so that if you must - // retry your request, the server will know to ignore the request if it has - // already been completed. The server will guarantee that for at least 60 - // minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.ScheduleDeleteCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthority]. -message ScheduleDeleteCertificateAuthorityRequest { - // Required. The resource name for this [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in the - // format `projects/*/locations/*/certificateAuthorities/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. An ID to identify requests. Specify a unique request ID so that if you must - // retry your request, the server will know to ignore the request if it has - // already been completed. The server will guarantee that for at least 60 - // minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.UpdateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthority]. -message UpdateCertificateAuthorityRequest { - // Required. [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] with updated values. - CertificateAuthority certificate_authority = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of fields to be updated in this request. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that if you must - // retry your request, the server will know to ignore the request if it has - // already been completed. The server will guarantee that for at least 60 - // minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.GetCertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationList]. -message GetCertificateRevocationListRequest { - // Required. The [name][google.cloud.security.privateca.v1beta1.CertificateRevocationList.name] of the - // [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateRevocationList" - } - ]; -} - -// Request message for -// [CertificateAuthorityService.ListCertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationLists]. -message ListCertificateRevocationListsRequest { - // Required. The resource name of the location associated with the - // [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList], in the format - // `projects/*/locations/*/certificateauthorities/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/CertificateAuthority" - } - ]; - - // Optional. Limit on the number of - // [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList] to include in the - // response. Further [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList] - // can subsequently be obtained by including the - // [ListCertificateRevocationListsResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token] in a subsequent - // request. If unspecified, the server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Pagination token, returned earlier via - // [ListCertificateRevocationListsResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token]. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only include resources that match the filter in the response. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specify how the results should be sorted. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [CertificateAuthorityService.ListCertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationLists]. -message ListCertificateRevocationListsResponse { - // The list of [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. - repeated CertificateRevocationList certificate_revocation_lists = 1; - - // A token to retrieve next page of results. Pass this value in - // [ListCertificateRevocationListsRequest.next_page_token][] to retrieve the - // next page of results. - string next_page_token = 2; - - // A list of locations (e.g. "us-west1") that could not be reached. - repeated string unreachable = 3; -} - -// Request message for -// [CertificateAuthorityService.UpdateCertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationList]. -message UpdateCertificateRevocationListRequest { - // Required. [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList] with updated values. - CertificateRevocationList certificate_revocation_list = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of fields to be updated in this request. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An ID to identify requests. Specify a unique request ID so that if you must - // retry your request, the server will know to ignore the request if it has - // already been completed. The server will guarantee that for at least 60 - // minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [CertificateAuthorityService.GetReusableConfig][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfig]. -message GetReusableConfigRequest { - // Required. The [name][ReusableConfigs.name] of the [ReusableConfigs][] to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "privateca.googleapis.com/ReusableConfig" - } - ]; -} - -// Request message for -// [CertificateAuthorityService.ListReusableConfigs][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigs]. -message ListReusableConfigsRequest { - // Required. The resource name of the location associated with the - // [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig], in the format - // `projects/*/locations/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. Limit on the number of - // [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig] to include in the response. - // Further [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig] can subsequently be - // obtained by including the - // [ListReusableConfigsResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token] in a subsequent request. If - // unspecified, the server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Pagination token, returned earlier via - // [ListReusableConfigsResponse.next_page_token][google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token]. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only include resources that match the filter in the response. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specify how the results should be sorted. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [CertificateAuthorityService.ListReusableConfigs][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigs]. -message ListReusableConfigsResponse { - // The list of [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig]. - repeated ReusableConfig reusable_configs = 1; - - // A token to retrieve next page of results. Pass this value in - // [ListReusableConfigsRequest.next_page_token][] to retrieve - // the next page of results. - string next_page_token = 2; - - // A list of locations (e.g. "us-west1") that could not be reached. - repeated string unreachable = 3; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Human-readable status of the operation, if any. - string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/protos.d.ts b/owl-bot-staging/google-cloud-security-privateca/protos/protos.d.ts deleted file mode 100644 index 4798747d8829..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/protos/protos.d.ts +++ /dev/null @@ -1,26491 +0,0 @@ -// Copyright 2026 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. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace security. */ - namespace security { - - /** Namespace privateca. */ - namespace privateca { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a CertificateAuthority. */ - interface ICertificateAuthority { - - /** CertificateAuthority name */ - name?: (string|null); - - /** CertificateAuthority type */ - type?: (google.cloud.security.privateca.v1.CertificateAuthority.Type|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.Type|null); - - /** CertificateAuthority config */ - config?: (google.cloud.security.privateca.v1.ICertificateConfig|null); - - /** CertificateAuthority lifetime */ - lifetime?: (google.protobuf.IDuration|null); - - /** CertificateAuthority keySpec */ - keySpec?: (google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec|null); - - /** CertificateAuthority subordinateConfig */ - subordinateConfig?: (google.cloud.security.privateca.v1.ISubordinateConfig|null); - - /** CertificateAuthority tier */ - tier?: (google.cloud.security.privateca.v1.CaPool.Tier|keyof typeof google.cloud.security.privateca.v1.CaPool.Tier|null); - - /** CertificateAuthority state */ - state?: (google.cloud.security.privateca.v1.CertificateAuthority.State|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.State|null); - - /** CertificateAuthority pemCaCertificates */ - pemCaCertificates?: (string[]|null); - - /** CertificateAuthority caCertificateDescriptions */ - caCertificateDescriptions?: (google.cloud.security.privateca.v1.ICertificateDescription[]|null); - - /** CertificateAuthority gcsBucket */ - gcsBucket?: (string|null); - - /** CertificateAuthority accessUrls */ - accessUrls?: (google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls|null); - - /** CertificateAuthority createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority labels */ - labels?: ({ [k: string]: string }|null); - - /** CertificateAuthority userDefinedAccessUrls */ - userDefinedAccessUrls?: (google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls|null); - - /** CertificateAuthority satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** CertificateAuthority satisfiesPzi */ - satisfiesPzi?: (boolean|null); - } - - /** Represents a CertificateAuthority. */ - class CertificateAuthority implements ICertificateAuthority { - - /** - * Constructs a new CertificateAuthority. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICertificateAuthority); - - /** CertificateAuthority name. */ - public name: string; - - /** CertificateAuthority type. */ - public type: (google.cloud.security.privateca.v1.CertificateAuthority.Type|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.Type); - - /** CertificateAuthority config. */ - public config?: (google.cloud.security.privateca.v1.ICertificateConfig|null); - - /** CertificateAuthority lifetime. */ - public lifetime?: (google.protobuf.IDuration|null); - - /** CertificateAuthority keySpec. */ - public keySpec?: (google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec|null); - - /** CertificateAuthority subordinateConfig. */ - public subordinateConfig?: (google.cloud.security.privateca.v1.ISubordinateConfig|null); - - /** CertificateAuthority tier. */ - public tier: (google.cloud.security.privateca.v1.CaPool.Tier|keyof typeof google.cloud.security.privateca.v1.CaPool.Tier); - - /** CertificateAuthority state. */ - public state: (google.cloud.security.privateca.v1.CertificateAuthority.State|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.State); - - /** CertificateAuthority pemCaCertificates. */ - public pemCaCertificates: string[]; - - /** CertificateAuthority caCertificateDescriptions. */ - public caCertificateDescriptions: google.cloud.security.privateca.v1.ICertificateDescription[]; - - /** CertificateAuthority gcsBucket. */ - public gcsBucket: string; - - /** CertificateAuthority accessUrls. */ - public accessUrls?: (google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls|null); - - /** CertificateAuthority createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority labels. */ - public labels: { [k: string]: string }; - - /** CertificateAuthority userDefinedAccessUrls. */ - public userDefinedAccessUrls?: (google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls|null); - - /** CertificateAuthority satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** CertificateAuthority satisfiesPzi. */ - public satisfiesPzi: boolean; - - /** - * Creates a new CertificateAuthority instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateAuthority instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICertificateAuthority): google.cloud.security.privateca.v1.CertificateAuthority; - - /** - * Encodes the specified CertificateAuthority message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.verify|verify} messages. - * @param message CertificateAuthority message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICertificateAuthority, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateAuthority message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.verify|verify} messages. - * @param message CertificateAuthority message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateAuthority, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateAuthority message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateAuthority - * @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.security.privateca.v1.CertificateAuthority; - - /** - * Decodes a CertificateAuthority message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateAuthority - * @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.security.privateca.v1.CertificateAuthority; - - /** - * Verifies a CertificateAuthority 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 CertificateAuthority message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateAuthority - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateAuthority; - - /** - * Creates a plain object from a CertificateAuthority message. Also converts values to other types if specified. - * @param message CertificateAuthority - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateAuthority, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateAuthority to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateAuthority - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CertificateAuthority { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - SELF_SIGNED = 1, - SUBORDINATE = 2 - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ENABLED = 1, - DISABLED = 2, - STAGED = 3, - AWAITING_USER_ACTIVATION = 4, - DELETED = 5 - } - - /** Properties of an AccessUrls. */ - interface IAccessUrls { - - /** AccessUrls caCertificateAccessUrl */ - caCertificateAccessUrl?: (string|null); - - /** AccessUrls crlAccessUrls */ - crlAccessUrls?: (string[]|null); - } - - /** Represents an AccessUrls. */ - class AccessUrls implements IAccessUrls { - - /** - * Constructs a new AccessUrls. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls); - - /** AccessUrls caCertificateAccessUrl. */ - public caCertificateAccessUrl: string; - - /** AccessUrls crlAccessUrls. */ - public crlAccessUrls: string[]; - - /** - * Creates a new AccessUrls instance using the specified properties. - * @param [properties] Properties to set - * @returns AccessUrls instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls): google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls; - - /** - * Encodes the specified AccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.verify|verify} messages. - * @param message AccessUrls message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.verify|verify} messages. - * @param message AccessUrls message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AccessUrls message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AccessUrls - * @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.security.privateca.v1.CertificateAuthority.AccessUrls; - - /** - * Decodes an AccessUrls message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AccessUrls - * @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.security.privateca.v1.CertificateAuthority.AccessUrls; - - /** - * Verifies an AccessUrls 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 AccessUrls message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AccessUrls - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls; - - /** - * Creates a plain object from an AccessUrls message. Also converts values to other types if specified. - * @param message AccessUrls - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AccessUrls to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AccessUrls - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyVersionSpec. */ - interface IKeyVersionSpec { - - /** KeyVersionSpec cloudKmsKeyVersion */ - cloudKmsKeyVersion?: (string|null); - - /** KeyVersionSpec algorithm */ - algorithm?: (google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|null); - } - - /** Represents a KeyVersionSpec. */ - class KeyVersionSpec implements IKeyVersionSpec { - - /** - * Constructs a new KeyVersionSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec); - - /** KeyVersionSpec cloudKmsKeyVersion. */ - public cloudKmsKeyVersion?: (string|null); - - /** KeyVersionSpec algorithm. */ - public algorithm?: (google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|keyof typeof google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|null); - - /** KeyVersionSpec KeyVersion. */ - public KeyVersion?: ("cloudKmsKeyVersion"|"algorithm"); - - /** - * Creates a new KeyVersionSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyVersionSpec instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec): google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec; - - /** - * Encodes the specified KeyVersionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. - * @param message KeyVersionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyVersionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. - * @param message KeyVersionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyVersionSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyVersionSpec - * @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.security.privateca.v1.CertificateAuthority.KeyVersionSpec; - - /** - * Decodes a KeyVersionSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyVersionSpec - * @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.security.privateca.v1.CertificateAuthority.KeyVersionSpec; - - /** - * Verifies a KeyVersionSpec 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 KeyVersionSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyVersionSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec; - - /** - * Creates a plain object from a KeyVersionSpec message. Also converts values to other types if specified. - * @param message KeyVersionSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyVersionSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyVersionSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** SignHashAlgorithm enum. */ - enum SignHashAlgorithm { - SIGN_HASH_ALGORITHM_UNSPECIFIED = 0, - RSA_PSS_2048_SHA256 = 1, - RSA_PSS_3072_SHA256 = 2, - RSA_PSS_4096_SHA256 = 3, - RSA_PKCS1_2048_SHA256 = 6, - RSA_PKCS1_3072_SHA256 = 7, - RSA_PKCS1_4096_SHA256 = 8, - EC_P256_SHA256 = 4, - EC_P384_SHA384 = 5 - } - - /** Properties of a UserDefinedAccessUrls. */ - interface IUserDefinedAccessUrls { - - /** UserDefinedAccessUrls aiaIssuingCertificateUrls */ - aiaIssuingCertificateUrls?: (string[]|null); - - /** UserDefinedAccessUrls crlAccessUrls */ - crlAccessUrls?: (string[]|null); - } - - /** Represents a UserDefinedAccessUrls. */ - class UserDefinedAccessUrls implements IUserDefinedAccessUrls { - - /** - * Constructs a new UserDefinedAccessUrls. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls); - - /** UserDefinedAccessUrls aiaIssuingCertificateUrls. */ - public aiaIssuingCertificateUrls: string[]; - - /** UserDefinedAccessUrls crlAccessUrls. */ - public crlAccessUrls: string[]; - - /** - * Creates a new UserDefinedAccessUrls instance using the specified properties. - * @param [properties] Properties to set - * @returns UserDefinedAccessUrls instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls): google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls; - - /** - * Encodes the specified UserDefinedAccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.verify|verify} messages. - * @param message UserDefinedAccessUrls message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UserDefinedAccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.verify|verify} messages. - * @param message UserDefinedAccessUrls message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UserDefinedAccessUrls message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserDefinedAccessUrls - * @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.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls; - - /** - * Decodes a UserDefinedAccessUrls message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserDefinedAccessUrls - * @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.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls; - - /** - * Verifies a UserDefinedAccessUrls 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 UserDefinedAccessUrls message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserDefinedAccessUrls - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls; - - /** - * Creates a plain object from a UserDefinedAccessUrls message. Also converts values to other types if specified. - * @param message UserDefinedAccessUrls - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UserDefinedAccessUrls to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UserDefinedAccessUrls - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a CaPool. */ - interface ICaPool { - - /** CaPool name */ - name?: (string|null); - - /** CaPool tier */ - tier?: (google.cloud.security.privateca.v1.CaPool.Tier|keyof typeof google.cloud.security.privateca.v1.CaPool.Tier|null); - - /** CaPool issuancePolicy */ - issuancePolicy?: (google.cloud.security.privateca.v1.CaPool.IIssuancePolicy|null); - - /** CaPool publishingOptions */ - publishingOptions?: (google.cloud.security.privateca.v1.CaPool.IPublishingOptions|null); - - /** CaPool encryptionSpec */ - encryptionSpec?: (google.cloud.security.privateca.v1.IEncryptionSpec|null); - - /** CaPool labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a CaPool. */ - class CaPool implements ICaPool { - - /** - * Constructs a new CaPool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICaPool); - - /** CaPool name. */ - public name: string; - - /** CaPool tier. */ - public tier: (google.cloud.security.privateca.v1.CaPool.Tier|keyof typeof google.cloud.security.privateca.v1.CaPool.Tier); - - /** CaPool issuancePolicy. */ - public issuancePolicy?: (google.cloud.security.privateca.v1.CaPool.IIssuancePolicy|null); - - /** CaPool publishingOptions. */ - public publishingOptions?: (google.cloud.security.privateca.v1.CaPool.IPublishingOptions|null); - - /** CaPool encryptionSpec. */ - public encryptionSpec?: (google.cloud.security.privateca.v1.IEncryptionSpec|null); - - /** CaPool labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new CaPool instance using the specified properties. - * @param [properties] Properties to set - * @returns CaPool instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICaPool): google.cloud.security.privateca.v1.CaPool; - - /** - * Encodes the specified CaPool message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.verify|verify} messages. - * @param message CaPool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICaPool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CaPool message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.verify|verify} messages. - * @param message CaPool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICaPool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CaPool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CaPool - * @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.security.privateca.v1.CaPool; - - /** - * Decodes a CaPool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CaPool - * @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.security.privateca.v1.CaPool; - - /** - * Verifies a CaPool 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 CaPool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CaPool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool; - - /** - * Creates a plain object from a CaPool message. Also converts values to other types if specified. - * @param message CaPool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CaPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CaPool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CaPool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CaPool { - - /** Tier enum. */ - enum Tier { - TIER_UNSPECIFIED = 0, - ENTERPRISE = 1, - DEVOPS = 2 - } - - /** Properties of a PublishingOptions. */ - interface IPublishingOptions { - - /** PublishingOptions publishCaCert */ - publishCaCert?: (boolean|null); - - /** PublishingOptions publishCrl */ - publishCrl?: (boolean|null); - - /** PublishingOptions encodingFormat */ - encodingFormat?: (google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat|keyof typeof google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat|null); - } - - /** Represents a PublishingOptions. */ - class PublishingOptions implements IPublishingOptions { - - /** - * Constructs a new PublishingOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CaPool.IPublishingOptions); - - /** PublishingOptions publishCaCert. */ - public publishCaCert: boolean; - - /** PublishingOptions publishCrl. */ - public publishCrl: boolean; - - /** PublishingOptions encodingFormat. */ - public encodingFormat: (google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat|keyof typeof google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat); - - /** - * Creates a new PublishingOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns PublishingOptions instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CaPool.IPublishingOptions): google.cloud.security.privateca.v1.CaPool.PublishingOptions; - - /** - * Encodes the specified PublishingOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.PublishingOptions.verify|verify} messages. - * @param message PublishingOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CaPool.IPublishingOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PublishingOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.PublishingOptions.verify|verify} messages. - * @param message PublishingOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IPublishingOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PublishingOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PublishingOptions - * @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.security.privateca.v1.CaPool.PublishingOptions; - - /** - * Decodes a PublishingOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PublishingOptions - * @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.security.privateca.v1.CaPool.PublishingOptions; - - /** - * Verifies a PublishingOptions 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 PublishingOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PublishingOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.PublishingOptions; - - /** - * Creates a plain object from a PublishingOptions message. Also converts values to other types if specified. - * @param message PublishingOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CaPool.PublishingOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PublishingOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PublishingOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PublishingOptions { - - /** EncodingFormat enum. */ - enum EncodingFormat { - ENCODING_FORMAT_UNSPECIFIED = 0, - PEM = 1, - DER = 2 - } - } - - /** Properties of an IssuancePolicy. */ - interface IIssuancePolicy { - - /** IssuancePolicy allowedKeyTypes */ - allowedKeyTypes?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType[]|null); - - /** IssuancePolicy backdateDuration */ - backdateDuration?: (google.protobuf.IDuration|null); - - /** IssuancePolicy allowRequesterSpecifiedNotBeforeTime */ - allowRequesterSpecifiedNotBeforeTime?: (boolean|null); - - /** IssuancePolicy maximumLifetime */ - maximumLifetime?: (google.protobuf.IDuration|null); - - /** IssuancePolicy allowedIssuanceModes */ - allowedIssuanceModes?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes|null); - - /** IssuancePolicy baselineValues */ - baselineValues?: (google.cloud.security.privateca.v1.IX509Parameters|null); - - /** IssuancePolicy identityConstraints */ - identityConstraints?: (google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null); - - /** IssuancePolicy passthroughExtensions */ - passthroughExtensions?: (google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null); - } - - /** Represents an IssuancePolicy. */ - class IssuancePolicy implements IIssuancePolicy { - - /** - * Constructs a new IssuancePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CaPool.IIssuancePolicy); - - /** IssuancePolicy allowedKeyTypes. */ - public allowedKeyTypes: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType[]; - - /** IssuancePolicy backdateDuration. */ - public backdateDuration?: (google.protobuf.IDuration|null); - - /** IssuancePolicy allowRequesterSpecifiedNotBeforeTime. */ - public allowRequesterSpecifiedNotBeforeTime: boolean; - - /** IssuancePolicy maximumLifetime. */ - public maximumLifetime?: (google.protobuf.IDuration|null); - - /** IssuancePolicy allowedIssuanceModes. */ - public allowedIssuanceModes?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes|null); - - /** IssuancePolicy baselineValues. */ - public baselineValues?: (google.cloud.security.privateca.v1.IX509Parameters|null); - - /** IssuancePolicy identityConstraints. */ - public identityConstraints?: (google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null); - - /** IssuancePolicy passthroughExtensions. */ - public passthroughExtensions?: (google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null); - - /** - * Creates a new IssuancePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns IssuancePolicy instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CaPool.IIssuancePolicy): google.cloud.security.privateca.v1.CaPool.IssuancePolicy; - - /** - * Encodes the specified IssuancePolicy message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.verify|verify} messages. - * @param message IssuancePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CaPool.IIssuancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IssuancePolicy message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.verify|verify} messages. - * @param message IssuancePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IIssuancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IssuancePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IssuancePolicy - * @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.security.privateca.v1.CaPool.IssuancePolicy; - - /** - * Decodes an IssuancePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IssuancePolicy - * @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.security.privateca.v1.CaPool.IssuancePolicy; - - /** - * Verifies an IssuancePolicy 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 IssuancePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IssuancePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.IssuancePolicy; - - /** - * Creates a plain object from an IssuancePolicy message. Also converts values to other types if specified. - * @param message IssuancePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IssuancePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IssuancePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace IssuancePolicy { - - /** Properties of an AllowedKeyType. */ - interface IAllowedKeyType { - - /** AllowedKeyType rsa */ - rsa?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType|null); - - /** AllowedKeyType ellipticCurve */ - ellipticCurve?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType|null); - } - - /** Represents an AllowedKeyType. */ - class AllowedKeyType implements IAllowedKeyType { - - /** - * Constructs a new AllowedKeyType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType); - - /** AllowedKeyType rsa. */ - public rsa?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType|null); - - /** AllowedKeyType ellipticCurve. */ - public ellipticCurve?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType|null); - - /** AllowedKeyType keyType. */ - public keyType?: ("rsa"|"ellipticCurve"); - - /** - * Creates a new AllowedKeyType instance using the specified properties. - * @param [properties] Properties to set - * @returns AllowedKeyType instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType; - - /** - * Encodes the specified AllowedKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.verify|verify} messages. - * @param message AllowedKeyType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AllowedKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.verify|verify} messages. - * @param message AllowedKeyType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AllowedKeyType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllowedKeyType - * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType; - - /** - * Decodes an AllowedKeyType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllowedKeyType - * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType; - - /** - * Verifies an AllowedKeyType 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 AllowedKeyType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllowedKeyType - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType; - - /** - * Creates a plain object from an AllowedKeyType message. Also converts values to other types if specified. - * @param message AllowedKeyType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AllowedKeyType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AllowedKeyType - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AllowedKeyType { - - /** Properties of a RsaKeyType. */ - interface IRsaKeyType { - - /** RsaKeyType minModulusSize */ - minModulusSize?: (number|Long|string|null); - - /** RsaKeyType maxModulusSize */ - maxModulusSize?: (number|Long|string|null); - } - - /** Represents a RsaKeyType. */ - class RsaKeyType implements IRsaKeyType { - - /** - * Constructs a new RsaKeyType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType); - - /** RsaKeyType minModulusSize. */ - public minModulusSize: (number|Long|string); - - /** RsaKeyType maxModulusSize. */ - public maxModulusSize: (number|Long|string); - - /** - * Creates a new RsaKeyType instance using the specified properties. - * @param [properties] Properties to set - * @returns RsaKeyType instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType; - - /** - * Encodes the specified RsaKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.verify|verify} messages. - * @param message RsaKeyType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RsaKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.verify|verify} messages. - * @param message RsaKeyType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RsaKeyType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RsaKeyType - * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType; - - /** - * Decodes a RsaKeyType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RsaKeyType - * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType; - - /** - * Verifies a RsaKeyType 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 RsaKeyType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RsaKeyType - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType; - - /** - * Creates a plain object from a RsaKeyType message. Also converts values to other types if specified. - * @param message RsaKeyType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RsaKeyType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RsaKeyType - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EcKeyType. */ - interface IEcKeyType { - - /** EcKeyType signatureAlgorithm */ - signatureAlgorithm?: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm|keyof typeof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm|null); - } - - /** Represents an EcKeyType. */ - class EcKeyType implements IEcKeyType { - - /** - * Constructs a new EcKeyType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType); - - /** EcKeyType signatureAlgorithm. */ - public signatureAlgorithm: (google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm|keyof typeof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm); - - /** - * Creates a new EcKeyType instance using the specified properties. - * @param [properties] Properties to set - * @returns EcKeyType instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType; - - /** - * Encodes the specified EcKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.verify|verify} messages. - * @param message EcKeyType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EcKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.verify|verify} messages. - * @param message EcKeyType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EcKeyType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EcKeyType - * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType; - - /** - * Decodes an EcKeyType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EcKeyType - * @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.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType; - - /** - * Verifies an EcKeyType 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 EcKeyType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EcKeyType - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType; - - /** - * Creates a plain object from an EcKeyType message. Also converts values to other types if specified. - * @param message EcKeyType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EcKeyType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EcKeyType - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EcKeyType { - - /** EcSignatureAlgorithm enum. */ - enum EcSignatureAlgorithm { - EC_SIGNATURE_ALGORITHM_UNSPECIFIED = 0, - ECDSA_P256 = 1, - ECDSA_P384 = 2, - EDDSA_25519 = 3 - } - } - } - - /** Properties of an IssuanceModes. */ - interface IIssuanceModes { - - /** IssuanceModes allowCsrBasedIssuance */ - allowCsrBasedIssuance?: (boolean|null); - - /** IssuanceModes allowConfigBasedIssuance */ - allowConfigBasedIssuance?: (boolean|null); - } - - /** Represents an IssuanceModes. */ - class IssuanceModes implements IIssuanceModes { - - /** - * Constructs a new IssuanceModes. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes); - - /** IssuanceModes allowCsrBasedIssuance. */ - public allowCsrBasedIssuance: boolean; - - /** IssuanceModes allowConfigBasedIssuance. */ - public allowConfigBasedIssuance: boolean; - - /** - * Creates a new IssuanceModes instance using the specified properties. - * @param [properties] Properties to set - * @returns IssuanceModes instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes; - - /** - * Encodes the specified IssuanceModes message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.verify|verify} messages. - * @param message IssuanceModes message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IssuanceModes message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.verify|verify} messages. - * @param message IssuanceModes message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IssuanceModes message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IssuanceModes - * @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.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes; - - /** - * Decodes an IssuanceModes message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IssuanceModes - * @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.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes; - - /** - * Verifies an IssuanceModes 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 IssuanceModes message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IssuanceModes - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes; - - /** - * Creates a plain object from an IssuanceModes message. Also converts values to other types if specified. - * @param message IssuanceModes - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IssuanceModes to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IssuanceModes - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of an EncryptionSpec. */ - interface IEncryptionSpec { - - /** EncryptionSpec cloudKmsKey */ - cloudKmsKey?: (string|null); - } - - /** Represents an EncryptionSpec. */ - class EncryptionSpec implements IEncryptionSpec { - - /** - * Constructs a new EncryptionSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IEncryptionSpec); - - /** EncryptionSpec cloudKmsKey. */ - public cloudKmsKey: string; - - /** - * Creates a new EncryptionSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionSpec instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IEncryptionSpec): google.cloud.security.privateca.v1.EncryptionSpec; - - /** - * Encodes the specified EncryptionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. - * @param message EncryptionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IEncryptionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. - * @param message EncryptionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IEncryptionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionSpec - * @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.security.privateca.v1.EncryptionSpec; - - /** - * Decodes an EncryptionSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionSpec - * @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.security.privateca.v1.EncryptionSpec; - - /** - * Verifies an EncryptionSpec 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 EncryptionSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.EncryptionSpec; - - /** - * Creates a plain object from an EncryptionSpec message. Also converts values to other types if specified. - * @param message EncryptionSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.EncryptionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CertificateRevocationList. */ - interface ICertificateRevocationList { - - /** CertificateRevocationList name */ - name?: (string|null); - - /** CertificateRevocationList sequenceNumber */ - sequenceNumber?: (number|Long|string|null); - - /** CertificateRevocationList revokedCertificates */ - revokedCertificates?: (google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate[]|null); - - /** CertificateRevocationList pemCrl */ - pemCrl?: (string|null); - - /** CertificateRevocationList accessUrl */ - accessUrl?: (string|null); - - /** CertificateRevocationList state */ - state?: (google.cloud.security.privateca.v1.CertificateRevocationList.State|keyof typeof google.cloud.security.privateca.v1.CertificateRevocationList.State|null); - - /** CertificateRevocationList createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** CertificateRevocationList updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** CertificateRevocationList revisionId */ - revisionId?: (string|null); - - /** CertificateRevocationList labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a CertificateRevocationList. */ - class CertificateRevocationList implements ICertificateRevocationList { - - /** - * Constructs a new CertificateRevocationList. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICertificateRevocationList); - - /** CertificateRevocationList name. */ - public name: string; - - /** CertificateRevocationList sequenceNumber. */ - public sequenceNumber: (number|Long|string); - - /** CertificateRevocationList revokedCertificates. */ - public revokedCertificates: google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate[]; - - /** CertificateRevocationList pemCrl. */ - public pemCrl: string; - - /** CertificateRevocationList accessUrl. */ - public accessUrl: string; - - /** CertificateRevocationList state. */ - public state: (google.cloud.security.privateca.v1.CertificateRevocationList.State|keyof typeof google.cloud.security.privateca.v1.CertificateRevocationList.State); - - /** CertificateRevocationList createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** CertificateRevocationList updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** CertificateRevocationList revisionId. */ - public revisionId: string; - - /** CertificateRevocationList labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new CertificateRevocationList instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateRevocationList instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICertificateRevocationList): google.cloud.security.privateca.v1.CertificateRevocationList; - - /** - * Encodes the specified CertificateRevocationList message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.verify|verify} messages. - * @param message CertificateRevocationList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICertificateRevocationList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateRevocationList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.verify|verify} messages. - * @param message CertificateRevocationList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateRevocationList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateRevocationList message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateRevocationList - * @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.security.privateca.v1.CertificateRevocationList; - - /** - * Decodes a CertificateRevocationList message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateRevocationList - * @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.security.privateca.v1.CertificateRevocationList; - - /** - * Verifies a CertificateRevocationList 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 CertificateRevocationList message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateRevocationList - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateRevocationList; - - /** - * Creates a plain object from a CertificateRevocationList message. Also converts values to other types if specified. - * @param message CertificateRevocationList - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateRevocationList, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateRevocationList to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateRevocationList - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CertificateRevocationList { - - /** Properties of a RevokedCertificate. */ - interface IRevokedCertificate { - - /** RevokedCertificate certificate */ - certificate?: (string|null); - - /** RevokedCertificate hexSerialNumber */ - hexSerialNumber?: (string|null); - - /** RevokedCertificate revocationReason */ - revocationReason?: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason|null); - } - - /** Represents a RevokedCertificate. */ - class RevokedCertificate implements IRevokedCertificate { - - /** - * Constructs a new RevokedCertificate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate); - - /** RevokedCertificate certificate. */ - public certificate: string; - - /** RevokedCertificate hexSerialNumber. */ - public hexSerialNumber: string; - - /** RevokedCertificate revocationReason. */ - public revocationReason: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason); - - /** - * Creates a new RevokedCertificate instance using the specified properties. - * @param [properties] Properties to set - * @returns RevokedCertificate instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate): google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate; - - /** - * Encodes the specified RevokedCertificate message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. - * @param message RevokedCertificate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevokedCertificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. - * @param message RevokedCertificate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevokedCertificate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevokedCertificate - * @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.security.privateca.v1.CertificateRevocationList.RevokedCertificate; - - /** - * Decodes a RevokedCertificate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevokedCertificate - * @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.security.privateca.v1.CertificateRevocationList.RevokedCertificate; - - /** - * Verifies a RevokedCertificate 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 RevokedCertificate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevokedCertificate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate; - - /** - * Creates a plain object from a RevokedCertificate message. Also converts values to other types if specified. - * @param message RevokedCertificate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevokedCertificate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevokedCertificate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - SUPERSEDED = 2 - } - } - - /** Properties of a Certificate. */ - interface ICertificate { - - /** Certificate name */ - name?: (string|null); - - /** Certificate pemCsr */ - pemCsr?: (string|null); - - /** Certificate config */ - config?: (google.cloud.security.privateca.v1.ICertificateConfig|null); - - /** Certificate issuerCertificateAuthority */ - issuerCertificateAuthority?: (string|null); - - /** Certificate lifetime */ - lifetime?: (google.protobuf.IDuration|null); - - /** Certificate certificateTemplate */ - certificateTemplate?: (string|null); - - /** Certificate subjectMode */ - subjectMode?: (google.cloud.security.privateca.v1.SubjectRequestMode|keyof typeof google.cloud.security.privateca.v1.SubjectRequestMode|null); - - /** Certificate revocationDetails */ - revocationDetails?: (google.cloud.security.privateca.v1.Certificate.IRevocationDetails|null); - - /** Certificate pemCertificate */ - pemCertificate?: (string|null); - - /** Certificate certificateDescription */ - certificateDescription?: (google.cloud.security.privateca.v1.ICertificateDescription|null); - - /** Certificate pemCertificateChain */ - pemCertificateChain?: (string[]|null); - - /** Certificate createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Certificate updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Certificate labels */ - labels?: ({ [k: string]: string }|null); - - /** Certificate requestedNotBeforeTime */ - requestedNotBeforeTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Certificate. */ - class Certificate implements ICertificate { - - /** - * Constructs a new Certificate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICertificate); - - /** Certificate name. */ - public name: string; - - /** Certificate pemCsr. */ - public pemCsr?: (string|null); - - /** Certificate config. */ - public config?: (google.cloud.security.privateca.v1.ICertificateConfig|null); - - /** Certificate issuerCertificateAuthority. */ - public issuerCertificateAuthority: string; - - /** Certificate lifetime. */ - public lifetime?: (google.protobuf.IDuration|null); - - /** Certificate certificateTemplate. */ - public certificateTemplate: string; - - /** Certificate subjectMode. */ - public subjectMode: (google.cloud.security.privateca.v1.SubjectRequestMode|keyof typeof google.cloud.security.privateca.v1.SubjectRequestMode); - - /** Certificate revocationDetails. */ - public revocationDetails?: (google.cloud.security.privateca.v1.Certificate.IRevocationDetails|null); - - /** Certificate pemCertificate. */ - public pemCertificate: string; - - /** Certificate certificateDescription. */ - public certificateDescription?: (google.cloud.security.privateca.v1.ICertificateDescription|null); - - /** Certificate pemCertificateChain. */ - public pemCertificateChain: string[]; - - /** Certificate createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Certificate updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Certificate labels. */ - public labels: { [k: string]: string }; - - /** Certificate requestedNotBeforeTime. */ - public requestedNotBeforeTime?: (google.protobuf.ITimestamp|null); - - /** Certificate certificateConfig. */ - public certificateConfig?: ("pemCsr"|"config"); - - /** - * Creates a new Certificate instance using the specified properties. - * @param [properties] Properties to set - * @returns Certificate instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICertificate): google.cloud.security.privateca.v1.Certificate; - - /** - * Encodes the specified Certificate message. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.verify|verify} messages. - * @param message Certificate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICertificate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Certificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.verify|verify} messages. - * @param message Certificate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Certificate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Certificate - * @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.security.privateca.v1.Certificate; - - /** - * Decodes a Certificate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Certificate - * @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.security.privateca.v1.Certificate; - - /** - * Verifies a Certificate 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 Certificate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Certificate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.Certificate; - - /** - * Creates a plain object from a Certificate message. Also converts values to other types if specified. - * @param message Certificate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.Certificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Certificate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Certificate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Certificate { - - /** Properties of a RevocationDetails. */ - interface IRevocationDetails { - - /** RevocationDetails revocationState */ - revocationState?: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason|null); - - /** RevocationDetails revocationTime */ - revocationTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a RevocationDetails. */ - class RevocationDetails implements IRevocationDetails { - - /** - * Constructs a new RevocationDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.Certificate.IRevocationDetails); - - /** RevocationDetails revocationState. */ - public revocationState: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason); - - /** RevocationDetails revocationTime. */ - public revocationTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new RevocationDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns RevocationDetails instance - */ - public static create(properties?: google.cloud.security.privateca.v1.Certificate.IRevocationDetails): google.cloud.security.privateca.v1.Certificate.RevocationDetails; - - /** - * Encodes the specified RevocationDetails message. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.RevocationDetails.verify|verify} messages. - * @param message RevocationDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.Certificate.IRevocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevocationDetails message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.RevocationDetails.verify|verify} messages. - * @param message RevocationDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.Certificate.IRevocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevocationDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevocationDetails - * @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.security.privateca.v1.Certificate.RevocationDetails; - - /** - * Decodes a RevocationDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevocationDetails - * @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.security.privateca.v1.Certificate.RevocationDetails; - - /** - * Verifies a RevocationDetails 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 RevocationDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevocationDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.Certificate.RevocationDetails; - - /** - * Creates a plain object from a RevocationDetails message. Also converts values to other types if specified. - * @param message RevocationDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.Certificate.RevocationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevocationDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevocationDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a CertificateTemplate. */ - interface ICertificateTemplate { - - /** CertificateTemplate name */ - name?: (string|null); - - /** CertificateTemplate maximumLifetime */ - maximumLifetime?: (google.protobuf.IDuration|null); - - /** CertificateTemplate predefinedValues */ - predefinedValues?: (google.cloud.security.privateca.v1.IX509Parameters|null); - - /** CertificateTemplate identityConstraints */ - identityConstraints?: (google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null); - - /** CertificateTemplate passthroughExtensions */ - passthroughExtensions?: (google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null); - - /** CertificateTemplate description */ - description?: (string|null); - - /** CertificateTemplate createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** CertificateTemplate updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** CertificateTemplate labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a CertificateTemplate. */ - class CertificateTemplate implements ICertificateTemplate { - - /** - * Constructs a new CertificateTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICertificateTemplate); - - /** CertificateTemplate name. */ - public name: string; - - /** CertificateTemplate maximumLifetime. */ - public maximumLifetime?: (google.protobuf.IDuration|null); - - /** CertificateTemplate predefinedValues. */ - public predefinedValues?: (google.cloud.security.privateca.v1.IX509Parameters|null); - - /** CertificateTemplate identityConstraints. */ - public identityConstraints?: (google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null); - - /** CertificateTemplate passthroughExtensions. */ - public passthroughExtensions?: (google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null); - - /** CertificateTemplate description. */ - public description: string; - - /** CertificateTemplate createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** CertificateTemplate updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** CertificateTemplate labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new CertificateTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateTemplate instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICertificateTemplate): google.cloud.security.privateca.v1.CertificateTemplate; - - /** - * Encodes the specified CertificateTemplate message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateTemplate.verify|verify} messages. - * @param message CertificateTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICertificateTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateTemplate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateTemplate.verify|verify} messages. - * @param message CertificateTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateTemplate - * @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.security.privateca.v1.CertificateTemplate; - - /** - * Decodes a CertificateTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateTemplate - * @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.security.privateca.v1.CertificateTemplate; - - /** - * Verifies a CertificateTemplate 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 CertificateTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateTemplate; - - /** - * Creates a plain object from a CertificateTemplate message. Also converts values to other types if specified. - * @param message CertificateTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a X509Parameters. */ - interface IX509Parameters { - - /** X509Parameters keyUsage */ - keyUsage?: (google.cloud.security.privateca.v1.IKeyUsage|null); - - /** X509Parameters caOptions */ - caOptions?: (google.cloud.security.privateca.v1.X509Parameters.ICaOptions|null); - - /** X509Parameters policyIds */ - policyIds?: (google.cloud.security.privateca.v1.IObjectId[]|null); - - /** X509Parameters aiaOcspServers */ - aiaOcspServers?: (string[]|null); - - /** X509Parameters nameConstraints */ - nameConstraints?: (google.cloud.security.privateca.v1.X509Parameters.INameConstraints|null); - - /** X509Parameters additionalExtensions */ - additionalExtensions?: (google.cloud.security.privateca.v1.IX509Extension[]|null); - } - - /** Represents a X509Parameters. */ - class X509Parameters implements IX509Parameters { - - /** - * Constructs a new X509Parameters. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IX509Parameters); - - /** X509Parameters keyUsage. */ - public keyUsage?: (google.cloud.security.privateca.v1.IKeyUsage|null); - - /** X509Parameters caOptions. */ - public caOptions?: (google.cloud.security.privateca.v1.X509Parameters.ICaOptions|null); - - /** X509Parameters policyIds. */ - public policyIds: google.cloud.security.privateca.v1.IObjectId[]; - - /** X509Parameters aiaOcspServers. */ - public aiaOcspServers: string[]; - - /** X509Parameters nameConstraints. */ - public nameConstraints?: (google.cloud.security.privateca.v1.X509Parameters.INameConstraints|null); - - /** X509Parameters additionalExtensions. */ - public additionalExtensions: google.cloud.security.privateca.v1.IX509Extension[]; - - /** - * Creates a new X509Parameters instance using the specified properties. - * @param [properties] Properties to set - * @returns X509Parameters instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IX509Parameters): google.cloud.security.privateca.v1.X509Parameters; - - /** - * Encodes the specified X509Parameters message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.verify|verify} messages. - * @param message X509Parameters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IX509Parameters, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified X509Parameters message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.verify|verify} messages. - * @param message X509Parameters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IX509Parameters, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a X509Parameters message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns X509Parameters - * @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.security.privateca.v1.X509Parameters; - - /** - * Decodes a X509Parameters message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns X509Parameters - * @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.security.privateca.v1.X509Parameters; - - /** - * Verifies a X509Parameters 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 X509Parameters message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns X509Parameters - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.X509Parameters; - - /** - * Creates a plain object from a X509Parameters message. Also converts values to other types if specified. - * @param message X509Parameters - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.X509Parameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this X509Parameters to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for X509Parameters - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace X509Parameters { - - /** Properties of a CaOptions. */ - interface ICaOptions { - - /** CaOptions isCa */ - isCa?: (boolean|null); - - /** CaOptions maxIssuerPathLength */ - maxIssuerPathLength?: (number|null); - } - - /** Represents a CaOptions. */ - class CaOptions implements ICaOptions { - - /** - * Constructs a new CaOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.X509Parameters.ICaOptions); - - /** CaOptions isCa. */ - public isCa?: (boolean|null); - - /** CaOptions maxIssuerPathLength. */ - public maxIssuerPathLength?: (number|null); - - /** - * Creates a new CaOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns CaOptions instance - */ - public static create(properties?: google.cloud.security.privateca.v1.X509Parameters.ICaOptions): google.cloud.security.privateca.v1.X509Parameters.CaOptions; - - /** - * Encodes the specified CaOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.CaOptions.verify|verify} messages. - * @param message CaOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.X509Parameters.ICaOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CaOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.CaOptions.verify|verify} messages. - * @param message CaOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.X509Parameters.ICaOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CaOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CaOptions - * @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.security.privateca.v1.X509Parameters.CaOptions; - - /** - * Decodes a CaOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CaOptions - * @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.security.privateca.v1.X509Parameters.CaOptions; - - /** - * Verifies a CaOptions 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 CaOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CaOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.X509Parameters.CaOptions; - - /** - * Creates a plain object from a CaOptions message. Also converts values to other types if specified. - * @param message CaOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.X509Parameters.CaOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CaOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CaOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NameConstraints. */ - interface INameConstraints { - - /** NameConstraints critical */ - critical?: (boolean|null); - - /** NameConstraints permittedDnsNames */ - permittedDnsNames?: (string[]|null); - - /** NameConstraints excludedDnsNames */ - excludedDnsNames?: (string[]|null); - - /** NameConstraints permittedIpRanges */ - permittedIpRanges?: (string[]|null); - - /** NameConstraints excludedIpRanges */ - excludedIpRanges?: (string[]|null); - - /** NameConstraints permittedEmailAddresses */ - permittedEmailAddresses?: (string[]|null); - - /** NameConstraints excludedEmailAddresses */ - excludedEmailAddresses?: (string[]|null); - - /** NameConstraints permittedUris */ - permittedUris?: (string[]|null); - - /** NameConstraints excludedUris */ - excludedUris?: (string[]|null); - } - - /** Represents a NameConstraints. */ - class NameConstraints implements INameConstraints { - - /** - * Constructs a new NameConstraints. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.X509Parameters.INameConstraints); - - /** NameConstraints critical. */ - public critical: boolean; - - /** NameConstraints permittedDnsNames. */ - public permittedDnsNames: string[]; - - /** NameConstraints excludedDnsNames. */ - public excludedDnsNames: string[]; - - /** NameConstraints permittedIpRanges. */ - public permittedIpRanges: string[]; - - /** NameConstraints excludedIpRanges. */ - public excludedIpRanges: string[]; - - /** NameConstraints permittedEmailAddresses. */ - public permittedEmailAddresses: string[]; - - /** NameConstraints excludedEmailAddresses. */ - public excludedEmailAddresses: string[]; - - /** NameConstraints permittedUris. */ - public permittedUris: string[]; - - /** NameConstraints excludedUris. */ - public excludedUris: string[]; - - /** - * Creates a new NameConstraints instance using the specified properties. - * @param [properties] Properties to set - * @returns NameConstraints instance - */ - public static create(properties?: google.cloud.security.privateca.v1.X509Parameters.INameConstraints): google.cloud.security.privateca.v1.X509Parameters.NameConstraints; - - /** - * Encodes the specified NameConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.NameConstraints.verify|verify} messages. - * @param message NameConstraints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.X509Parameters.INameConstraints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NameConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.NameConstraints.verify|verify} messages. - * @param message NameConstraints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.X509Parameters.INameConstraints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NameConstraints message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NameConstraints - * @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.security.privateca.v1.X509Parameters.NameConstraints; - - /** - * Decodes a NameConstraints message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NameConstraints - * @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.security.privateca.v1.X509Parameters.NameConstraints; - - /** - * Verifies a NameConstraints 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 NameConstraints message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NameConstraints - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.X509Parameters.NameConstraints; - - /** - * Creates a plain object from a NameConstraints message. Also converts values to other types if specified. - * @param message NameConstraints - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.X509Parameters.NameConstraints, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NameConstraints to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NameConstraints - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SubordinateConfig. */ - interface ISubordinateConfig { - - /** SubordinateConfig certificateAuthority */ - certificateAuthority?: (string|null); - - /** SubordinateConfig pemIssuerChain */ - pemIssuerChain?: (google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain|null); - } - - /** Represents a SubordinateConfig. */ - class SubordinateConfig implements ISubordinateConfig { - - /** - * Constructs a new SubordinateConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ISubordinateConfig); - - /** SubordinateConfig certificateAuthority. */ - public certificateAuthority?: (string|null); - - /** SubordinateConfig pemIssuerChain. */ - public pemIssuerChain?: (google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain|null); - - /** SubordinateConfig subordinateConfig. */ - public subordinateConfig?: ("certificateAuthority"|"pemIssuerChain"); - - /** - * Creates a new SubordinateConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SubordinateConfig instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ISubordinateConfig): google.cloud.security.privateca.v1.SubordinateConfig; - - /** - * Encodes the specified SubordinateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.verify|verify} messages. - * @param message SubordinateConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ISubordinateConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubordinateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.verify|verify} messages. - * @param message SubordinateConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ISubordinateConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubordinateConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubordinateConfig - * @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.security.privateca.v1.SubordinateConfig; - - /** - * Decodes a SubordinateConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubordinateConfig - * @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.security.privateca.v1.SubordinateConfig; - - /** - * Verifies a SubordinateConfig 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 SubordinateConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubordinateConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.SubordinateConfig; - - /** - * Creates a plain object from a SubordinateConfig message. Also converts values to other types if specified. - * @param message SubordinateConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.SubordinateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubordinateConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubordinateConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SubordinateConfig { - - /** Properties of a SubordinateConfigChain. */ - interface ISubordinateConfigChain { - - /** SubordinateConfigChain pemCertificates */ - pemCertificates?: (string[]|null); - } - - /** Represents a SubordinateConfigChain. */ - class SubordinateConfigChain implements ISubordinateConfigChain { - - /** - * Constructs a new SubordinateConfigChain. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain); - - /** SubordinateConfigChain pemCertificates. */ - public pemCertificates: string[]; - - /** - * Creates a new SubordinateConfigChain instance using the specified properties. - * @param [properties] Properties to set - * @returns SubordinateConfigChain instance - */ - public static create(properties?: google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain): google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain; - - /** - * Encodes the specified SubordinateConfigChain message. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. - * @param message SubordinateConfigChain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubordinateConfigChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. - * @param message SubordinateConfigChain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubordinateConfigChain message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubordinateConfigChain - * @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.security.privateca.v1.SubordinateConfig.SubordinateConfigChain; - - /** - * Decodes a SubordinateConfigChain message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubordinateConfigChain - * @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.security.privateca.v1.SubordinateConfig.SubordinateConfigChain; - - /** - * Verifies a SubordinateConfigChain 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 SubordinateConfigChain message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubordinateConfigChain - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain; - - /** - * Creates a plain object from a SubordinateConfigChain message. Also converts values to other types if specified. - * @param message SubordinateConfigChain - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubordinateConfigChain to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubordinateConfigChain - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a PublicKey. */ - interface IPublicKey { - - /** PublicKey key */ - key?: (Uint8Array|Buffer|string|null); - - /** PublicKey format */ - format?: (google.cloud.security.privateca.v1.PublicKey.KeyFormat|keyof typeof google.cloud.security.privateca.v1.PublicKey.KeyFormat|null); - } - - /** Represents a PublicKey. */ - class PublicKey implements IPublicKey { - - /** - * Constructs a new PublicKey. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IPublicKey); - - /** PublicKey key. */ - public key: (Uint8Array|Buffer|string); - - /** PublicKey format. */ - public format: (google.cloud.security.privateca.v1.PublicKey.KeyFormat|keyof typeof google.cloud.security.privateca.v1.PublicKey.KeyFormat); - - /** - * Creates a new PublicKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PublicKey instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IPublicKey): google.cloud.security.privateca.v1.PublicKey; - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.security.privateca.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.security.privateca.v1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.security.privateca.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.security.privateca.v1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.security.privateca.v1.PublicKey; - - /** - * 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.security.privateca.v1.PublicKey; - - /** - * 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 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.security.privateca.v1.PublicKey; - - /** - * 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.security.privateca.v1.PublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PublicKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PublicKey - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PublicKey { - - /** KeyFormat enum. */ - enum KeyFormat { - KEY_FORMAT_UNSPECIFIED = 0, - PEM = 1 - } - } - - /** Properties of a CertificateConfig. */ - interface ICertificateConfig { - - /** CertificateConfig subjectConfig */ - subjectConfig?: (google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig|null); - - /** CertificateConfig x509Config */ - x509Config?: (google.cloud.security.privateca.v1.IX509Parameters|null); - - /** CertificateConfig publicKey */ - publicKey?: (google.cloud.security.privateca.v1.IPublicKey|null); - - /** CertificateConfig subjectKeyId */ - subjectKeyId?: (google.cloud.security.privateca.v1.CertificateConfig.IKeyId|null); - } - - /** Represents a CertificateConfig. */ - class CertificateConfig implements ICertificateConfig { - - /** - * Constructs a new CertificateConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICertificateConfig); - - /** CertificateConfig subjectConfig. */ - public subjectConfig?: (google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig|null); - - /** CertificateConfig x509Config. */ - public x509Config?: (google.cloud.security.privateca.v1.IX509Parameters|null); - - /** CertificateConfig publicKey. */ - public publicKey?: (google.cloud.security.privateca.v1.IPublicKey|null); - - /** CertificateConfig subjectKeyId. */ - public subjectKeyId?: (google.cloud.security.privateca.v1.CertificateConfig.IKeyId|null); - - /** - * Creates a new CertificateConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateConfig instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICertificateConfig): google.cloud.security.privateca.v1.CertificateConfig; - - /** - * Encodes the specified CertificateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.verify|verify} messages. - * @param message CertificateConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICertificateConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.verify|verify} messages. - * @param message CertificateConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateConfig - * @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.security.privateca.v1.CertificateConfig; - - /** - * Decodes a CertificateConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateConfig - * @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.security.privateca.v1.CertificateConfig; - - /** - * Verifies a CertificateConfig 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 CertificateConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateConfig; - - /** - * Creates a plain object from a CertificateConfig message. Also converts values to other types if specified. - * @param message CertificateConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CertificateConfig { - - /** Properties of a SubjectConfig. */ - interface ISubjectConfig { - - /** SubjectConfig subject */ - subject?: (google.cloud.security.privateca.v1.ISubject|null); - - /** SubjectConfig subjectAltName */ - subjectAltName?: (google.cloud.security.privateca.v1.ISubjectAltNames|null); - } - - /** Represents a SubjectConfig. */ - class SubjectConfig implements ISubjectConfig { - - /** - * Constructs a new SubjectConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig); - - /** SubjectConfig subject. */ - public subject?: (google.cloud.security.privateca.v1.ISubject|null); - - /** SubjectConfig subjectAltName. */ - public subjectAltName?: (google.cloud.security.privateca.v1.ISubjectAltNames|null); - - /** - * Creates a new SubjectConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SubjectConfig instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig): google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig; - - /** - * Encodes the specified SubjectConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.verify|verify} messages. - * @param message SubjectConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubjectConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.verify|verify} messages. - * @param message SubjectConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubjectConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubjectConfig - * @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.security.privateca.v1.CertificateConfig.SubjectConfig; - - /** - * Decodes a SubjectConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubjectConfig - * @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.security.privateca.v1.CertificateConfig.SubjectConfig; - - /** - * Verifies a SubjectConfig 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 SubjectConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubjectConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig; - - /** - * Creates a plain object from a SubjectConfig message. Also converts values to other types if specified. - * @param message SubjectConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubjectConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubjectConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyId. */ - interface IKeyId { - - /** KeyId keyId */ - keyId?: (string|null); - } - - /** Represents a KeyId. */ - class KeyId implements IKeyId { - - /** - * Constructs a new KeyId. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CertificateConfig.IKeyId); - - /** KeyId keyId. */ - public keyId: string; - - /** - * Creates a new KeyId instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyId instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CertificateConfig.IKeyId): google.cloud.security.privateca.v1.CertificateConfig.KeyId; - - /** - * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.KeyId.verify|verify} messages. - * @param message KeyId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CertificateConfig.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.KeyId.verify|verify} messages. - * @param message KeyId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateConfig.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyId message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyId - * @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.security.privateca.v1.CertificateConfig.KeyId; - - /** - * Decodes a KeyId message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyId - * @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.security.privateca.v1.CertificateConfig.KeyId; - - /** - * Verifies a KeyId 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 KeyId message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyId - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateConfig.KeyId; - - /** - * Creates a plain object from a KeyId message. Also converts values to other types if specified. - * @param message KeyId - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateConfig.KeyId, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyId to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyId - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a CertificateDescription. */ - interface ICertificateDescription { - - /** CertificateDescription subjectDescription */ - subjectDescription?: (google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription|null); - - /** CertificateDescription x509Description */ - x509Description?: (google.cloud.security.privateca.v1.IX509Parameters|null); - - /** CertificateDescription publicKey */ - publicKey?: (google.cloud.security.privateca.v1.IPublicKey|null); - - /** CertificateDescription subjectKeyId */ - subjectKeyId?: (google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null); - - /** CertificateDescription authorityKeyId */ - authorityKeyId?: (google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null); - - /** CertificateDescription crlDistributionPoints */ - crlDistributionPoints?: (string[]|null); - - /** CertificateDescription aiaIssuingCertificateUrls */ - aiaIssuingCertificateUrls?: (string[]|null); - - /** CertificateDescription certFingerprint */ - certFingerprint?: (google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint|null); - - /** CertificateDescription tbsCertificateDigest */ - tbsCertificateDigest?: (string|null); - } - - /** Represents a CertificateDescription. */ - class CertificateDescription implements ICertificateDescription { - - /** - * Constructs a new CertificateDescription. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICertificateDescription); - - /** CertificateDescription subjectDescription. */ - public subjectDescription?: (google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription|null); - - /** CertificateDescription x509Description. */ - public x509Description?: (google.cloud.security.privateca.v1.IX509Parameters|null); - - /** CertificateDescription publicKey. */ - public publicKey?: (google.cloud.security.privateca.v1.IPublicKey|null); - - /** CertificateDescription subjectKeyId. */ - public subjectKeyId?: (google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null); - - /** CertificateDescription authorityKeyId. */ - public authorityKeyId?: (google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null); - - /** CertificateDescription crlDistributionPoints. */ - public crlDistributionPoints: string[]; - - /** CertificateDescription aiaIssuingCertificateUrls. */ - public aiaIssuingCertificateUrls: string[]; - - /** CertificateDescription certFingerprint. */ - public certFingerprint?: (google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint|null); - - /** CertificateDescription tbsCertificateDigest. */ - public tbsCertificateDigest: string; - - /** - * Creates a new CertificateDescription instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateDescription instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICertificateDescription): google.cloud.security.privateca.v1.CertificateDescription; - - /** - * Encodes the specified CertificateDescription message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.verify|verify} messages. - * @param message CertificateDescription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICertificateDescription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.verify|verify} messages. - * @param message CertificateDescription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateDescription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateDescription message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateDescription - * @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.security.privateca.v1.CertificateDescription; - - /** - * Decodes a CertificateDescription message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateDescription - * @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.security.privateca.v1.CertificateDescription; - - /** - * Verifies a CertificateDescription 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 CertificateDescription message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateDescription - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateDescription; - - /** - * Creates a plain object from a CertificateDescription message. Also converts values to other types if specified. - * @param message CertificateDescription - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateDescription, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateDescription to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateDescription - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CertificateDescription { - - /** Properties of a SubjectDescription. */ - interface ISubjectDescription { - - /** SubjectDescription subject */ - subject?: (google.cloud.security.privateca.v1.ISubject|null); - - /** SubjectDescription subjectAltName */ - subjectAltName?: (google.cloud.security.privateca.v1.ISubjectAltNames|null); - - /** SubjectDescription hexSerialNumber */ - hexSerialNumber?: (string|null); - - /** SubjectDescription lifetime */ - lifetime?: (google.protobuf.IDuration|null); - - /** SubjectDescription notBeforeTime */ - notBeforeTime?: (google.protobuf.ITimestamp|null); - - /** SubjectDescription notAfterTime */ - notAfterTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a SubjectDescription. */ - class SubjectDescription implements ISubjectDescription { - - /** - * Constructs a new SubjectDescription. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription); - - /** SubjectDescription subject. */ - public subject?: (google.cloud.security.privateca.v1.ISubject|null); - - /** SubjectDescription subjectAltName. */ - public subjectAltName?: (google.cloud.security.privateca.v1.ISubjectAltNames|null); - - /** SubjectDescription hexSerialNumber. */ - public hexSerialNumber: string; - - /** SubjectDescription lifetime. */ - public lifetime?: (google.protobuf.IDuration|null); - - /** SubjectDescription notBeforeTime. */ - public notBeforeTime?: (google.protobuf.ITimestamp|null); - - /** SubjectDescription notAfterTime. */ - public notAfterTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new SubjectDescription instance using the specified properties. - * @param [properties] Properties to set - * @returns SubjectDescription instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription): google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription; - - /** - * Encodes the specified SubjectDescription message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.verify|verify} messages. - * @param message SubjectDescription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubjectDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.verify|verify} messages. - * @param message SubjectDescription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubjectDescription message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubjectDescription - * @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.security.privateca.v1.CertificateDescription.SubjectDescription; - - /** - * Decodes a SubjectDescription message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubjectDescription - * @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.security.privateca.v1.CertificateDescription.SubjectDescription; - - /** - * Verifies a SubjectDescription 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 SubjectDescription message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubjectDescription - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription; - - /** - * Creates a plain object from a SubjectDescription message. Also converts values to other types if specified. - * @param message SubjectDescription - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubjectDescription to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubjectDescription - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyId. */ - interface IKeyId { - - /** KeyId keyId */ - keyId?: (string|null); - } - - /** Represents a KeyId. */ - class KeyId implements IKeyId { - - /** - * Constructs a new KeyId. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CertificateDescription.IKeyId); - - /** KeyId keyId. */ - public keyId: string; - - /** - * Creates a new KeyId instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyId instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CertificateDescription.IKeyId): google.cloud.security.privateca.v1.CertificateDescription.KeyId; - - /** - * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify|verify} messages. - * @param message KeyId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CertificateDescription.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify|verify} messages. - * @param message KeyId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateDescription.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyId message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyId - * @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.security.privateca.v1.CertificateDescription.KeyId; - - /** - * Decodes a KeyId message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyId - * @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.security.privateca.v1.CertificateDescription.KeyId; - - /** - * Verifies a KeyId 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 KeyId message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyId - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateDescription.KeyId; - - /** - * Creates a plain object from a KeyId message. Also converts values to other types if specified. - * @param message KeyId - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateDescription.KeyId, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyId to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyId - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CertificateFingerprint. */ - interface ICertificateFingerprint { - - /** CertificateFingerprint sha256Hash */ - sha256Hash?: (string|null); - } - - /** Represents a CertificateFingerprint. */ - class CertificateFingerprint implements ICertificateFingerprint { - - /** - * Constructs a new CertificateFingerprint. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint); - - /** CertificateFingerprint sha256Hash. */ - public sha256Hash: string; - - /** - * Creates a new CertificateFingerprint instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateFingerprint instance - */ - public static create(properties?: google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint): google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint; - - /** - * Encodes the specified CertificateFingerprint message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.verify|verify} messages. - * @param message CertificateFingerprint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateFingerprint message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.verify|verify} messages. - * @param message CertificateFingerprint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateFingerprint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateFingerprint - * @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.security.privateca.v1.CertificateDescription.CertificateFingerprint; - - /** - * Decodes a CertificateFingerprint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateFingerprint - * @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.security.privateca.v1.CertificateDescription.CertificateFingerprint; - - /** - * Verifies a CertificateFingerprint 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 CertificateFingerprint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateFingerprint - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint; - - /** - * Creates a plain object from a CertificateFingerprint message. Also converts values to other types if specified. - * @param message CertificateFingerprint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateFingerprint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateFingerprint - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ObjectId. */ - interface IObjectId { - - /** ObjectId objectIdPath */ - objectIdPath?: (number[]|null); - } - - /** Represents an ObjectId. */ - class ObjectId implements IObjectId { - - /** - * Constructs a new ObjectId. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IObjectId); - - /** ObjectId objectIdPath. */ - public objectIdPath: number[]; - - /** - * Creates a new ObjectId instance using the specified properties. - * @param [properties] Properties to set - * @returns ObjectId instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IObjectId): google.cloud.security.privateca.v1.ObjectId; - - /** - * Encodes the specified ObjectId message. Does not implicitly {@link google.cloud.security.privateca.v1.ObjectId.verify|verify} messages. - * @param message ObjectId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IObjectId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ObjectId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ObjectId.verify|verify} messages. - * @param message ObjectId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IObjectId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ObjectId message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ObjectId - * @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.security.privateca.v1.ObjectId; - - /** - * Decodes an ObjectId message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ObjectId - * @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.security.privateca.v1.ObjectId; - - /** - * Verifies an ObjectId 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 ObjectId message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ObjectId - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ObjectId; - - /** - * Creates a plain object from an ObjectId message. Also converts values to other types if specified. - * @param message ObjectId - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ObjectId, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ObjectId to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ObjectId - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a X509Extension. */ - interface IX509Extension { - - /** X509Extension objectId */ - objectId?: (google.cloud.security.privateca.v1.IObjectId|null); - - /** X509Extension critical */ - critical?: (boolean|null); - - /** X509Extension value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents a X509Extension. */ - class X509Extension implements IX509Extension { - - /** - * Constructs a new X509Extension. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IX509Extension); - - /** X509Extension objectId. */ - public objectId?: (google.cloud.security.privateca.v1.IObjectId|null); - - /** X509Extension critical. */ - public critical: boolean; - - /** X509Extension value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new X509Extension instance using the specified properties. - * @param [properties] Properties to set - * @returns X509Extension instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IX509Extension): google.cloud.security.privateca.v1.X509Extension; - - /** - * Encodes the specified X509Extension message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Extension.verify|verify} messages. - * @param message X509Extension message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IX509Extension, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified X509Extension message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Extension.verify|verify} messages. - * @param message X509Extension message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IX509Extension, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a X509Extension message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns X509Extension - * @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.security.privateca.v1.X509Extension; - - /** - * Decodes a X509Extension message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns X509Extension - * @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.security.privateca.v1.X509Extension; - - /** - * Verifies a X509Extension 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 X509Extension message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns X509Extension - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.X509Extension; - - /** - * Creates a plain object from a X509Extension message. Also converts values to other types if specified. - * @param message X509Extension - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.X509Extension, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this X509Extension to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for X509Extension - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyUsage. */ - interface IKeyUsage { - - /** KeyUsage baseKeyUsage */ - baseKeyUsage?: (google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions|null); - - /** KeyUsage extendedKeyUsage */ - extendedKeyUsage?: (google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions|null); - - /** KeyUsage unknownExtendedKeyUsages */ - unknownExtendedKeyUsages?: (google.cloud.security.privateca.v1.IObjectId[]|null); - } - - /** Represents a KeyUsage. */ - class KeyUsage implements IKeyUsage { - - /** - * Constructs a new KeyUsage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IKeyUsage); - - /** KeyUsage baseKeyUsage. */ - public baseKeyUsage?: (google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions|null); - - /** KeyUsage extendedKeyUsage. */ - public extendedKeyUsage?: (google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions|null); - - /** KeyUsage unknownExtendedKeyUsages. */ - public unknownExtendedKeyUsages: google.cloud.security.privateca.v1.IObjectId[]; - - /** - * Creates a new KeyUsage instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyUsage instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IKeyUsage): google.cloud.security.privateca.v1.KeyUsage; - - /** - * Encodes the specified KeyUsage message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.verify|verify} messages. - * @param message KeyUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IKeyUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyUsage message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.verify|verify} messages. - * @param message KeyUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IKeyUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyUsage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyUsage - * @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.security.privateca.v1.KeyUsage; - - /** - * Decodes a KeyUsage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyUsage - * @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.security.privateca.v1.KeyUsage; - - /** - * Verifies a KeyUsage 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 KeyUsage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyUsage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.KeyUsage; - - /** - * Creates a plain object from a KeyUsage message. Also converts values to other types if specified. - * @param message KeyUsage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.KeyUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyUsage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyUsage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace KeyUsage { - - /** Properties of a KeyUsageOptions. */ - interface IKeyUsageOptions { - - /** KeyUsageOptions digitalSignature */ - digitalSignature?: (boolean|null); - - /** KeyUsageOptions contentCommitment */ - contentCommitment?: (boolean|null); - - /** KeyUsageOptions keyEncipherment */ - keyEncipherment?: (boolean|null); - - /** KeyUsageOptions dataEncipherment */ - dataEncipherment?: (boolean|null); - - /** KeyUsageOptions keyAgreement */ - keyAgreement?: (boolean|null); - - /** KeyUsageOptions certSign */ - certSign?: (boolean|null); - - /** KeyUsageOptions crlSign */ - crlSign?: (boolean|null); - - /** KeyUsageOptions encipherOnly */ - encipherOnly?: (boolean|null); - - /** KeyUsageOptions decipherOnly */ - decipherOnly?: (boolean|null); - } - - /** Represents a KeyUsageOptions. */ - class KeyUsageOptions implements IKeyUsageOptions { - - /** - * Constructs a new KeyUsageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions); - - /** KeyUsageOptions digitalSignature. */ - public digitalSignature: boolean; - - /** KeyUsageOptions contentCommitment. */ - public contentCommitment: boolean; - - /** KeyUsageOptions keyEncipherment. */ - public keyEncipherment: boolean; - - /** KeyUsageOptions dataEncipherment. */ - public dataEncipherment: boolean; - - /** KeyUsageOptions keyAgreement. */ - public keyAgreement: boolean; - - /** KeyUsageOptions certSign. */ - public certSign: boolean; - - /** KeyUsageOptions crlSign. */ - public crlSign: boolean; - - /** KeyUsageOptions encipherOnly. */ - public encipherOnly: boolean; - - /** KeyUsageOptions decipherOnly. */ - public decipherOnly: boolean; - - /** - * Creates a new KeyUsageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyUsageOptions instance - */ - public static create(properties?: google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions): google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions; - - /** - * Encodes the specified KeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.verify|verify} messages. - * @param message KeyUsageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.verify|verify} messages. - * @param message KeyUsageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyUsageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyUsageOptions - * @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.security.privateca.v1.KeyUsage.KeyUsageOptions; - - /** - * Decodes a KeyUsageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyUsageOptions - * @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.security.privateca.v1.KeyUsage.KeyUsageOptions; - - /** - * Verifies a KeyUsageOptions 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 KeyUsageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyUsageOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions; - - /** - * Creates a plain object from a KeyUsageOptions message. Also converts values to other types if specified. - * @param message KeyUsageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyUsageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyUsageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExtendedKeyUsageOptions. */ - interface IExtendedKeyUsageOptions { - - /** ExtendedKeyUsageOptions serverAuth */ - serverAuth?: (boolean|null); - - /** ExtendedKeyUsageOptions clientAuth */ - clientAuth?: (boolean|null); - - /** ExtendedKeyUsageOptions codeSigning */ - codeSigning?: (boolean|null); - - /** ExtendedKeyUsageOptions emailProtection */ - emailProtection?: (boolean|null); - - /** ExtendedKeyUsageOptions timeStamping */ - timeStamping?: (boolean|null); - - /** ExtendedKeyUsageOptions ocspSigning */ - ocspSigning?: (boolean|null); - } - - /** Represents an ExtendedKeyUsageOptions. */ - class ExtendedKeyUsageOptions implements IExtendedKeyUsageOptions { - - /** - * Constructs a new ExtendedKeyUsageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions); - - /** ExtendedKeyUsageOptions serverAuth. */ - public serverAuth: boolean; - - /** ExtendedKeyUsageOptions clientAuth. */ - public clientAuth: boolean; - - /** ExtendedKeyUsageOptions codeSigning. */ - public codeSigning: boolean; - - /** ExtendedKeyUsageOptions emailProtection. */ - public emailProtection: boolean; - - /** ExtendedKeyUsageOptions timeStamping. */ - public timeStamping: boolean; - - /** ExtendedKeyUsageOptions ocspSigning. */ - public ocspSigning: boolean; - - /** - * Creates a new ExtendedKeyUsageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtendedKeyUsageOptions instance - */ - public static create(properties?: google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions): google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions; - - /** - * Encodes the specified ExtendedKeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. - * @param message ExtendedKeyUsageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtendedKeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. - * @param message ExtendedKeyUsageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtendedKeyUsageOptions - * @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.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions; - - /** - * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtendedKeyUsageOptions - * @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.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions; - - /** - * Verifies an ExtendedKeyUsageOptions 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 ExtendedKeyUsageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtendedKeyUsageOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions; - - /** - * Creates a plain object from an ExtendedKeyUsageOptions message. Also converts values to other types if specified. - * @param message ExtendedKeyUsageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtendedKeyUsageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtendedKeyUsageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an AttributeTypeAndValue. */ - interface IAttributeTypeAndValue { - - /** AttributeTypeAndValue type */ - type?: (google.cloud.security.privateca.v1.AttributeType|keyof typeof google.cloud.security.privateca.v1.AttributeType|null); - - /** AttributeTypeAndValue objectId */ - objectId?: (google.cloud.security.privateca.v1.IObjectId|null); - - /** AttributeTypeAndValue value */ - value?: (string|null); - } - - /** Represents an AttributeTypeAndValue. */ - class AttributeTypeAndValue implements IAttributeTypeAndValue { - - /** - * Constructs a new AttributeTypeAndValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IAttributeTypeAndValue); - - /** AttributeTypeAndValue type. */ - public type?: (google.cloud.security.privateca.v1.AttributeType|keyof typeof google.cloud.security.privateca.v1.AttributeType|null); - - /** AttributeTypeAndValue objectId. */ - public objectId?: (google.cloud.security.privateca.v1.IObjectId|null); - - /** AttributeTypeAndValue value. */ - public value: string; - - /** AttributeTypeAndValue attributeType. */ - public attributeType?: ("type"|"objectId"); - - /** - * Creates a new AttributeTypeAndValue instance using the specified properties. - * @param [properties] Properties to set - * @returns AttributeTypeAndValue instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IAttributeTypeAndValue): google.cloud.security.privateca.v1.AttributeTypeAndValue; - - /** - * Encodes the specified AttributeTypeAndValue message. Does not implicitly {@link google.cloud.security.privateca.v1.AttributeTypeAndValue.verify|verify} messages. - * @param message AttributeTypeAndValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IAttributeTypeAndValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttributeTypeAndValue message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.AttributeTypeAndValue.verify|verify} messages. - * @param message AttributeTypeAndValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IAttributeTypeAndValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttributeTypeAndValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttributeTypeAndValue - * @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.security.privateca.v1.AttributeTypeAndValue; - - /** - * Decodes an AttributeTypeAndValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttributeTypeAndValue - * @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.security.privateca.v1.AttributeTypeAndValue; - - /** - * Verifies an AttributeTypeAndValue 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 AttributeTypeAndValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttributeTypeAndValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.AttributeTypeAndValue; - - /** - * Creates a plain object from an AttributeTypeAndValue message. Also converts values to other types if specified. - * @param message AttributeTypeAndValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.AttributeTypeAndValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttributeTypeAndValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttributeTypeAndValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RelativeDistinguishedName. */ - interface IRelativeDistinguishedName { - - /** RelativeDistinguishedName attributes */ - attributes?: (google.cloud.security.privateca.v1.IAttributeTypeAndValue[]|null); - } - - /** Represents a RelativeDistinguishedName. */ - class RelativeDistinguishedName implements IRelativeDistinguishedName { - - /** - * Constructs a new RelativeDistinguishedName. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IRelativeDistinguishedName); - - /** RelativeDistinguishedName attributes. */ - public attributes: google.cloud.security.privateca.v1.IAttributeTypeAndValue[]; - - /** - * Creates a new RelativeDistinguishedName instance using the specified properties. - * @param [properties] Properties to set - * @returns RelativeDistinguishedName instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IRelativeDistinguishedName): google.cloud.security.privateca.v1.RelativeDistinguishedName; - - /** - * Encodes the specified RelativeDistinguishedName message. Does not implicitly {@link google.cloud.security.privateca.v1.RelativeDistinguishedName.verify|verify} messages. - * @param message RelativeDistinguishedName message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IRelativeDistinguishedName, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RelativeDistinguishedName message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.RelativeDistinguishedName.verify|verify} messages. - * @param message RelativeDistinguishedName message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IRelativeDistinguishedName, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RelativeDistinguishedName message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RelativeDistinguishedName - * @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.security.privateca.v1.RelativeDistinguishedName; - - /** - * Decodes a RelativeDistinguishedName message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RelativeDistinguishedName - * @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.security.privateca.v1.RelativeDistinguishedName; - - /** - * Verifies a RelativeDistinguishedName 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 RelativeDistinguishedName message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RelativeDistinguishedName - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.RelativeDistinguishedName; - - /** - * Creates a plain object from a RelativeDistinguishedName message. Also converts values to other types if specified. - * @param message RelativeDistinguishedName - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.RelativeDistinguishedName, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RelativeDistinguishedName to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RelativeDistinguishedName - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Subject. */ - interface ISubject { - - /** Subject commonName */ - commonName?: (string|null); - - /** Subject countryCode */ - countryCode?: (string|null); - - /** Subject organization */ - organization?: (string|null); - - /** Subject organizationalUnit */ - organizationalUnit?: (string|null); - - /** Subject locality */ - locality?: (string|null); - - /** Subject province */ - province?: (string|null); - - /** Subject streetAddress */ - streetAddress?: (string|null); - - /** Subject postalCode */ - postalCode?: (string|null); - - /** Subject rdnSequence */ - rdnSequence?: (google.cloud.security.privateca.v1.IRelativeDistinguishedName[]|null); - } - - /** Represents a Subject. */ - class Subject implements ISubject { - - /** - * Constructs a new Subject. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ISubject); - - /** Subject commonName. */ - public commonName: string; - - /** Subject countryCode. */ - public countryCode: string; - - /** Subject organization. */ - public organization: string; - - /** Subject organizationalUnit. */ - public organizationalUnit: string; - - /** Subject locality. */ - public locality: string; - - /** Subject province. */ - public province: string; - - /** Subject streetAddress. */ - public streetAddress: string; - - /** Subject postalCode. */ - public postalCode: string; - - /** Subject rdnSequence. */ - public rdnSequence: google.cloud.security.privateca.v1.IRelativeDistinguishedName[]; - - /** - * Creates a new Subject instance using the specified properties. - * @param [properties] Properties to set - * @returns Subject instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ISubject): google.cloud.security.privateca.v1.Subject; - - /** - * Encodes the specified Subject message. Does not implicitly {@link google.cloud.security.privateca.v1.Subject.verify|verify} messages. - * @param message Subject message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Subject.verify|verify} messages. - * @param message Subject message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Subject message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Subject - * @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.security.privateca.v1.Subject; - - /** - * Decodes a Subject message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Subject - * @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.security.privateca.v1.Subject; - - /** - * Verifies a Subject 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 Subject message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Subject - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.Subject; - - /** - * Creates a plain object from a Subject message. Also converts values to other types if specified. - * @param message Subject - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.Subject, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Subject to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Subject - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SubjectAltNames. */ - interface ISubjectAltNames { - - /** SubjectAltNames dnsNames */ - dnsNames?: (string[]|null); - - /** SubjectAltNames uris */ - uris?: (string[]|null); - - /** SubjectAltNames emailAddresses */ - emailAddresses?: (string[]|null); - - /** SubjectAltNames ipAddresses */ - ipAddresses?: (string[]|null); - - /** SubjectAltNames customSans */ - customSans?: (google.cloud.security.privateca.v1.IX509Extension[]|null); - } - - /** Represents a SubjectAltNames. */ - class SubjectAltNames implements ISubjectAltNames { - - /** - * Constructs a new SubjectAltNames. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ISubjectAltNames); - - /** SubjectAltNames dnsNames. */ - public dnsNames: string[]; - - /** SubjectAltNames uris. */ - public uris: string[]; - - /** SubjectAltNames emailAddresses. */ - public emailAddresses: string[]; - - /** SubjectAltNames ipAddresses. */ - public ipAddresses: string[]; - - /** SubjectAltNames customSans. */ - public customSans: google.cloud.security.privateca.v1.IX509Extension[]; - - /** - * Creates a new SubjectAltNames instance using the specified properties. - * @param [properties] Properties to set - * @returns SubjectAltNames instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ISubjectAltNames): google.cloud.security.privateca.v1.SubjectAltNames; - - /** - * Encodes the specified SubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1.SubjectAltNames.verify|verify} messages. - * @param message SubjectAltNames message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ISubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubjectAltNames.verify|verify} messages. - * @param message SubjectAltNames message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ISubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubjectAltNames message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubjectAltNames - * @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.security.privateca.v1.SubjectAltNames; - - /** - * Decodes a SubjectAltNames message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubjectAltNames - * @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.security.privateca.v1.SubjectAltNames; - - /** - * Verifies a SubjectAltNames 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 SubjectAltNames message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubjectAltNames - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.SubjectAltNames; - - /** - * Creates a plain object from a SubjectAltNames message. Also converts values to other types if specified. - * @param message SubjectAltNames - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.SubjectAltNames, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubjectAltNames to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubjectAltNames - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CertificateIdentityConstraints. */ - interface ICertificateIdentityConstraints { - - /** CertificateIdentityConstraints celExpression */ - celExpression?: (google.type.IExpr|null); - - /** CertificateIdentityConstraints allowSubjectPassthrough */ - allowSubjectPassthrough?: (boolean|null); - - /** CertificateIdentityConstraints allowSubjectAltNamesPassthrough */ - allowSubjectAltNamesPassthrough?: (boolean|null); - } - - /** Represents a CertificateIdentityConstraints. */ - class CertificateIdentityConstraints implements ICertificateIdentityConstraints { - - /** - * Constructs a new CertificateIdentityConstraints. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICertificateIdentityConstraints); - - /** CertificateIdentityConstraints celExpression. */ - public celExpression?: (google.type.IExpr|null); - - /** CertificateIdentityConstraints allowSubjectPassthrough. */ - public allowSubjectPassthrough?: (boolean|null); - - /** CertificateIdentityConstraints allowSubjectAltNamesPassthrough. */ - public allowSubjectAltNamesPassthrough?: (boolean|null); - - /** - * Creates a new CertificateIdentityConstraints instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateIdentityConstraints instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICertificateIdentityConstraints): google.cloud.security.privateca.v1.CertificateIdentityConstraints; - - /** - * Encodes the specified CertificateIdentityConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify|verify} messages. - * @param message CertificateIdentityConstraints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICertificateIdentityConstraints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateIdentityConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify|verify} messages. - * @param message CertificateIdentityConstraints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateIdentityConstraints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateIdentityConstraints message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateIdentityConstraints - * @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.security.privateca.v1.CertificateIdentityConstraints; - - /** - * Decodes a CertificateIdentityConstraints message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateIdentityConstraints - * @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.security.privateca.v1.CertificateIdentityConstraints; - - /** - * Verifies a CertificateIdentityConstraints 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 CertificateIdentityConstraints message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateIdentityConstraints - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateIdentityConstraints; - - /** - * Creates a plain object from a CertificateIdentityConstraints message. Also converts values to other types if specified. - * @param message CertificateIdentityConstraints - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateIdentityConstraints, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateIdentityConstraints to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateIdentityConstraints - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CertificateExtensionConstraints. */ - interface ICertificateExtensionConstraints { - - /** CertificateExtensionConstraints knownExtensions */ - knownExtensions?: (google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension[]|null); - - /** CertificateExtensionConstraints additionalExtensions */ - additionalExtensions?: (google.cloud.security.privateca.v1.IObjectId[]|null); - } - - /** Represents a CertificateExtensionConstraints. */ - class CertificateExtensionConstraints implements ICertificateExtensionConstraints { - - /** - * Constructs a new CertificateExtensionConstraints. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICertificateExtensionConstraints); - - /** CertificateExtensionConstraints knownExtensions. */ - public knownExtensions: google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension[]; - - /** CertificateExtensionConstraints additionalExtensions. */ - public additionalExtensions: google.cloud.security.privateca.v1.IObjectId[]; - - /** - * Creates a new CertificateExtensionConstraints instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateExtensionConstraints instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICertificateExtensionConstraints): google.cloud.security.privateca.v1.CertificateExtensionConstraints; - - /** - * Encodes the specified CertificateExtensionConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify|verify} messages. - * @param message CertificateExtensionConstraints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICertificateExtensionConstraints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateExtensionConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify|verify} messages. - * @param message CertificateExtensionConstraints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICertificateExtensionConstraints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateExtensionConstraints message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateExtensionConstraints - * @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.security.privateca.v1.CertificateExtensionConstraints; - - /** - * Decodes a CertificateExtensionConstraints message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateExtensionConstraints - * @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.security.privateca.v1.CertificateExtensionConstraints; - - /** - * Verifies a CertificateExtensionConstraints 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 CertificateExtensionConstraints message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateExtensionConstraints - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CertificateExtensionConstraints; - - /** - * Creates a plain object from a CertificateExtensionConstraints message. Also converts values to other types if specified. - * @param message CertificateExtensionConstraints - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CertificateExtensionConstraints, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateExtensionConstraints to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateExtensionConstraints - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CertificateExtensionConstraints { - - /** KnownCertificateExtension enum. */ - enum KnownCertificateExtension { - KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED = 0, - BASE_KEY_USAGE = 1, - EXTENDED_KEY_USAGE = 2, - CA_OPTIONS = 3, - POLICY_IDS = 4, - AIA_OCSP_SERVERS = 5, - NAME_CONSTRAINTS = 6 - } - } - - /** AttributeType enum. */ - enum AttributeType { - ATTRIBUTE_TYPE_UNSPECIFIED = 0, - COMMON_NAME = 1, - COUNTRY_CODE = 2, - ORGANIZATION = 3, - ORGANIZATIONAL_UNIT = 4, - LOCALITY = 5, - PROVINCE = 6, - STREET_ADDRESS = 7, - POSTAL_CODE = 8 - } - - /** RevocationReason enum. */ - enum RevocationReason { - REVOCATION_REASON_UNSPECIFIED = 0, - KEY_COMPROMISE = 1, - CERTIFICATE_AUTHORITY_COMPROMISE = 2, - AFFILIATION_CHANGED = 3, - SUPERSEDED = 4, - CESSATION_OF_OPERATION = 5, - CERTIFICATE_HOLD = 6, - PRIVILEGE_WITHDRAWN = 7, - ATTRIBUTE_AUTHORITY_COMPROMISE = 8 - } - - /** SubjectRequestMode enum. */ - enum SubjectRequestMode { - SUBJECT_REQUEST_MODE_UNSPECIFIED = 0, - DEFAULT = 1, - RDN_SEQUENCE = 3, - REFLECTED_SPIFFE = 2 - } - - /** Represents a CertificateAuthorityService */ - class CertificateAuthorityService extends $protobuf.rpc.Service { - - /** - * Constructs a new CertificateAuthorityService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new CertificateAuthorityService 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): CertificateAuthorityService; - - /** - * Calls CreateCertificate. - * @param request CreateCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Certificate - */ - public createCertificate(request: google.cloud.security.privateca.v1.ICreateCertificateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateCallback): void; - - /** - * Calls CreateCertificate. - * @param request CreateCertificateRequest message or plain object - * @returns Promise - */ - public createCertificate(request: google.cloud.security.privateca.v1.ICreateCertificateRequest): Promise; - - /** - * Calls GetCertificate. - * @param request GetCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Certificate - */ - public getCertificate(request: google.cloud.security.privateca.v1.IGetCertificateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateCallback): void; - - /** - * Calls GetCertificate. - * @param request GetCertificateRequest message or plain object - * @returns Promise - */ - public getCertificate(request: google.cloud.security.privateca.v1.IGetCertificateRequest): Promise; - - /** - * Calls ListCertificates. - * @param request ListCertificatesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCertificatesResponse - */ - public listCertificates(request: google.cloud.security.privateca.v1.IListCertificatesRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificatesCallback): void; - - /** - * Calls ListCertificates. - * @param request ListCertificatesRequest message or plain object - * @returns Promise - */ - public listCertificates(request: google.cloud.security.privateca.v1.IListCertificatesRequest): Promise; - - /** - * Calls RevokeCertificate. - * @param request RevokeCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Certificate - */ - public revokeCertificate(request: google.cloud.security.privateca.v1.IRevokeCertificateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificateCallback): void; - - /** - * Calls RevokeCertificate. - * @param request RevokeCertificateRequest message or plain object - * @returns Promise - */ - public revokeCertificate(request: google.cloud.security.privateca.v1.IRevokeCertificateRequest): Promise; - - /** - * Calls UpdateCertificate. - * @param request UpdateCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Certificate - */ - public updateCertificate(request: google.cloud.security.privateca.v1.IUpdateCertificateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateCallback): void; - - /** - * Calls UpdateCertificate. - * @param request UpdateCertificateRequest message or plain object - * @returns Promise - */ - public updateCertificate(request: google.cloud.security.privateca.v1.IUpdateCertificateRequest): Promise; - - /** - * Calls ActivateCertificateAuthority. - * @param request ActivateCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public activateCertificateAuthority(request: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthorityCallback): void; - - /** - * Calls ActivateCertificateAuthority. - * @param request ActivateCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public activateCertificateAuthority(request: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest): Promise; - - /** - * Calls CreateCertificateAuthority. - * @param request CreateCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createCertificateAuthority(request: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthorityCallback): void; - - /** - * Calls CreateCertificateAuthority. - * @param request CreateCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public createCertificateAuthority(request: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest): Promise; - - /** - * Calls DisableCertificateAuthority. - * @param request DisableCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public disableCertificateAuthority(request: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthorityCallback): void; - - /** - * Calls DisableCertificateAuthority. - * @param request DisableCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public disableCertificateAuthority(request: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest): Promise; - - /** - * Calls EnableCertificateAuthority. - * @param request EnableCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public enableCertificateAuthority(request: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthorityCallback): void; - - /** - * Calls EnableCertificateAuthority. - * @param request EnableCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public enableCertificateAuthority(request: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest): Promise; - - /** - * Calls FetchCertificateAuthorityCsr. - * @param request FetchCertificateAuthorityCsrRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchCertificateAuthorityCsrResponse - */ - public fetchCertificateAuthorityCsr(request: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsrCallback): void; - - /** - * Calls FetchCertificateAuthorityCsr. - * @param request FetchCertificateAuthorityCsrRequest message or plain object - * @returns Promise - */ - public fetchCertificateAuthorityCsr(request: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest): Promise; - - /** - * Calls GetCertificateAuthority. - * @param request GetCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CertificateAuthority - */ - public getCertificateAuthority(request: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthorityCallback): void; - - /** - * Calls GetCertificateAuthority. - * @param request GetCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public getCertificateAuthority(request: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest): Promise; - - /** - * Calls ListCertificateAuthorities. - * @param request ListCertificateAuthoritiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCertificateAuthoritiesResponse - */ - public listCertificateAuthorities(request: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthoritiesCallback): void; - - /** - * Calls ListCertificateAuthorities. - * @param request ListCertificateAuthoritiesRequest message or plain object - * @returns Promise - */ - public listCertificateAuthorities(request: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest): Promise; - - /** - * Calls UndeleteCertificateAuthority. - * @param request UndeleteCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public undeleteCertificateAuthority(request: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthorityCallback): void; - - /** - * Calls UndeleteCertificateAuthority. - * @param request UndeleteCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public undeleteCertificateAuthority(request: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest): Promise; - - /** - * Calls DeleteCertificateAuthority. - * @param request DeleteCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteCertificateAuthority(request: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthorityCallback): void; - - /** - * Calls DeleteCertificateAuthority. - * @param request DeleteCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public deleteCertificateAuthority(request: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest): Promise; - - /** - * Calls UpdateCertificateAuthority. - * @param request UpdateCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateCertificateAuthority(request: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthorityCallback): void; - - /** - * Calls UpdateCertificateAuthority. - * @param request UpdateCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public updateCertificateAuthority(request: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest): Promise; - - /** - * Calls CreateCaPool. - * @param request CreateCaPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createCaPool(request: google.cloud.security.privateca.v1.ICreateCaPoolRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPoolCallback): void; - - /** - * Calls CreateCaPool. - * @param request CreateCaPoolRequest message or plain object - * @returns Promise - */ - public createCaPool(request: google.cloud.security.privateca.v1.ICreateCaPoolRequest): Promise; - - /** - * Calls UpdateCaPool. - * @param request UpdateCaPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateCaPool(request: google.cloud.security.privateca.v1.IUpdateCaPoolRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPoolCallback): void; - - /** - * Calls UpdateCaPool. - * @param request UpdateCaPoolRequest message or plain object - * @returns Promise - */ - public updateCaPool(request: google.cloud.security.privateca.v1.IUpdateCaPoolRequest): Promise; - - /** - * Calls GetCaPool. - * @param request GetCaPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CaPool - */ - public getCaPool(request: google.cloud.security.privateca.v1.IGetCaPoolRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPoolCallback): void; - - /** - * Calls GetCaPool. - * @param request GetCaPoolRequest message or plain object - * @returns Promise - */ - public getCaPool(request: google.cloud.security.privateca.v1.IGetCaPoolRequest): Promise; - - /** - * Calls ListCaPools. - * @param request ListCaPoolsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCaPoolsResponse - */ - public listCaPools(request: google.cloud.security.privateca.v1.IListCaPoolsRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPoolsCallback): void; - - /** - * Calls ListCaPools. - * @param request ListCaPoolsRequest message or plain object - * @returns Promise - */ - public listCaPools(request: google.cloud.security.privateca.v1.IListCaPoolsRequest): Promise; - - /** - * Calls DeleteCaPool. - * @param request DeleteCaPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteCaPool(request: google.cloud.security.privateca.v1.IDeleteCaPoolRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPoolCallback): void; - - /** - * Calls DeleteCaPool. - * @param request DeleteCaPoolRequest message or plain object - * @returns Promise - */ - public deleteCaPool(request: google.cloud.security.privateca.v1.IDeleteCaPoolRequest): Promise; - - /** - * Calls FetchCaCerts. - * @param request FetchCaCertsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchCaCertsResponse - */ - public fetchCaCerts(request: google.cloud.security.privateca.v1.IFetchCaCertsRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCertsCallback): void; - - /** - * Calls FetchCaCerts. - * @param request FetchCaCertsRequest message or plain object - * @returns Promise - */ - public fetchCaCerts(request: google.cloud.security.privateca.v1.IFetchCaCertsRequest): Promise; - - /** - * Calls GetCertificateRevocationList. - * @param request GetCertificateRevocationListRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CertificateRevocationList - */ - public getCertificateRevocationList(request: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationListCallback): void; - - /** - * Calls GetCertificateRevocationList. - * @param request GetCertificateRevocationListRequest message or plain object - * @returns Promise - */ - public getCertificateRevocationList(request: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest): Promise; - - /** - * Calls ListCertificateRevocationLists. - * @param request ListCertificateRevocationListsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCertificateRevocationListsResponse - */ - public listCertificateRevocationLists(request: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationListsCallback): void; - - /** - * Calls ListCertificateRevocationLists. - * @param request ListCertificateRevocationListsRequest message or plain object - * @returns Promise - */ - public listCertificateRevocationLists(request: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest): Promise; - - /** - * Calls UpdateCertificateRevocationList. - * @param request UpdateCertificateRevocationListRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateCertificateRevocationList(request: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationListCallback): void; - - /** - * Calls UpdateCertificateRevocationList. - * @param request UpdateCertificateRevocationListRequest message or plain object - * @returns Promise - */ - public updateCertificateRevocationList(request: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest): Promise; - - /** - * Calls CreateCertificateTemplate. - * @param request CreateCertificateTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createCertificateTemplate(request: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplateCallback): void; - - /** - * Calls CreateCertificateTemplate. - * @param request CreateCertificateTemplateRequest message or plain object - * @returns Promise - */ - public createCertificateTemplate(request: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest): Promise; - - /** - * Calls DeleteCertificateTemplate. - * @param request DeleteCertificateTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteCertificateTemplate(request: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplateCallback): void; - - /** - * Calls DeleteCertificateTemplate. - * @param request DeleteCertificateTemplateRequest message or plain object - * @returns Promise - */ - public deleteCertificateTemplate(request: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest): Promise; - - /** - * Calls GetCertificateTemplate. - * @param request GetCertificateTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CertificateTemplate - */ - public getCertificateTemplate(request: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplateCallback): void; - - /** - * Calls GetCertificateTemplate. - * @param request GetCertificateTemplateRequest message or plain object - * @returns Promise - */ - public getCertificateTemplate(request: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest): Promise; - - /** - * Calls ListCertificateTemplates. - * @param request ListCertificateTemplatesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCertificateTemplatesResponse - */ - public listCertificateTemplates(request: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplatesCallback): void; - - /** - * Calls ListCertificateTemplates. - * @param request ListCertificateTemplatesRequest message or plain object - * @returns Promise - */ - public listCertificateTemplates(request: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest): Promise; - - /** - * Calls UpdateCertificateTemplate. - * @param request UpdateCertificateTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateCertificateTemplate(request: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, callback: google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplateCallback): void; - - /** - * Calls UpdateCertificateTemplate. - * @param request UpdateCertificateTemplateRequest message or plain object - * @returns Promise - */ - public updateCertificateTemplate(request: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest): Promise; - } - - namespace CertificateAuthorityService { - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificate}. - * @param error Error, if any - * @param [response] Certificate - */ - type CreateCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.Certificate) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificate}. - * @param error Error, if any - * @param [response] Certificate - */ - type GetCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.Certificate) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificates}. - * @param error Error, if any - * @param [response] ListCertificatesResponse - */ - type ListCertificatesCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.ListCertificatesResponse) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|revokeCertificate}. - * @param error Error, if any - * @param [response] Certificate - */ - type RevokeCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.Certificate) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificate}. - * @param error Error, if any - * @param [response] Certificate - */ - type UpdateCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.Certificate) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|activateCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type ActivateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|disableCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type DisableCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|enableCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type EnableCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|fetchCertificateAuthorityCsr}. - * @param error Error, if any - * @param [response] FetchCertificateAuthorityCsrResponse - */ - type FetchCertificateAuthorityCsrCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateAuthority}. - * @param error Error, if any - * @param [response] CertificateAuthority - */ - type GetCertificateAuthorityCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.CertificateAuthority) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateAuthorities}. - * @param error Error, if any - * @param [response] ListCertificateAuthoritiesResponse - */ - type ListCertificateAuthoritiesCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|undeleteCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type UndeleteCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCaPool}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateCaPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCaPool}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateCaPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCaPool}. - * @param error Error, if any - * @param [response] CaPool - */ - type GetCaPoolCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.CaPool) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCaPools}. - * @param error Error, if any - * @param [response] ListCaPoolsResponse - */ - type ListCaPoolsCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.ListCaPoolsResponse) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCaPool}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteCaPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|fetchCaCerts}. - * @param error Error, if any - * @param [response] FetchCaCertsResponse - */ - type FetchCaCertsCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.FetchCaCertsResponse) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateRevocationList}. - * @param error Error, if any - * @param [response] CertificateRevocationList - */ - type GetCertificateRevocationListCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.CertificateRevocationList) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateRevocationLists}. - * @param error Error, if any - * @param [response] ListCertificateRevocationListsResponse - */ - type ListCertificateRevocationListsCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateRevocationList}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateCertificateRevocationListCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificateTemplate}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateCertificateTemplateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCertificateTemplate}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteCertificateTemplateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateTemplate}. - * @param error Error, if any - * @param [response] CertificateTemplate - */ - type GetCertificateTemplateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.CertificateTemplate) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateTemplates}. - * @param error Error, if any - * @param [response] ListCertificateTemplatesResponse - */ - type ListCertificateTemplatesCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1.ListCertificateTemplatesResponse) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateTemplate}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateCertificateTemplateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a CreateCertificateRequest. */ - interface ICreateCertificateRequest { - - /** CreateCertificateRequest parent */ - parent?: (string|null); - - /** CreateCertificateRequest certificateId */ - certificateId?: (string|null); - - /** CreateCertificateRequest certificate */ - certificate?: (google.cloud.security.privateca.v1.ICertificate|null); - - /** CreateCertificateRequest requestId */ - requestId?: (string|null); - - /** CreateCertificateRequest validateOnly */ - validateOnly?: (boolean|null); - - /** CreateCertificateRequest issuingCertificateAuthorityId */ - issuingCertificateAuthorityId?: (string|null); - } - - /** Represents a CreateCertificateRequest. */ - class CreateCertificateRequest implements ICreateCertificateRequest { - - /** - * Constructs a new CreateCertificateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICreateCertificateRequest); - - /** CreateCertificateRequest parent. */ - public parent: string; - - /** CreateCertificateRequest certificateId. */ - public certificateId: string; - - /** CreateCertificateRequest certificate. */ - public certificate?: (google.cloud.security.privateca.v1.ICertificate|null); - - /** CreateCertificateRequest requestId. */ - public requestId: string; - - /** CreateCertificateRequest validateOnly. */ - public validateOnly: boolean; - - /** CreateCertificateRequest issuingCertificateAuthorityId. */ - public issuingCertificateAuthorityId: string; - - /** - * Creates a new CreateCertificateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCertificateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICreateCertificateRequest): google.cloud.security.privateca.v1.CreateCertificateRequest; - - /** - * Encodes the specified CreateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateRequest.verify|verify} messages. - * @param message CreateCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICreateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateRequest.verify|verify} messages. - * @param message CreateCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICreateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCertificateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCertificateRequest - * @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.security.privateca.v1.CreateCertificateRequest; - - /** - * Decodes a CreateCertificateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCertificateRequest - * @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.security.privateca.v1.CreateCertificateRequest; - - /** - * Verifies a CreateCertificateRequest 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 CreateCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCertificateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CreateCertificateRequest; - - /** - * Creates a plain object from a CreateCertificateRequest message. Also converts values to other types if specified. - * @param message CreateCertificateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CreateCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCertificateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCertificateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCertificateRequest. */ - interface IGetCertificateRequest { - - /** GetCertificateRequest name */ - name?: (string|null); - } - - /** Represents a GetCertificateRequest. */ - class GetCertificateRequest implements IGetCertificateRequest { - - /** - * Constructs a new GetCertificateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IGetCertificateRequest); - - /** GetCertificateRequest name. */ - public name: string; - - /** - * Creates a new GetCertificateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCertificateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IGetCertificateRequest): google.cloud.security.privateca.v1.GetCertificateRequest; - - /** - * Encodes the specified GetCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRequest.verify|verify} messages. - * @param message GetCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IGetCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRequest.verify|verify} messages. - * @param message GetCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IGetCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCertificateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCertificateRequest - * @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.security.privateca.v1.GetCertificateRequest; - - /** - * Decodes a GetCertificateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCertificateRequest - * @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.security.privateca.v1.GetCertificateRequest; - - /** - * Verifies a GetCertificateRequest 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 GetCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCertificateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.GetCertificateRequest; - - /** - * Creates a plain object from a GetCertificateRequest message. Also converts values to other types if specified. - * @param message GetCertificateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.GetCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCertificateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCertificateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificatesRequest. */ - interface IListCertificatesRequest { - - /** ListCertificatesRequest parent */ - parent?: (string|null); - - /** ListCertificatesRequest pageSize */ - pageSize?: (number|null); - - /** ListCertificatesRequest pageToken */ - pageToken?: (string|null); - - /** ListCertificatesRequest filter */ - filter?: (string|null); - - /** ListCertificatesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListCertificatesRequest. */ - class ListCertificatesRequest implements IListCertificatesRequest { - - /** - * Constructs a new ListCertificatesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IListCertificatesRequest); - - /** ListCertificatesRequest parent. */ - public parent: string; - - /** ListCertificatesRequest pageSize. */ - public pageSize: number; - - /** ListCertificatesRequest pageToken. */ - public pageToken: string; - - /** ListCertificatesRequest filter. */ - public filter: string; - - /** ListCertificatesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListCertificatesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificatesRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IListCertificatesRequest): google.cloud.security.privateca.v1.ListCertificatesRequest; - - /** - * Encodes the specified ListCertificatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesRequest.verify|verify} messages. - * @param message ListCertificatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IListCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesRequest.verify|verify} messages. - * @param message ListCertificatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificatesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificatesRequest - * @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.security.privateca.v1.ListCertificatesRequest; - - /** - * Decodes a ListCertificatesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificatesRequest - * @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.security.privateca.v1.ListCertificatesRequest; - - /** - * Verifies a ListCertificatesRequest 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 ListCertificatesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificatesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificatesRequest; - - /** - * Creates a plain object from a ListCertificatesRequest message. Also converts values to other types if specified. - * @param message ListCertificatesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ListCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificatesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificatesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificatesResponse. */ - interface IListCertificatesResponse { - - /** ListCertificatesResponse certificates */ - certificates?: (google.cloud.security.privateca.v1.ICertificate[]|null); - - /** ListCertificatesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListCertificatesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListCertificatesResponse. */ - class ListCertificatesResponse implements IListCertificatesResponse { - - /** - * Constructs a new ListCertificatesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IListCertificatesResponse); - - /** ListCertificatesResponse certificates. */ - public certificates: google.cloud.security.privateca.v1.ICertificate[]; - - /** ListCertificatesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListCertificatesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListCertificatesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificatesResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IListCertificatesResponse): google.cloud.security.privateca.v1.ListCertificatesResponse; - - /** - * Encodes the specified ListCertificatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesResponse.verify|verify} messages. - * @param message ListCertificatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IListCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesResponse.verify|verify} messages. - * @param message ListCertificatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificatesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificatesResponse - * @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.security.privateca.v1.ListCertificatesResponse; - - /** - * Decodes a ListCertificatesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificatesResponse - * @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.security.privateca.v1.ListCertificatesResponse; - - /** - * Verifies a ListCertificatesResponse 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 ListCertificatesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificatesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificatesResponse; - - /** - * Creates a plain object from a ListCertificatesResponse message. Also converts values to other types if specified. - * @param message ListCertificatesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ListCertificatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificatesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificatesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RevokeCertificateRequest. */ - interface IRevokeCertificateRequest { - - /** RevokeCertificateRequest name */ - name?: (string|null); - - /** RevokeCertificateRequest reason */ - reason?: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason|null); - - /** RevokeCertificateRequest requestId */ - requestId?: (string|null); - } - - /** Represents a RevokeCertificateRequest. */ - class RevokeCertificateRequest implements IRevokeCertificateRequest { - - /** - * Constructs a new RevokeCertificateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IRevokeCertificateRequest); - - /** RevokeCertificateRequest name. */ - public name: string; - - /** RevokeCertificateRequest reason. */ - public reason: (google.cloud.security.privateca.v1.RevocationReason|keyof typeof google.cloud.security.privateca.v1.RevocationReason); - - /** RevokeCertificateRequest requestId. */ - public requestId: string; - - /** - * Creates a new RevokeCertificateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RevokeCertificateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IRevokeCertificateRequest): google.cloud.security.privateca.v1.RevokeCertificateRequest; - - /** - * Encodes the specified RevokeCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.RevokeCertificateRequest.verify|verify} messages. - * @param message RevokeCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IRevokeCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevokeCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.RevokeCertificateRequest.verify|verify} messages. - * @param message RevokeCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IRevokeCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevokeCertificateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevokeCertificateRequest - * @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.security.privateca.v1.RevokeCertificateRequest; - - /** - * Decodes a RevokeCertificateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevokeCertificateRequest - * @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.security.privateca.v1.RevokeCertificateRequest; - - /** - * Verifies a RevokeCertificateRequest 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 RevokeCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevokeCertificateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.RevokeCertificateRequest; - - /** - * Creates a plain object from a RevokeCertificateRequest message. Also converts values to other types if specified. - * @param message RevokeCertificateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.RevokeCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevokeCertificateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevokeCertificateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCertificateRequest. */ - interface IUpdateCertificateRequest { - - /** UpdateCertificateRequest certificate */ - certificate?: (google.cloud.security.privateca.v1.ICertificate|null); - - /** UpdateCertificateRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateCertificateRequest. */ - class UpdateCertificateRequest implements IUpdateCertificateRequest { - - /** - * Constructs a new UpdateCertificateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IUpdateCertificateRequest); - - /** UpdateCertificateRequest certificate. */ - public certificate?: (google.cloud.security.privateca.v1.ICertificate|null); - - /** UpdateCertificateRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateCertificateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCertificateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IUpdateCertificateRequest): google.cloud.security.privateca.v1.UpdateCertificateRequest; - - /** - * Encodes the specified UpdateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRequest.verify|verify} messages. - * @param message UpdateCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IUpdateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRequest.verify|verify} messages. - * @param message UpdateCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IUpdateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCertificateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCertificateRequest - * @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.security.privateca.v1.UpdateCertificateRequest; - - /** - * Decodes an UpdateCertificateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCertificateRequest - * @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.security.privateca.v1.UpdateCertificateRequest; - - /** - * Verifies an UpdateCertificateRequest 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 UpdateCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCertificateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UpdateCertificateRequest; - - /** - * Creates a plain object from an UpdateCertificateRequest message. Also converts values to other types if specified. - * @param message UpdateCertificateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.UpdateCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCertificateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCertificateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ActivateCertificateAuthorityRequest. */ - interface IActivateCertificateAuthorityRequest { - - /** ActivateCertificateAuthorityRequest name */ - name?: (string|null); - - /** ActivateCertificateAuthorityRequest pemCaCertificate */ - pemCaCertificate?: (string|null); - - /** ActivateCertificateAuthorityRequest subordinateConfig */ - subordinateConfig?: (google.cloud.security.privateca.v1.ISubordinateConfig|null); - - /** ActivateCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents an ActivateCertificateAuthorityRequest. */ - class ActivateCertificateAuthorityRequest implements IActivateCertificateAuthorityRequest { - - /** - * Constructs a new ActivateCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest); - - /** ActivateCertificateAuthorityRequest name. */ - public name: string; - - /** ActivateCertificateAuthorityRequest pemCaCertificate. */ - public pemCaCertificate: string; - - /** ActivateCertificateAuthorityRequest subordinateConfig. */ - public subordinateConfig?: (google.cloud.security.privateca.v1.ISubordinateConfig|null); - - /** ActivateCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new ActivateCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ActivateCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest): google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest; - - /** - * Encodes the specified ActivateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest.verify|verify} messages. - * @param message ActivateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ActivateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest.verify|verify} messages. - * @param message ActivateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ActivateCertificateAuthorityRequest - * @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.security.privateca.v1.ActivateCertificateAuthorityRequest; - - /** - * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ActivateCertificateAuthorityRequest - * @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.security.privateca.v1.ActivateCertificateAuthorityRequest; - - /** - * Verifies an ActivateCertificateAuthorityRequest 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 ActivateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ActivateCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest; - - /** - * Creates a plain object from an ActivateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message ActivateCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ActivateCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ActivateCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateCertificateAuthorityRequest. */ - interface ICreateCertificateAuthorityRequest { - - /** CreateCertificateAuthorityRequest parent */ - parent?: (string|null); - - /** CreateCertificateAuthorityRequest certificateAuthorityId */ - certificateAuthorityId?: (string|null); - - /** CreateCertificateAuthorityRequest certificateAuthority */ - certificateAuthority?: (google.cloud.security.privateca.v1.ICertificateAuthority|null); - - /** CreateCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateCertificateAuthorityRequest. */ - class CreateCertificateAuthorityRequest implements ICreateCertificateAuthorityRequest { - - /** - * Constructs a new CreateCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest); - - /** CreateCertificateAuthorityRequest parent. */ - public parent: string; - - /** CreateCertificateAuthorityRequest certificateAuthorityId. */ - public certificateAuthorityId: string; - - /** CreateCertificateAuthorityRequest certificateAuthority. */ - public certificateAuthority?: (google.cloud.security.privateca.v1.ICertificateAuthority|null); - - /** CreateCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest): google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest; - - /** - * Encodes the specified CreateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest.verify|verify} messages. - * @param message CreateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest.verify|verify} messages. - * @param message CreateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCertificateAuthorityRequest - * @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.security.privateca.v1.CreateCertificateAuthorityRequest; - - /** - * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCertificateAuthorityRequest - * @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.security.privateca.v1.CreateCertificateAuthorityRequest; - - /** - * Verifies a CreateCertificateAuthorityRequest 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 CreateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest; - - /** - * Creates a plain object from a CreateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message CreateCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisableCertificateAuthorityRequest. */ - interface IDisableCertificateAuthorityRequest { - - /** DisableCertificateAuthorityRequest name */ - name?: (string|null); - - /** DisableCertificateAuthorityRequest requestId */ - requestId?: (string|null); - - /** DisableCertificateAuthorityRequest ignoreDependentResources */ - ignoreDependentResources?: (boolean|null); - } - - /** Represents a DisableCertificateAuthorityRequest. */ - class DisableCertificateAuthorityRequest implements IDisableCertificateAuthorityRequest { - - /** - * Constructs a new DisableCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest); - - /** DisableCertificateAuthorityRequest name. */ - public name: string; - - /** DisableCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** DisableCertificateAuthorityRequest ignoreDependentResources. */ - public ignoreDependentResources: boolean; - - /** - * Creates a new DisableCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DisableCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest): google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest; - - /** - * Encodes the specified DisableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest.verify|verify} messages. - * @param message DisableCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest.verify|verify} messages. - * @param message DisableCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisableCertificateAuthorityRequest - * @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.security.privateca.v1.DisableCertificateAuthorityRequest; - - /** - * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisableCertificateAuthorityRequest - * @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.security.privateca.v1.DisableCertificateAuthorityRequest; - - /** - * Verifies a DisableCertificateAuthorityRequest 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 DisableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisableCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest; - - /** - * Creates a plain object from a DisableCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message DisableCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisableCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisableCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnableCertificateAuthorityRequest. */ - interface IEnableCertificateAuthorityRequest { - - /** EnableCertificateAuthorityRequest name */ - name?: (string|null); - - /** EnableCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents an EnableCertificateAuthorityRequest. */ - class EnableCertificateAuthorityRequest implements IEnableCertificateAuthorityRequest { - - /** - * Constructs a new EnableCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest); - - /** EnableCertificateAuthorityRequest name. */ - public name: string; - - /** EnableCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new EnableCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns EnableCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest): google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest; - - /** - * Encodes the specified EnableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest.verify|verify} messages. - * @param message EnableCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest.verify|verify} messages. - * @param message EnableCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnableCertificateAuthorityRequest - * @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.security.privateca.v1.EnableCertificateAuthorityRequest; - - /** - * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnableCertificateAuthorityRequest - * @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.security.privateca.v1.EnableCertificateAuthorityRequest; - - /** - * Verifies an EnableCertificateAuthorityRequest 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 EnableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnableCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest; - - /** - * Creates a plain object from an EnableCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message EnableCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnableCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnableCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchCertificateAuthorityCsrRequest. */ - interface IFetchCertificateAuthorityCsrRequest { - - /** FetchCertificateAuthorityCsrRequest name */ - name?: (string|null); - } - - /** Represents a FetchCertificateAuthorityCsrRequest. */ - class FetchCertificateAuthorityCsrRequest implements IFetchCertificateAuthorityCsrRequest { - - /** - * Constructs a new FetchCertificateAuthorityCsrRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest); - - /** FetchCertificateAuthorityCsrRequest name. */ - public name: string; - - /** - * Creates a new FetchCertificateAuthorityCsrRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchCertificateAuthorityCsrRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest): google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest; - - /** - * Encodes the specified FetchCertificateAuthorityCsrRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. - * @param message FetchCertificateAuthorityCsrRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchCertificateAuthorityCsrRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. - * @param message FetchCertificateAuthorityCsrRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchCertificateAuthorityCsrRequest - * @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.security.privateca.v1.FetchCertificateAuthorityCsrRequest; - - /** - * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchCertificateAuthorityCsrRequest - * @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.security.privateca.v1.FetchCertificateAuthorityCsrRequest; - - /** - * Verifies a FetchCertificateAuthorityCsrRequest 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 FetchCertificateAuthorityCsrRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchCertificateAuthorityCsrRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest; - - /** - * Creates a plain object from a FetchCertificateAuthorityCsrRequest message. Also converts values to other types if specified. - * @param message FetchCertificateAuthorityCsrRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchCertificateAuthorityCsrRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchCertificateAuthorityCsrRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchCertificateAuthorityCsrResponse. */ - interface IFetchCertificateAuthorityCsrResponse { - - /** FetchCertificateAuthorityCsrResponse pemCsr */ - pemCsr?: (string|null); - } - - /** Represents a FetchCertificateAuthorityCsrResponse. */ - class FetchCertificateAuthorityCsrResponse implements IFetchCertificateAuthorityCsrResponse { - - /** - * Constructs a new FetchCertificateAuthorityCsrResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse); - - /** FetchCertificateAuthorityCsrResponse pemCsr. */ - public pemCsr: string; - - /** - * Creates a new FetchCertificateAuthorityCsrResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchCertificateAuthorityCsrResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse): google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse; - - /** - * Encodes the specified FetchCertificateAuthorityCsrResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. - * @param message FetchCertificateAuthorityCsrResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchCertificateAuthorityCsrResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. - * @param message FetchCertificateAuthorityCsrResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchCertificateAuthorityCsrResponse - * @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.security.privateca.v1.FetchCertificateAuthorityCsrResponse; - - /** - * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchCertificateAuthorityCsrResponse - * @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.security.privateca.v1.FetchCertificateAuthorityCsrResponse; - - /** - * Verifies a FetchCertificateAuthorityCsrResponse 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 FetchCertificateAuthorityCsrResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchCertificateAuthorityCsrResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse; - - /** - * Creates a plain object from a FetchCertificateAuthorityCsrResponse message. Also converts values to other types if specified. - * @param message FetchCertificateAuthorityCsrResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchCertificateAuthorityCsrResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchCertificateAuthorityCsrResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCertificateAuthorityRequest. */ - interface IGetCertificateAuthorityRequest { - - /** GetCertificateAuthorityRequest name */ - name?: (string|null); - } - - /** Represents a GetCertificateAuthorityRequest. */ - class GetCertificateAuthorityRequest implements IGetCertificateAuthorityRequest { - - /** - * Constructs a new GetCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest); - - /** GetCertificateAuthorityRequest name. */ - public name: string; - - /** - * Creates a new GetCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest): google.cloud.security.privateca.v1.GetCertificateAuthorityRequest; - - /** - * Encodes the specified GetCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateAuthorityRequest.verify|verify} messages. - * @param message GetCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateAuthorityRequest.verify|verify} messages. - * @param message GetCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCertificateAuthorityRequest - * @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.security.privateca.v1.GetCertificateAuthorityRequest; - - /** - * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCertificateAuthorityRequest - * @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.security.privateca.v1.GetCertificateAuthorityRequest; - - /** - * Verifies a GetCertificateAuthorityRequest 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 GetCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.GetCertificateAuthorityRequest; - - /** - * Creates a plain object from a GetCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message GetCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.GetCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificateAuthoritiesRequest. */ - interface IListCertificateAuthoritiesRequest { - - /** ListCertificateAuthoritiesRequest parent */ - parent?: (string|null); - - /** ListCertificateAuthoritiesRequest pageSize */ - pageSize?: (number|null); - - /** ListCertificateAuthoritiesRequest pageToken */ - pageToken?: (string|null); - - /** ListCertificateAuthoritiesRequest filter */ - filter?: (string|null); - - /** ListCertificateAuthoritiesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListCertificateAuthoritiesRequest. */ - class ListCertificateAuthoritiesRequest implements IListCertificateAuthoritiesRequest { - - /** - * Constructs a new ListCertificateAuthoritiesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest); - - /** ListCertificateAuthoritiesRequest parent. */ - public parent: string; - - /** ListCertificateAuthoritiesRequest pageSize. */ - public pageSize: number; - - /** ListCertificateAuthoritiesRequest pageToken. */ - public pageToken: string; - - /** ListCertificateAuthoritiesRequest filter. */ - public filter: string; - - /** ListCertificateAuthoritiesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListCertificateAuthoritiesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificateAuthoritiesRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest): google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest; - - /** - * Encodes the specified ListCertificateAuthoritiesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.verify|verify} messages. - * @param message ListCertificateAuthoritiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificateAuthoritiesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.verify|verify} messages. - * @param message ListCertificateAuthoritiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificateAuthoritiesRequest - * @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.security.privateca.v1.ListCertificateAuthoritiesRequest; - - /** - * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificateAuthoritiesRequest - * @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.security.privateca.v1.ListCertificateAuthoritiesRequest; - - /** - * Verifies a ListCertificateAuthoritiesRequest 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 ListCertificateAuthoritiesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificateAuthoritiesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest; - - /** - * Creates a plain object from a ListCertificateAuthoritiesRequest message. Also converts values to other types if specified. - * @param message ListCertificateAuthoritiesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificateAuthoritiesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificateAuthoritiesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificateAuthoritiesResponse. */ - interface IListCertificateAuthoritiesResponse { - - /** ListCertificateAuthoritiesResponse certificateAuthorities */ - certificateAuthorities?: (google.cloud.security.privateca.v1.ICertificateAuthority[]|null); - - /** ListCertificateAuthoritiesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListCertificateAuthoritiesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListCertificateAuthoritiesResponse. */ - class ListCertificateAuthoritiesResponse implements IListCertificateAuthoritiesResponse { - - /** - * Constructs a new ListCertificateAuthoritiesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse); - - /** ListCertificateAuthoritiesResponse certificateAuthorities. */ - public certificateAuthorities: google.cloud.security.privateca.v1.ICertificateAuthority[]; - - /** ListCertificateAuthoritiesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListCertificateAuthoritiesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListCertificateAuthoritiesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificateAuthoritiesResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse): google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse; - - /** - * Encodes the specified ListCertificateAuthoritiesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.verify|verify} messages. - * @param message ListCertificateAuthoritiesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificateAuthoritiesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.verify|verify} messages. - * @param message ListCertificateAuthoritiesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificateAuthoritiesResponse - * @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.security.privateca.v1.ListCertificateAuthoritiesResponse; - - /** - * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificateAuthoritiesResponse - * @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.security.privateca.v1.ListCertificateAuthoritiesResponse; - - /** - * Verifies a ListCertificateAuthoritiesResponse 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 ListCertificateAuthoritiesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificateAuthoritiesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse; - - /** - * Creates a plain object from a ListCertificateAuthoritiesResponse message. Also converts values to other types if specified. - * @param message ListCertificateAuthoritiesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificateAuthoritiesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificateAuthoritiesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UndeleteCertificateAuthorityRequest. */ - interface IUndeleteCertificateAuthorityRequest { - - /** UndeleteCertificateAuthorityRequest name */ - name?: (string|null); - - /** UndeleteCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UndeleteCertificateAuthorityRequest. */ - class UndeleteCertificateAuthorityRequest implements IUndeleteCertificateAuthorityRequest { - - /** - * Constructs a new UndeleteCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest); - - /** UndeleteCertificateAuthorityRequest name. */ - public name: string; - - /** UndeleteCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new UndeleteCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UndeleteCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest): google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest; - - /** - * Encodes the specified UndeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest.verify|verify} messages. - * @param message UndeleteCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UndeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest.verify|verify} messages. - * @param message UndeleteCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UndeleteCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UndeleteCertificateAuthorityRequest - * @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.security.privateca.v1.UndeleteCertificateAuthorityRequest; - - /** - * Decodes an UndeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UndeleteCertificateAuthorityRequest - * @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.security.privateca.v1.UndeleteCertificateAuthorityRequest; - - /** - * Verifies an UndeleteCertificateAuthorityRequest 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 UndeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UndeleteCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest; - - /** - * Creates a plain object from an UndeleteCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message UndeleteCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UndeleteCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UndeleteCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteCertificateAuthorityRequest. */ - interface IDeleteCertificateAuthorityRequest { - - /** DeleteCertificateAuthorityRequest name */ - name?: (string|null); - - /** DeleteCertificateAuthorityRequest requestId */ - requestId?: (string|null); - - /** DeleteCertificateAuthorityRequest ignoreActiveCertificates */ - ignoreActiveCertificates?: (boolean|null); - - /** DeleteCertificateAuthorityRequest skipGracePeriod */ - skipGracePeriod?: (boolean|null); - - /** DeleteCertificateAuthorityRequest ignoreDependentResources */ - ignoreDependentResources?: (boolean|null); - } - - /** Represents a DeleteCertificateAuthorityRequest. */ - class DeleteCertificateAuthorityRequest implements IDeleteCertificateAuthorityRequest { - - /** - * Constructs a new DeleteCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest); - - /** DeleteCertificateAuthorityRequest name. */ - public name: string; - - /** DeleteCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** DeleteCertificateAuthorityRequest ignoreActiveCertificates. */ - public ignoreActiveCertificates: boolean; - - /** DeleteCertificateAuthorityRequest skipGracePeriod. */ - public skipGracePeriod: boolean; - - /** DeleteCertificateAuthorityRequest ignoreDependentResources. */ - public ignoreDependentResources: boolean; - - /** - * Creates a new DeleteCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest): google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest; - - /** - * Encodes the specified DeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest.verify|verify} messages. - * @param message DeleteCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest.verify|verify} messages. - * @param message DeleteCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteCertificateAuthorityRequest - * @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.security.privateca.v1.DeleteCertificateAuthorityRequest; - - /** - * Decodes a DeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteCertificateAuthorityRequest - * @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.security.privateca.v1.DeleteCertificateAuthorityRequest; - - /** - * Verifies a DeleteCertificateAuthorityRequest 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 DeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest; - - /** - * Creates a plain object from a DeleteCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message DeleteCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCertificateAuthorityRequest. */ - interface IUpdateCertificateAuthorityRequest { - - /** UpdateCertificateAuthorityRequest certificateAuthority */ - certificateAuthority?: (google.cloud.security.privateca.v1.ICertificateAuthority|null); - - /** UpdateCertificateAuthorityRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateCertificateAuthorityRequest. */ - class UpdateCertificateAuthorityRequest implements IUpdateCertificateAuthorityRequest { - - /** - * Constructs a new UpdateCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest); - - /** UpdateCertificateAuthorityRequest certificateAuthority. */ - public certificateAuthority?: (google.cloud.security.privateca.v1.ICertificateAuthority|null); - - /** UpdateCertificateAuthorityRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest): google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest; - - /** - * Encodes the specified UpdateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.verify|verify} messages. - * @param message UpdateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.verify|verify} messages. - * @param message UpdateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCertificateAuthorityRequest - * @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.security.privateca.v1.UpdateCertificateAuthorityRequest; - - /** - * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCertificateAuthorityRequest - * @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.security.privateca.v1.UpdateCertificateAuthorityRequest; - - /** - * Verifies an UpdateCertificateAuthorityRequest 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 UpdateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest; - - /** - * Creates a plain object from an UpdateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message UpdateCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateCaPoolRequest. */ - interface ICreateCaPoolRequest { - - /** CreateCaPoolRequest parent */ - parent?: (string|null); - - /** CreateCaPoolRequest caPoolId */ - caPoolId?: (string|null); - - /** CreateCaPoolRequest caPool */ - caPool?: (google.cloud.security.privateca.v1.ICaPool|null); - - /** CreateCaPoolRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateCaPoolRequest. */ - class CreateCaPoolRequest implements ICreateCaPoolRequest { - - /** - * Constructs a new CreateCaPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICreateCaPoolRequest); - - /** CreateCaPoolRequest parent. */ - public parent: string; - - /** CreateCaPoolRequest caPoolId. */ - public caPoolId: string; - - /** CreateCaPoolRequest caPool. */ - public caPool?: (google.cloud.security.privateca.v1.ICaPool|null); - - /** CreateCaPoolRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateCaPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCaPoolRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICreateCaPoolRequest): google.cloud.security.privateca.v1.CreateCaPoolRequest; - - /** - * Encodes the specified CreateCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCaPoolRequest.verify|verify} messages. - * @param message CreateCaPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICreateCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCaPoolRequest.verify|verify} messages. - * @param message CreateCaPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICreateCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCaPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCaPoolRequest - * @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.security.privateca.v1.CreateCaPoolRequest; - - /** - * Decodes a CreateCaPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCaPoolRequest - * @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.security.privateca.v1.CreateCaPoolRequest; - - /** - * Verifies a CreateCaPoolRequest 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 CreateCaPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCaPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CreateCaPoolRequest; - - /** - * Creates a plain object from a CreateCaPoolRequest message. Also converts values to other types if specified. - * @param message CreateCaPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CreateCaPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCaPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCaPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCaPoolRequest. */ - interface IUpdateCaPoolRequest { - - /** UpdateCaPoolRequest caPool */ - caPool?: (google.cloud.security.privateca.v1.ICaPool|null); - - /** UpdateCaPoolRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCaPoolRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateCaPoolRequest. */ - class UpdateCaPoolRequest implements IUpdateCaPoolRequest { - - /** - * Constructs a new UpdateCaPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IUpdateCaPoolRequest); - - /** UpdateCaPoolRequest caPool. */ - public caPool?: (google.cloud.security.privateca.v1.ICaPool|null); - - /** UpdateCaPoolRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCaPoolRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateCaPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCaPoolRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IUpdateCaPoolRequest): google.cloud.security.privateca.v1.UpdateCaPoolRequest; - - /** - * Encodes the specified UpdateCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCaPoolRequest.verify|verify} messages. - * @param message UpdateCaPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IUpdateCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCaPoolRequest.verify|verify} messages. - * @param message UpdateCaPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IUpdateCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCaPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCaPoolRequest - * @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.security.privateca.v1.UpdateCaPoolRequest; - - /** - * Decodes an UpdateCaPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCaPoolRequest - * @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.security.privateca.v1.UpdateCaPoolRequest; - - /** - * Verifies an UpdateCaPoolRequest 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 UpdateCaPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCaPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UpdateCaPoolRequest; - - /** - * Creates a plain object from an UpdateCaPoolRequest message. Also converts values to other types if specified. - * @param message UpdateCaPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.UpdateCaPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCaPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCaPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteCaPoolRequest. */ - interface IDeleteCaPoolRequest { - - /** DeleteCaPoolRequest name */ - name?: (string|null); - - /** DeleteCaPoolRequest requestId */ - requestId?: (string|null); - - /** DeleteCaPoolRequest ignoreDependentResources */ - ignoreDependentResources?: (boolean|null); - } - - /** Represents a DeleteCaPoolRequest. */ - class DeleteCaPoolRequest implements IDeleteCaPoolRequest { - - /** - * Constructs a new DeleteCaPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IDeleteCaPoolRequest); - - /** DeleteCaPoolRequest name. */ - public name: string; - - /** DeleteCaPoolRequest requestId. */ - public requestId: string; - - /** DeleteCaPoolRequest ignoreDependentResources. */ - public ignoreDependentResources: boolean; - - /** - * Creates a new DeleteCaPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteCaPoolRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IDeleteCaPoolRequest): google.cloud.security.privateca.v1.DeleteCaPoolRequest; - - /** - * Encodes the specified DeleteCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCaPoolRequest.verify|verify} messages. - * @param message DeleteCaPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IDeleteCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCaPoolRequest.verify|verify} messages. - * @param message DeleteCaPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IDeleteCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteCaPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteCaPoolRequest - * @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.security.privateca.v1.DeleteCaPoolRequest; - - /** - * Decodes a DeleteCaPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteCaPoolRequest - * @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.security.privateca.v1.DeleteCaPoolRequest; - - /** - * Verifies a DeleteCaPoolRequest 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 DeleteCaPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteCaPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.DeleteCaPoolRequest; - - /** - * Creates a plain object from a DeleteCaPoolRequest message. Also converts values to other types if specified. - * @param message DeleteCaPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.DeleteCaPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteCaPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteCaPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchCaCertsRequest. */ - interface IFetchCaCertsRequest { - - /** FetchCaCertsRequest caPool */ - caPool?: (string|null); - - /** FetchCaCertsRequest requestId */ - requestId?: (string|null); - } - - /** Represents a FetchCaCertsRequest. */ - class FetchCaCertsRequest implements IFetchCaCertsRequest { - - /** - * Constructs a new FetchCaCertsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IFetchCaCertsRequest); - - /** FetchCaCertsRequest caPool. */ - public caPool: string; - - /** FetchCaCertsRequest requestId. */ - public requestId: string; - - /** - * Creates a new FetchCaCertsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchCaCertsRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IFetchCaCertsRequest): google.cloud.security.privateca.v1.FetchCaCertsRequest; - - /** - * Encodes the specified FetchCaCertsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsRequest.verify|verify} messages. - * @param message FetchCaCertsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IFetchCaCertsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchCaCertsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsRequest.verify|verify} messages. - * @param message FetchCaCertsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IFetchCaCertsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchCaCertsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchCaCertsRequest - * @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.security.privateca.v1.FetchCaCertsRequest; - - /** - * Decodes a FetchCaCertsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchCaCertsRequest - * @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.security.privateca.v1.FetchCaCertsRequest; - - /** - * Verifies a FetchCaCertsRequest 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 FetchCaCertsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchCaCertsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.FetchCaCertsRequest; - - /** - * Creates a plain object from a FetchCaCertsRequest message. Also converts values to other types if specified. - * @param message FetchCaCertsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.FetchCaCertsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchCaCertsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchCaCertsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchCaCertsResponse. */ - interface IFetchCaCertsResponse { - - /** FetchCaCertsResponse caCerts */ - caCerts?: (google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain[]|null); - } - - /** Represents a FetchCaCertsResponse. */ - class FetchCaCertsResponse implements IFetchCaCertsResponse { - - /** - * Constructs a new FetchCaCertsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IFetchCaCertsResponse); - - /** FetchCaCertsResponse caCerts. */ - public caCerts: google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain[]; - - /** - * Creates a new FetchCaCertsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchCaCertsResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IFetchCaCertsResponse): google.cloud.security.privateca.v1.FetchCaCertsResponse; - - /** - * Encodes the specified FetchCaCertsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.verify|verify} messages. - * @param message FetchCaCertsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IFetchCaCertsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchCaCertsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.verify|verify} messages. - * @param message FetchCaCertsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IFetchCaCertsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchCaCertsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchCaCertsResponse - * @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.security.privateca.v1.FetchCaCertsResponse; - - /** - * Decodes a FetchCaCertsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchCaCertsResponse - * @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.security.privateca.v1.FetchCaCertsResponse; - - /** - * Verifies a FetchCaCertsResponse 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 FetchCaCertsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchCaCertsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.FetchCaCertsResponse; - - /** - * Creates a plain object from a FetchCaCertsResponse message. Also converts values to other types if specified. - * @param message FetchCaCertsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.FetchCaCertsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchCaCertsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchCaCertsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FetchCaCertsResponse { - - /** Properties of a CertChain. */ - interface ICertChain { - - /** CertChain certificates */ - certificates?: (string[]|null); - } - - /** Represents a CertChain. */ - class CertChain implements ICertChain { - - /** - * Constructs a new CertChain. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain); - - /** CertChain certificates. */ - public certificates: string[]; - - /** - * Creates a new CertChain instance using the specified properties. - * @param [properties] Properties to set - * @returns CertChain instance - */ - public static create(properties?: google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain): google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain; - - /** - * Encodes the specified CertChain message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.verify|verify} messages. - * @param message CertChain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.verify|verify} messages. - * @param message CertChain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertChain message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertChain - * @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.security.privateca.v1.FetchCaCertsResponse.CertChain; - - /** - * Decodes a CertChain message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertChain - * @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.security.privateca.v1.FetchCaCertsResponse.CertChain; - - /** - * Verifies a CertChain 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 CertChain message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertChain - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain; - - /** - * Creates a plain object from a CertChain message. Also converts values to other types if specified. - * @param message CertChain - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertChain to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertChain - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GetCaPoolRequest. */ - interface IGetCaPoolRequest { - - /** GetCaPoolRequest name */ - name?: (string|null); - } - - /** Represents a GetCaPoolRequest. */ - class GetCaPoolRequest implements IGetCaPoolRequest { - - /** - * Constructs a new GetCaPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IGetCaPoolRequest); - - /** GetCaPoolRequest name. */ - public name: string; - - /** - * Creates a new GetCaPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCaPoolRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IGetCaPoolRequest): google.cloud.security.privateca.v1.GetCaPoolRequest; - - /** - * Encodes the specified GetCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCaPoolRequest.verify|verify} messages. - * @param message GetCaPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IGetCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCaPoolRequest.verify|verify} messages. - * @param message GetCaPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IGetCaPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCaPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCaPoolRequest - * @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.security.privateca.v1.GetCaPoolRequest; - - /** - * Decodes a GetCaPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCaPoolRequest - * @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.security.privateca.v1.GetCaPoolRequest; - - /** - * Verifies a GetCaPoolRequest 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 GetCaPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCaPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.GetCaPoolRequest; - - /** - * Creates a plain object from a GetCaPoolRequest message. Also converts values to other types if specified. - * @param message GetCaPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.GetCaPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCaPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCaPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCaPoolsRequest. */ - interface IListCaPoolsRequest { - - /** ListCaPoolsRequest parent */ - parent?: (string|null); - - /** ListCaPoolsRequest pageSize */ - pageSize?: (number|null); - - /** ListCaPoolsRequest pageToken */ - pageToken?: (string|null); - - /** ListCaPoolsRequest filter */ - filter?: (string|null); - - /** ListCaPoolsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListCaPoolsRequest. */ - class ListCaPoolsRequest implements IListCaPoolsRequest { - - /** - * Constructs a new ListCaPoolsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IListCaPoolsRequest); - - /** ListCaPoolsRequest parent. */ - public parent: string; - - /** ListCaPoolsRequest pageSize. */ - public pageSize: number; - - /** ListCaPoolsRequest pageToken. */ - public pageToken: string; - - /** ListCaPoolsRequest filter. */ - public filter: string; - - /** ListCaPoolsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListCaPoolsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCaPoolsRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IListCaPoolsRequest): google.cloud.security.privateca.v1.ListCaPoolsRequest; - - /** - * Encodes the specified ListCaPoolsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsRequest.verify|verify} messages. - * @param message ListCaPoolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IListCaPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCaPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsRequest.verify|verify} messages. - * @param message ListCaPoolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCaPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCaPoolsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCaPoolsRequest - * @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.security.privateca.v1.ListCaPoolsRequest; - - /** - * Decodes a ListCaPoolsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCaPoolsRequest - * @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.security.privateca.v1.ListCaPoolsRequest; - - /** - * Verifies a ListCaPoolsRequest 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 ListCaPoolsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCaPoolsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCaPoolsRequest; - - /** - * Creates a plain object from a ListCaPoolsRequest message. Also converts values to other types if specified. - * @param message ListCaPoolsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ListCaPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCaPoolsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCaPoolsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCaPoolsResponse. */ - interface IListCaPoolsResponse { - - /** ListCaPoolsResponse caPools */ - caPools?: (google.cloud.security.privateca.v1.ICaPool[]|null); - - /** ListCaPoolsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListCaPoolsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListCaPoolsResponse. */ - class ListCaPoolsResponse implements IListCaPoolsResponse { - - /** - * Constructs a new ListCaPoolsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IListCaPoolsResponse); - - /** ListCaPoolsResponse caPools. */ - public caPools: google.cloud.security.privateca.v1.ICaPool[]; - - /** ListCaPoolsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListCaPoolsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListCaPoolsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCaPoolsResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IListCaPoolsResponse): google.cloud.security.privateca.v1.ListCaPoolsResponse; - - /** - * Encodes the specified ListCaPoolsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.verify|verify} messages. - * @param message ListCaPoolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IListCaPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCaPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.verify|verify} messages. - * @param message ListCaPoolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCaPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCaPoolsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCaPoolsResponse - * @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.security.privateca.v1.ListCaPoolsResponse; - - /** - * Decodes a ListCaPoolsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCaPoolsResponse - * @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.security.privateca.v1.ListCaPoolsResponse; - - /** - * Verifies a ListCaPoolsResponse 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 ListCaPoolsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCaPoolsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCaPoolsResponse; - - /** - * Creates a plain object from a ListCaPoolsResponse message. Also converts values to other types if specified. - * @param message ListCaPoolsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ListCaPoolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCaPoolsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCaPoolsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCertificateRevocationListRequest. */ - interface IGetCertificateRevocationListRequest { - - /** GetCertificateRevocationListRequest name */ - name?: (string|null); - } - - /** Represents a GetCertificateRevocationListRequest. */ - class GetCertificateRevocationListRequest implements IGetCertificateRevocationListRequest { - - /** - * Constructs a new GetCertificateRevocationListRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest); - - /** GetCertificateRevocationListRequest name. */ - public name: string; - - /** - * Creates a new GetCertificateRevocationListRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCertificateRevocationListRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest): google.cloud.security.privateca.v1.GetCertificateRevocationListRequest; - - /** - * Encodes the specified GetCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRevocationListRequest.verify|verify} messages. - * @param message GetCertificateRevocationListRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRevocationListRequest.verify|verify} messages. - * @param message GetCertificateRevocationListRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCertificateRevocationListRequest - * @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.security.privateca.v1.GetCertificateRevocationListRequest; - - /** - * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCertificateRevocationListRequest - * @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.security.privateca.v1.GetCertificateRevocationListRequest; - - /** - * Verifies a GetCertificateRevocationListRequest 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 GetCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCertificateRevocationListRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.GetCertificateRevocationListRequest; - - /** - * Creates a plain object from a GetCertificateRevocationListRequest message. Also converts values to other types if specified. - * @param message GetCertificateRevocationListRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.GetCertificateRevocationListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCertificateRevocationListRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCertificateRevocationListRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificateRevocationListsRequest. */ - interface IListCertificateRevocationListsRequest { - - /** ListCertificateRevocationListsRequest parent */ - parent?: (string|null); - - /** ListCertificateRevocationListsRequest pageSize */ - pageSize?: (number|null); - - /** ListCertificateRevocationListsRequest pageToken */ - pageToken?: (string|null); - - /** ListCertificateRevocationListsRequest filter */ - filter?: (string|null); - - /** ListCertificateRevocationListsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListCertificateRevocationListsRequest. */ - class ListCertificateRevocationListsRequest implements IListCertificateRevocationListsRequest { - - /** - * Constructs a new ListCertificateRevocationListsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest); - - /** ListCertificateRevocationListsRequest parent. */ - public parent: string; - - /** ListCertificateRevocationListsRequest pageSize. */ - public pageSize: number; - - /** ListCertificateRevocationListsRequest pageToken. */ - public pageToken: string; - - /** ListCertificateRevocationListsRequest filter. */ - public filter: string; - - /** ListCertificateRevocationListsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListCertificateRevocationListsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificateRevocationListsRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest): google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest; - - /** - * Encodes the specified ListCertificateRevocationListsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.verify|verify} messages. - * @param message ListCertificateRevocationListsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificateRevocationListsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.verify|verify} messages. - * @param message ListCertificateRevocationListsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificateRevocationListsRequest - * @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.security.privateca.v1.ListCertificateRevocationListsRequest; - - /** - * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificateRevocationListsRequest - * @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.security.privateca.v1.ListCertificateRevocationListsRequest; - - /** - * Verifies a ListCertificateRevocationListsRequest 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 ListCertificateRevocationListsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificateRevocationListsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest; - - /** - * Creates a plain object from a ListCertificateRevocationListsRequest message. Also converts values to other types if specified. - * @param message ListCertificateRevocationListsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificateRevocationListsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificateRevocationListsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificateRevocationListsResponse. */ - interface IListCertificateRevocationListsResponse { - - /** ListCertificateRevocationListsResponse certificateRevocationLists */ - certificateRevocationLists?: (google.cloud.security.privateca.v1.ICertificateRevocationList[]|null); - - /** ListCertificateRevocationListsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListCertificateRevocationListsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListCertificateRevocationListsResponse. */ - class ListCertificateRevocationListsResponse implements IListCertificateRevocationListsResponse { - - /** - * Constructs a new ListCertificateRevocationListsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse); - - /** ListCertificateRevocationListsResponse certificateRevocationLists. */ - public certificateRevocationLists: google.cloud.security.privateca.v1.ICertificateRevocationList[]; - - /** ListCertificateRevocationListsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListCertificateRevocationListsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListCertificateRevocationListsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificateRevocationListsResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse): google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse; - - /** - * Encodes the specified ListCertificateRevocationListsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.verify|verify} messages. - * @param message ListCertificateRevocationListsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificateRevocationListsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.verify|verify} messages. - * @param message ListCertificateRevocationListsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificateRevocationListsResponse - * @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.security.privateca.v1.ListCertificateRevocationListsResponse; - - /** - * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificateRevocationListsResponse - * @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.security.privateca.v1.ListCertificateRevocationListsResponse; - - /** - * Verifies a ListCertificateRevocationListsResponse 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 ListCertificateRevocationListsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificateRevocationListsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse; - - /** - * Creates a plain object from a ListCertificateRevocationListsResponse message. Also converts values to other types if specified. - * @param message ListCertificateRevocationListsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificateRevocationListsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificateRevocationListsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCertificateRevocationListRequest. */ - interface IUpdateCertificateRevocationListRequest { - - /** UpdateCertificateRevocationListRequest certificateRevocationList */ - certificateRevocationList?: (google.cloud.security.privateca.v1.ICertificateRevocationList|null); - - /** UpdateCertificateRevocationListRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateRevocationListRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateCertificateRevocationListRequest. */ - class UpdateCertificateRevocationListRequest implements IUpdateCertificateRevocationListRequest { - - /** - * Constructs a new UpdateCertificateRevocationListRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest); - - /** UpdateCertificateRevocationListRequest certificateRevocationList. */ - public certificateRevocationList?: (google.cloud.security.privateca.v1.ICertificateRevocationList|null); - - /** UpdateCertificateRevocationListRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateRevocationListRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateCertificateRevocationListRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCertificateRevocationListRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest): google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest; - - /** - * Encodes the specified UpdateCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.verify|verify} messages. - * @param message UpdateCertificateRevocationListRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.verify|verify} messages. - * @param message UpdateCertificateRevocationListRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCertificateRevocationListRequest - * @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.security.privateca.v1.UpdateCertificateRevocationListRequest; - - /** - * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCertificateRevocationListRequest - * @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.security.privateca.v1.UpdateCertificateRevocationListRequest; - - /** - * Verifies an UpdateCertificateRevocationListRequest 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 UpdateCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCertificateRevocationListRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest; - - /** - * Creates a plain object from an UpdateCertificateRevocationListRequest message. Also converts values to other types if specified. - * @param message UpdateCertificateRevocationListRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCertificateRevocationListRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCertificateRevocationListRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateCertificateTemplateRequest. */ - interface ICreateCertificateTemplateRequest { - - /** CreateCertificateTemplateRequest parent */ - parent?: (string|null); - - /** CreateCertificateTemplateRequest certificateTemplateId */ - certificateTemplateId?: (string|null); - - /** CreateCertificateTemplateRequest certificateTemplate */ - certificateTemplate?: (google.cloud.security.privateca.v1.ICertificateTemplate|null); - - /** CreateCertificateTemplateRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateCertificateTemplateRequest. */ - class CreateCertificateTemplateRequest implements ICreateCertificateTemplateRequest { - - /** - * Constructs a new CreateCertificateTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest); - - /** CreateCertificateTemplateRequest parent. */ - public parent: string; - - /** CreateCertificateTemplateRequest certificateTemplateId. */ - public certificateTemplateId: string; - - /** CreateCertificateTemplateRequest certificateTemplate. */ - public certificateTemplate?: (google.cloud.security.privateca.v1.ICertificateTemplate|null); - - /** CreateCertificateTemplateRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateCertificateTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCertificateTemplateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest): google.cloud.security.privateca.v1.CreateCertificateTemplateRequest; - - /** - * Encodes the specified CreateCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateTemplateRequest.verify|verify} messages. - * @param message CreateCertificateTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateTemplateRequest.verify|verify} messages. - * @param message CreateCertificateTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCertificateTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCertificateTemplateRequest - * @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.security.privateca.v1.CreateCertificateTemplateRequest; - - /** - * Decodes a CreateCertificateTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCertificateTemplateRequest - * @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.security.privateca.v1.CreateCertificateTemplateRequest; - - /** - * Verifies a CreateCertificateTemplateRequest 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 CreateCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCertificateTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.CreateCertificateTemplateRequest; - - /** - * Creates a plain object from a CreateCertificateTemplateRequest message. Also converts values to other types if specified. - * @param message CreateCertificateTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.CreateCertificateTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCertificateTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCertificateTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteCertificateTemplateRequest. */ - interface IDeleteCertificateTemplateRequest { - - /** DeleteCertificateTemplateRequest name */ - name?: (string|null); - - /** DeleteCertificateTemplateRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteCertificateTemplateRequest. */ - class DeleteCertificateTemplateRequest implements IDeleteCertificateTemplateRequest { - - /** - * Constructs a new DeleteCertificateTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest); - - /** DeleteCertificateTemplateRequest name. */ - public name: string; - - /** DeleteCertificateTemplateRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteCertificateTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteCertificateTemplateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest): google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest; - - /** - * Encodes the specified DeleteCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest.verify|verify} messages. - * @param message DeleteCertificateTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest.verify|verify} messages. - * @param message DeleteCertificateTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteCertificateTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteCertificateTemplateRequest - * @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.security.privateca.v1.DeleteCertificateTemplateRequest; - - /** - * Decodes a DeleteCertificateTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteCertificateTemplateRequest - * @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.security.privateca.v1.DeleteCertificateTemplateRequest; - - /** - * Verifies a DeleteCertificateTemplateRequest 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 DeleteCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteCertificateTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest; - - /** - * Creates a plain object from a DeleteCertificateTemplateRequest message. Also converts values to other types if specified. - * @param message DeleteCertificateTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteCertificateTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteCertificateTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCertificateTemplateRequest. */ - interface IGetCertificateTemplateRequest { - - /** GetCertificateTemplateRequest name */ - name?: (string|null); - } - - /** Represents a GetCertificateTemplateRequest. */ - class GetCertificateTemplateRequest implements IGetCertificateTemplateRequest { - - /** - * Constructs a new GetCertificateTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest); - - /** GetCertificateTemplateRequest name. */ - public name: string; - - /** - * Creates a new GetCertificateTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCertificateTemplateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest): google.cloud.security.privateca.v1.GetCertificateTemplateRequest; - - /** - * Encodes the specified GetCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateTemplateRequest.verify|verify} messages. - * @param message GetCertificateTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateTemplateRequest.verify|verify} messages. - * @param message GetCertificateTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCertificateTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCertificateTemplateRequest - * @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.security.privateca.v1.GetCertificateTemplateRequest; - - /** - * Decodes a GetCertificateTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCertificateTemplateRequest - * @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.security.privateca.v1.GetCertificateTemplateRequest; - - /** - * Verifies a GetCertificateTemplateRequest 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 GetCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCertificateTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.GetCertificateTemplateRequest; - - /** - * Creates a plain object from a GetCertificateTemplateRequest message. Also converts values to other types if specified. - * @param message GetCertificateTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.GetCertificateTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCertificateTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCertificateTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificateTemplatesRequest. */ - interface IListCertificateTemplatesRequest { - - /** ListCertificateTemplatesRequest parent */ - parent?: (string|null); - - /** ListCertificateTemplatesRequest pageSize */ - pageSize?: (number|null); - - /** ListCertificateTemplatesRequest pageToken */ - pageToken?: (string|null); - - /** ListCertificateTemplatesRequest filter */ - filter?: (string|null); - - /** ListCertificateTemplatesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListCertificateTemplatesRequest. */ - class ListCertificateTemplatesRequest implements IListCertificateTemplatesRequest { - - /** - * Constructs a new ListCertificateTemplatesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest); - - /** ListCertificateTemplatesRequest parent. */ - public parent: string; - - /** ListCertificateTemplatesRequest pageSize. */ - public pageSize: number; - - /** ListCertificateTemplatesRequest pageToken. */ - public pageToken: string; - - /** ListCertificateTemplatesRequest filter. */ - public filter: string; - - /** ListCertificateTemplatesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListCertificateTemplatesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificateTemplatesRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest): google.cloud.security.privateca.v1.ListCertificateTemplatesRequest; - - /** - * Encodes the specified ListCertificateTemplatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.verify|verify} messages. - * @param message ListCertificateTemplatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificateTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.verify|verify} messages. - * @param message ListCertificateTemplatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificateTemplatesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificateTemplatesRequest - * @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.security.privateca.v1.ListCertificateTemplatesRequest; - - /** - * Decodes a ListCertificateTemplatesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificateTemplatesRequest - * @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.security.privateca.v1.ListCertificateTemplatesRequest; - - /** - * Verifies a ListCertificateTemplatesRequest 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 ListCertificateTemplatesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificateTemplatesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateTemplatesRequest; - - /** - * Creates a plain object from a ListCertificateTemplatesRequest message. Also converts values to other types if specified. - * @param message ListCertificateTemplatesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ListCertificateTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificateTemplatesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificateTemplatesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificateTemplatesResponse. */ - interface IListCertificateTemplatesResponse { - - /** ListCertificateTemplatesResponse certificateTemplates */ - certificateTemplates?: (google.cloud.security.privateca.v1.ICertificateTemplate[]|null); - - /** ListCertificateTemplatesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListCertificateTemplatesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListCertificateTemplatesResponse. */ - class ListCertificateTemplatesResponse implements IListCertificateTemplatesResponse { - - /** - * Constructs a new ListCertificateTemplatesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IListCertificateTemplatesResponse); - - /** ListCertificateTemplatesResponse certificateTemplates. */ - public certificateTemplates: google.cloud.security.privateca.v1.ICertificateTemplate[]; - - /** ListCertificateTemplatesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListCertificateTemplatesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListCertificateTemplatesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificateTemplatesResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IListCertificateTemplatesResponse): google.cloud.security.privateca.v1.ListCertificateTemplatesResponse; - - /** - * Encodes the specified ListCertificateTemplatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.verify|verify} messages. - * @param message ListCertificateTemplatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IListCertificateTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificateTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.verify|verify} messages. - * @param message ListCertificateTemplatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IListCertificateTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificateTemplatesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificateTemplatesResponse - * @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.security.privateca.v1.ListCertificateTemplatesResponse; - - /** - * Decodes a ListCertificateTemplatesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificateTemplatesResponse - * @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.security.privateca.v1.ListCertificateTemplatesResponse; - - /** - * Verifies a ListCertificateTemplatesResponse 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 ListCertificateTemplatesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificateTemplatesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.ListCertificateTemplatesResponse; - - /** - * Creates a plain object from a ListCertificateTemplatesResponse message. Also converts values to other types if specified. - * @param message ListCertificateTemplatesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.ListCertificateTemplatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificateTemplatesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificateTemplatesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCertificateTemplateRequest. */ - interface IUpdateCertificateTemplateRequest { - - /** UpdateCertificateTemplateRequest certificateTemplate */ - certificateTemplate?: (google.cloud.security.privateca.v1.ICertificateTemplate|null); - - /** UpdateCertificateTemplateRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateTemplateRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateCertificateTemplateRequest. */ - class UpdateCertificateTemplateRequest implements IUpdateCertificateTemplateRequest { - - /** - * Constructs a new UpdateCertificateTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest); - - /** UpdateCertificateTemplateRequest certificateTemplate. */ - public certificateTemplate?: (google.cloud.security.privateca.v1.ICertificateTemplate|null); - - /** UpdateCertificateTemplateRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateTemplateRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateCertificateTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCertificateTemplateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest): google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest; - - /** - * Encodes the specified UpdateCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.verify|verify} messages. - * @param message UpdateCertificateTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.verify|verify} messages. - * @param message UpdateCertificateTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCertificateTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCertificateTemplateRequest - * @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.security.privateca.v1.UpdateCertificateTemplateRequest; - - /** - * Decodes an UpdateCertificateTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCertificateTemplateRequest - * @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.security.privateca.v1.UpdateCertificateTemplateRequest; - - /** - * Verifies an UpdateCertificateTemplateRequest 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 UpdateCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCertificateTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest; - - /** - * Creates a plain object from an UpdateCertificateTemplateRequest message. Also converts values to other types if specified. - * @param message UpdateCertificateTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCertificateTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCertificateTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** OperationMetadata apiVersion. */ - public apiVersion: string; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.security.privateca.v1.IOperationMetadata): google.cloud.security.privateca.v1.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.security.privateca.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.security.privateca.v1.OperationMetadata; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.security.privateca.v1.OperationMetadata; - - /** - * Verifies an OperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.OperationMetadata; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Properties of a CertificateAuthority. */ - interface ICertificateAuthority { - - /** CertificateAuthority name */ - name?: (string|null); - - /** CertificateAuthority type */ - type?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.Type|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.Type|null); - - /** CertificateAuthority tier */ - tier?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier|null); - - /** CertificateAuthority config */ - config?: (google.cloud.security.privateca.v1beta1.ICertificateConfig|null); - - /** CertificateAuthority lifetime */ - lifetime?: (google.protobuf.IDuration|null); - - /** CertificateAuthority keySpec */ - keySpec?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec|null); - - /** CertificateAuthority certificatePolicy */ - certificatePolicy?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy|null); - - /** CertificateAuthority issuingOptions */ - issuingOptions?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions|null); - - /** CertificateAuthority subordinateConfig */ - subordinateConfig?: (google.cloud.security.privateca.v1beta1.ISubordinateConfig|null); - - /** CertificateAuthority state */ - state?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.State|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.State|null); - - /** CertificateAuthority pemCaCertificates */ - pemCaCertificates?: (string[]|null); - - /** CertificateAuthority caCertificateDescriptions */ - caCertificateDescriptions?: (google.cloud.security.privateca.v1beta1.ICertificateDescription[]|null); - - /** CertificateAuthority gcsBucket */ - gcsBucket?: (string|null); - - /** CertificateAuthority accessUrls */ - accessUrls?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls|null); - - /** CertificateAuthority createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a CertificateAuthority. */ - class CertificateAuthority implements ICertificateAuthority { - - /** - * Constructs a new CertificateAuthority. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.ICertificateAuthority); - - /** CertificateAuthority name. */ - public name: string; - - /** CertificateAuthority type. */ - public type: (google.cloud.security.privateca.v1beta1.CertificateAuthority.Type|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.Type); - - /** CertificateAuthority tier. */ - public tier: (google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier); - - /** CertificateAuthority config. */ - public config?: (google.cloud.security.privateca.v1beta1.ICertificateConfig|null); - - /** CertificateAuthority lifetime. */ - public lifetime?: (google.protobuf.IDuration|null); - - /** CertificateAuthority keySpec. */ - public keySpec?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec|null); - - /** CertificateAuthority certificatePolicy. */ - public certificatePolicy?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy|null); - - /** CertificateAuthority issuingOptions. */ - public issuingOptions?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions|null); - - /** CertificateAuthority subordinateConfig. */ - public subordinateConfig?: (google.cloud.security.privateca.v1beta1.ISubordinateConfig|null); - - /** CertificateAuthority state. */ - public state: (google.cloud.security.privateca.v1beta1.CertificateAuthority.State|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.State); - - /** CertificateAuthority pemCaCertificates. */ - public pemCaCertificates: string[]; - - /** CertificateAuthority caCertificateDescriptions. */ - public caCertificateDescriptions: google.cloud.security.privateca.v1beta1.ICertificateDescription[]; - - /** CertificateAuthority gcsBucket. */ - public gcsBucket: string; - - /** CertificateAuthority accessUrls. */ - public accessUrls?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls|null); - - /** CertificateAuthority createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** CertificateAuthority labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new CertificateAuthority instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateAuthority instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.ICertificateAuthority): google.cloud.security.privateca.v1beta1.CertificateAuthority; - - /** - * Encodes the specified CertificateAuthority message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.verify|verify} messages. - * @param message CertificateAuthority message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.ICertificateAuthority, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateAuthority message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.verify|verify} messages. - * @param message CertificateAuthority message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICertificateAuthority, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateAuthority message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateAuthority - * @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.security.privateca.v1beta1.CertificateAuthority; - - /** - * Decodes a CertificateAuthority message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateAuthority - * @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.security.privateca.v1beta1.CertificateAuthority; - - /** - * Verifies a CertificateAuthority 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 CertificateAuthority message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateAuthority - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority; - - /** - * Creates a plain object from a CertificateAuthority message. Also converts values to other types if specified. - * @param message CertificateAuthority - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateAuthority to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateAuthority - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CertificateAuthority { - - /** Properties of an IssuingOptions. */ - interface IIssuingOptions { - - /** IssuingOptions includeCaCertUrl */ - includeCaCertUrl?: (boolean|null); - - /** IssuingOptions includeCrlAccessUrl */ - includeCrlAccessUrl?: (boolean|null); - } - - /** Represents an IssuingOptions. */ - class IssuingOptions implements IIssuingOptions { - - /** - * Constructs a new IssuingOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions); - - /** IssuingOptions includeCaCertUrl. */ - public includeCaCertUrl: boolean; - - /** IssuingOptions includeCrlAccessUrl. */ - public includeCrlAccessUrl: boolean; - - /** - * Creates a new IssuingOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns IssuingOptions instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions): google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions; - - /** - * Encodes the specified IssuingOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.verify|verify} messages. - * @param message IssuingOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IssuingOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.verify|verify} messages. - * @param message IssuingOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IssuingOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IssuingOptions - * @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.security.privateca.v1beta1.CertificateAuthority.IssuingOptions; - - /** - * Decodes an IssuingOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IssuingOptions - * @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.security.privateca.v1beta1.CertificateAuthority.IssuingOptions; - - /** - * Verifies an IssuingOptions 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 IssuingOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IssuingOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions; - - /** - * Creates a plain object from an IssuingOptions message. Also converts values to other types if specified. - * @param message IssuingOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IssuingOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IssuingOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CertificateAuthorityPolicy. */ - interface ICertificateAuthorityPolicy { - - /** CertificateAuthorityPolicy allowedConfigList */ - allowedConfigList?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList|null); - - /** CertificateAuthorityPolicy overwriteConfigValues */ - overwriteConfigValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null); - - /** CertificateAuthorityPolicy allowedLocationsAndOrganizations */ - allowedLocationsAndOrganizations?: (google.cloud.security.privateca.v1beta1.ISubject[]|null); - - /** CertificateAuthorityPolicy allowedCommonNames */ - allowedCommonNames?: (string[]|null); - - /** CertificateAuthorityPolicy allowedSans */ - allowedSans?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames|null); - - /** CertificateAuthorityPolicy maximumLifetime */ - maximumLifetime?: (google.protobuf.IDuration|null); - - /** CertificateAuthorityPolicy allowedIssuanceModes */ - allowedIssuanceModes?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes|null); - } - - /** Represents a CertificateAuthorityPolicy. */ - class CertificateAuthorityPolicy implements ICertificateAuthorityPolicy { - - /** - * Constructs a new CertificateAuthorityPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy); - - /** CertificateAuthorityPolicy allowedConfigList. */ - public allowedConfigList?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList|null); - - /** CertificateAuthorityPolicy overwriteConfigValues. */ - public overwriteConfigValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null); - - /** CertificateAuthorityPolicy allowedLocationsAndOrganizations. */ - public allowedLocationsAndOrganizations: google.cloud.security.privateca.v1beta1.ISubject[]; - - /** CertificateAuthorityPolicy allowedCommonNames. */ - public allowedCommonNames: string[]; - - /** CertificateAuthorityPolicy allowedSans. */ - public allowedSans?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames|null); - - /** CertificateAuthorityPolicy maximumLifetime. */ - public maximumLifetime?: (google.protobuf.IDuration|null); - - /** CertificateAuthorityPolicy allowedIssuanceModes. */ - public allowedIssuanceModes?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes|null); - - /** CertificateAuthorityPolicy configPolicy. */ - public configPolicy?: ("allowedConfigList"|"overwriteConfigValues"); - - /** - * Creates a new CertificateAuthorityPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateAuthorityPolicy instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy; - - /** - * Encodes the specified CertificateAuthorityPolicy message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.verify|verify} messages. - * @param message CertificateAuthorityPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateAuthorityPolicy message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.verify|verify} messages. - * @param message CertificateAuthorityPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateAuthorityPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateAuthorityPolicy - * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy; - - /** - * Decodes a CertificateAuthorityPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateAuthorityPolicy - * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy; - - /** - * Verifies a CertificateAuthorityPolicy 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 CertificateAuthorityPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateAuthorityPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy; - - /** - * Creates a plain object from a CertificateAuthorityPolicy message. Also converts values to other types if specified. - * @param message CertificateAuthorityPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateAuthorityPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateAuthorityPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CertificateAuthorityPolicy { - - /** Properties of an AllowedConfigList. */ - interface IAllowedConfigList { - - /** AllowedConfigList allowedConfigValues */ - allowedConfigValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigWrapper[]|null); - } - - /** Represents an AllowedConfigList. */ - class AllowedConfigList implements IAllowedConfigList { - - /** - * Constructs a new AllowedConfigList. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList); - - /** AllowedConfigList allowedConfigValues. */ - public allowedConfigValues: google.cloud.security.privateca.v1beta1.IReusableConfigWrapper[]; - - /** - * Creates a new AllowedConfigList instance using the specified properties. - * @param [properties] Properties to set - * @returns AllowedConfigList instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList; - - /** - * Encodes the specified AllowedConfigList message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.verify|verify} messages. - * @param message AllowedConfigList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AllowedConfigList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.verify|verify} messages. - * @param message AllowedConfigList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AllowedConfigList message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllowedConfigList - * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList; - - /** - * Decodes an AllowedConfigList message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllowedConfigList - * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList; - - /** - * Verifies an AllowedConfigList 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 AllowedConfigList message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllowedConfigList - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList; - - /** - * Creates a plain object from an AllowedConfigList message. Also converts values to other types if specified. - * @param message AllowedConfigList - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AllowedConfigList to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AllowedConfigList - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AllowedSubjectAltNames. */ - interface IAllowedSubjectAltNames { - - /** AllowedSubjectAltNames allowedDnsNames */ - allowedDnsNames?: (string[]|null); - - /** AllowedSubjectAltNames allowedUris */ - allowedUris?: (string[]|null); - - /** AllowedSubjectAltNames allowedEmailAddresses */ - allowedEmailAddresses?: (string[]|null); - - /** AllowedSubjectAltNames allowedIps */ - allowedIps?: (string[]|null); - - /** AllowedSubjectAltNames allowGlobbingDnsWildcards */ - allowGlobbingDnsWildcards?: (boolean|null); - - /** AllowedSubjectAltNames allowCustomSans */ - allowCustomSans?: (boolean|null); - } - - /** Represents an AllowedSubjectAltNames. */ - class AllowedSubjectAltNames implements IAllowedSubjectAltNames { - - /** - * Constructs a new AllowedSubjectAltNames. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames); - - /** AllowedSubjectAltNames allowedDnsNames. */ - public allowedDnsNames: string[]; - - /** AllowedSubjectAltNames allowedUris. */ - public allowedUris: string[]; - - /** AllowedSubjectAltNames allowedEmailAddresses. */ - public allowedEmailAddresses: string[]; - - /** AllowedSubjectAltNames allowedIps. */ - public allowedIps: string[]; - - /** AllowedSubjectAltNames allowGlobbingDnsWildcards. */ - public allowGlobbingDnsWildcards: boolean; - - /** AllowedSubjectAltNames allowCustomSans. */ - public allowCustomSans: boolean; - - /** - * Creates a new AllowedSubjectAltNames instance using the specified properties. - * @param [properties] Properties to set - * @returns AllowedSubjectAltNames instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames; - - /** - * Encodes the specified AllowedSubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.verify|verify} messages. - * @param message AllowedSubjectAltNames message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AllowedSubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.verify|verify} messages. - * @param message AllowedSubjectAltNames message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AllowedSubjectAltNames message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllowedSubjectAltNames - * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames; - - /** - * Decodes an AllowedSubjectAltNames message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllowedSubjectAltNames - * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames; - - /** - * Verifies an AllowedSubjectAltNames 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 AllowedSubjectAltNames message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllowedSubjectAltNames - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames; - - /** - * Creates a plain object from an AllowedSubjectAltNames message. Also converts values to other types if specified. - * @param message AllowedSubjectAltNames - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AllowedSubjectAltNames to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AllowedSubjectAltNames - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IssuanceModes. */ - interface IIssuanceModes { - - /** IssuanceModes allowCsrBasedIssuance */ - allowCsrBasedIssuance?: (boolean|null); - - /** IssuanceModes allowConfigBasedIssuance */ - allowConfigBasedIssuance?: (boolean|null); - } - - /** Represents an IssuanceModes. */ - class IssuanceModes implements IIssuanceModes { - - /** - * Constructs a new IssuanceModes. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes); - - /** IssuanceModes allowCsrBasedIssuance. */ - public allowCsrBasedIssuance: boolean; - - /** IssuanceModes allowConfigBasedIssuance. */ - public allowConfigBasedIssuance: boolean; - - /** - * Creates a new IssuanceModes instance using the specified properties. - * @param [properties] Properties to set - * @returns IssuanceModes instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes; - - /** - * Encodes the specified IssuanceModes message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.verify|verify} messages. - * @param message IssuanceModes message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IssuanceModes message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.verify|verify} messages. - * @param message IssuanceModes message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IssuanceModes message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IssuanceModes - * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes; - - /** - * Decodes an IssuanceModes message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IssuanceModes - * @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.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes; - - /** - * Verifies an IssuanceModes 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 IssuanceModes message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IssuanceModes - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes; - - /** - * Creates a plain object from an IssuanceModes message. Also converts values to other types if specified. - * @param message IssuanceModes - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IssuanceModes to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IssuanceModes - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an AccessUrls. */ - interface IAccessUrls { - - /** AccessUrls caCertificateAccessUrl */ - caCertificateAccessUrl?: (string|null); - - /** AccessUrls crlAccessUrl */ - crlAccessUrl?: (string|null); - } - - /** Represents an AccessUrls. */ - class AccessUrls implements IAccessUrls { - - /** - * Constructs a new AccessUrls. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls); - - /** AccessUrls caCertificateAccessUrl. */ - public caCertificateAccessUrl: string; - - /** AccessUrls crlAccessUrl. */ - public crlAccessUrl: string; - - /** - * Creates a new AccessUrls instance using the specified properties. - * @param [properties] Properties to set - * @returns AccessUrls instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls): google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls; - - /** - * Encodes the specified AccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.verify|verify} messages. - * @param message AccessUrls message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.verify|verify} messages. - * @param message AccessUrls message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AccessUrls message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AccessUrls - * @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.security.privateca.v1beta1.CertificateAuthority.AccessUrls; - - /** - * Decodes an AccessUrls message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AccessUrls - * @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.security.privateca.v1beta1.CertificateAuthority.AccessUrls; - - /** - * Verifies an AccessUrls 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 AccessUrls message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AccessUrls - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls; - - /** - * Creates a plain object from an AccessUrls message. Also converts values to other types if specified. - * @param message AccessUrls - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AccessUrls to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AccessUrls - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyVersionSpec. */ - interface IKeyVersionSpec { - - /** KeyVersionSpec cloudKmsKeyVersion */ - cloudKmsKeyVersion?: (string|null); - - /** KeyVersionSpec algorithm */ - algorithm?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|null); - } - - /** Represents a KeyVersionSpec. */ - class KeyVersionSpec implements IKeyVersionSpec { - - /** - * Constructs a new KeyVersionSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec); - - /** KeyVersionSpec cloudKmsKeyVersion. */ - public cloudKmsKeyVersion?: (string|null); - - /** KeyVersionSpec algorithm. */ - public algorithm?: (google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|keyof typeof google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|null); - - /** KeyVersionSpec KeyVersion. */ - public KeyVersion?: ("cloudKmsKeyVersion"|"algorithm"); - - /** - * Creates a new KeyVersionSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyVersionSpec instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec): google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec; - - /** - * Encodes the specified KeyVersionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. - * @param message KeyVersionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyVersionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. - * @param message KeyVersionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyVersionSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyVersionSpec - * @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.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec; - - /** - * Decodes a KeyVersionSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyVersionSpec - * @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.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec; - - /** - * Verifies a KeyVersionSpec 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 KeyVersionSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyVersionSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec; - - /** - * Creates a plain object from a KeyVersionSpec message. Also converts values to other types if specified. - * @param message KeyVersionSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyVersionSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyVersionSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - SELF_SIGNED = 1, - SUBORDINATE = 2 - } - - /** Tier enum. */ - enum Tier { - TIER_UNSPECIFIED = 0, - ENTERPRISE = 1, - DEVOPS = 2 - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ENABLED = 1, - DISABLED = 2, - PENDING_ACTIVATION = 3, - PENDING_DELETION = 4 - } - - /** SignHashAlgorithm enum. */ - enum SignHashAlgorithm { - SIGN_HASH_ALGORITHM_UNSPECIFIED = 0, - RSA_PSS_2048_SHA256 = 1, - RSA_PSS_3072_SHA256 = 2, - RSA_PSS_4096_SHA256 = 3, - RSA_PKCS1_2048_SHA256 = 6, - RSA_PKCS1_3072_SHA256 = 7, - RSA_PKCS1_4096_SHA256 = 8, - EC_P256_SHA256 = 4, - EC_P384_SHA384 = 5 - } - } - - /** Properties of a CertificateRevocationList. */ - interface ICertificateRevocationList { - - /** CertificateRevocationList name */ - name?: (string|null); - - /** CertificateRevocationList sequenceNumber */ - sequenceNumber?: (number|Long|string|null); - - /** CertificateRevocationList revokedCertificates */ - revokedCertificates?: (google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate[]|null); - - /** CertificateRevocationList pemCrl */ - pemCrl?: (string|null); - - /** CertificateRevocationList accessUrl */ - accessUrl?: (string|null); - - /** CertificateRevocationList state */ - state?: (google.cloud.security.privateca.v1beta1.CertificateRevocationList.State|keyof typeof google.cloud.security.privateca.v1beta1.CertificateRevocationList.State|null); - - /** CertificateRevocationList createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** CertificateRevocationList updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** CertificateRevocationList labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a CertificateRevocationList. */ - class CertificateRevocationList implements ICertificateRevocationList { - - /** - * Constructs a new CertificateRevocationList. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.ICertificateRevocationList); - - /** CertificateRevocationList name. */ - public name: string; - - /** CertificateRevocationList sequenceNumber. */ - public sequenceNumber: (number|Long|string); - - /** CertificateRevocationList revokedCertificates. */ - public revokedCertificates: google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate[]; - - /** CertificateRevocationList pemCrl. */ - public pemCrl: string; - - /** CertificateRevocationList accessUrl. */ - public accessUrl: string; - - /** CertificateRevocationList state. */ - public state: (google.cloud.security.privateca.v1beta1.CertificateRevocationList.State|keyof typeof google.cloud.security.privateca.v1beta1.CertificateRevocationList.State); - - /** CertificateRevocationList createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** CertificateRevocationList updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** CertificateRevocationList labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new CertificateRevocationList instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateRevocationList instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.ICertificateRevocationList): google.cloud.security.privateca.v1beta1.CertificateRevocationList; - - /** - * Encodes the specified CertificateRevocationList message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify|verify} messages. - * @param message CertificateRevocationList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.ICertificateRevocationList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateRevocationList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify|verify} messages. - * @param message CertificateRevocationList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICertificateRevocationList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateRevocationList message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateRevocationList - * @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.security.privateca.v1beta1.CertificateRevocationList; - - /** - * Decodes a CertificateRevocationList message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateRevocationList - * @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.security.privateca.v1beta1.CertificateRevocationList; - - /** - * Verifies a CertificateRevocationList 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 CertificateRevocationList message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateRevocationList - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateRevocationList; - - /** - * Creates a plain object from a CertificateRevocationList message. Also converts values to other types if specified. - * @param message CertificateRevocationList - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateRevocationList, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateRevocationList to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateRevocationList - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CertificateRevocationList { - - /** Properties of a RevokedCertificate. */ - interface IRevokedCertificate { - - /** RevokedCertificate certificate */ - certificate?: (string|null); - - /** RevokedCertificate hexSerialNumber */ - hexSerialNumber?: (string|null); - - /** RevokedCertificate revocationReason */ - revocationReason?: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason|null); - } - - /** Represents a RevokedCertificate. */ - class RevokedCertificate implements IRevokedCertificate { - - /** - * Constructs a new RevokedCertificate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate); - - /** RevokedCertificate certificate. */ - public certificate: string; - - /** RevokedCertificate hexSerialNumber. */ - public hexSerialNumber: string; - - /** RevokedCertificate revocationReason. */ - public revocationReason: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason); - - /** - * Creates a new RevokedCertificate instance using the specified properties. - * @param [properties] Properties to set - * @returns RevokedCertificate instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate): google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate; - - /** - * Encodes the specified RevokedCertificate message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. - * @param message RevokedCertificate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevokedCertificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. - * @param message RevokedCertificate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevokedCertificate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevokedCertificate - * @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.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate; - - /** - * Decodes a RevokedCertificate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevokedCertificate - * @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.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate; - - /** - * Verifies a RevokedCertificate 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 RevokedCertificate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevokedCertificate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate; - - /** - * Creates a plain object from a RevokedCertificate message. Also converts values to other types if specified. - * @param message RevokedCertificate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevokedCertificate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevokedCertificate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - SUPERSEDED = 2 - } - } - - /** Properties of a Certificate. */ - interface ICertificate { - - /** Certificate name */ - name?: (string|null); - - /** Certificate pemCsr */ - pemCsr?: (string|null); - - /** Certificate config */ - config?: (google.cloud.security.privateca.v1beta1.ICertificateConfig|null); - - /** Certificate lifetime */ - lifetime?: (google.protobuf.IDuration|null); - - /** Certificate revocationDetails */ - revocationDetails?: (google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails|null); - - /** Certificate pemCertificate */ - pemCertificate?: (string|null); - - /** Certificate certificateDescription */ - certificateDescription?: (google.cloud.security.privateca.v1beta1.ICertificateDescription|null); - - /** Certificate pemCertificateChain */ - pemCertificateChain?: (string[]|null); - - /** Certificate createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Certificate updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Certificate labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a Certificate. */ - class Certificate implements ICertificate { - - /** - * Constructs a new Certificate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.ICertificate); - - /** Certificate name. */ - public name: string; - - /** Certificate pemCsr. */ - public pemCsr?: (string|null); - - /** Certificate config. */ - public config?: (google.cloud.security.privateca.v1beta1.ICertificateConfig|null); - - /** Certificate lifetime. */ - public lifetime?: (google.protobuf.IDuration|null); - - /** Certificate revocationDetails. */ - public revocationDetails?: (google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails|null); - - /** Certificate pemCertificate. */ - public pemCertificate: string; - - /** Certificate certificateDescription. */ - public certificateDescription?: (google.cloud.security.privateca.v1beta1.ICertificateDescription|null); - - /** Certificate pemCertificateChain. */ - public pemCertificateChain: string[]; - - /** Certificate createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Certificate updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Certificate labels. */ - public labels: { [k: string]: string }; - - /** Certificate certificateConfig. */ - public certificateConfig?: ("pemCsr"|"config"); - - /** - * Creates a new Certificate instance using the specified properties. - * @param [properties] Properties to set - * @returns Certificate instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.ICertificate): google.cloud.security.privateca.v1beta1.Certificate; - - /** - * Encodes the specified Certificate message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.verify|verify} messages. - * @param message Certificate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.ICertificate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Certificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.verify|verify} messages. - * @param message Certificate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICertificate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Certificate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Certificate - * @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.security.privateca.v1beta1.Certificate; - - /** - * Decodes a Certificate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Certificate - * @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.security.privateca.v1beta1.Certificate; - - /** - * Verifies a Certificate 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 Certificate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Certificate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.Certificate; - - /** - * Creates a plain object from a Certificate message. Also converts values to other types if specified. - * @param message Certificate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.Certificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Certificate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Certificate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Certificate { - - /** Properties of a RevocationDetails. */ - interface IRevocationDetails { - - /** RevocationDetails revocationState */ - revocationState?: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason|null); - - /** RevocationDetails revocationTime */ - revocationTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a RevocationDetails. */ - class RevocationDetails implements IRevocationDetails { - - /** - * Constructs a new RevocationDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails); - - /** RevocationDetails revocationState. */ - public revocationState: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason); - - /** RevocationDetails revocationTime. */ - public revocationTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new RevocationDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns RevocationDetails instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails): google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails; - - /** - * Encodes the specified RevocationDetails message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.verify|verify} messages. - * @param message RevocationDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevocationDetails message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.verify|verify} messages. - * @param message RevocationDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevocationDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevocationDetails - * @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.security.privateca.v1beta1.Certificate.RevocationDetails; - - /** - * Decodes a RevocationDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevocationDetails - * @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.security.privateca.v1beta1.Certificate.RevocationDetails; - - /** - * Verifies a RevocationDetails 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 RevocationDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevocationDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails; - - /** - * Creates a plain object from a RevocationDetails message. Also converts values to other types if specified. - * @param message RevocationDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevocationDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevocationDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ReusableConfig. */ - interface IReusableConfig { - - /** ReusableConfig name */ - name?: (string|null); - - /** ReusableConfig values */ - values?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); - - /** ReusableConfig description */ - description?: (string|null); - - /** ReusableConfig createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ReusableConfig updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ReusableConfig labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a ReusableConfig. */ - class ReusableConfig implements IReusableConfig { - - /** - * Constructs a new ReusableConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IReusableConfig); - - /** ReusableConfig name. */ - public name: string; - - /** ReusableConfig values. */ - public values?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); - - /** ReusableConfig description. */ - public description: string; - - /** ReusableConfig createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ReusableConfig updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ReusableConfig labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new ReusableConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ReusableConfig instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IReusableConfig): google.cloud.security.privateca.v1beta1.ReusableConfig; - - /** - * Encodes the specified ReusableConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfig.verify|verify} messages. - * @param message ReusableConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IReusableConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReusableConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfig.verify|verify} messages. - * @param message ReusableConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IReusableConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReusableConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReusableConfig - * @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.security.privateca.v1beta1.ReusableConfig; - - /** - * Decodes a ReusableConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReusableConfig - * @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.security.privateca.v1beta1.ReusableConfig; - - /** - * Verifies a ReusableConfig 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 ReusableConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReusableConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ReusableConfig; - - /** - * Creates a plain object from a ReusableConfig message. Also converts values to other types if specified. - * @param message ReusableConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ReusableConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReusableConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReusableConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReusableConfigValues. */ - interface IReusableConfigValues { - - /** ReusableConfigValues keyUsage */ - keyUsage?: (google.cloud.security.privateca.v1beta1.IKeyUsage|null); - - /** ReusableConfigValues caOptions */ - caOptions?: (google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions|null); - - /** ReusableConfigValues policyIds */ - policyIds?: (google.cloud.security.privateca.v1beta1.IObjectId[]|null); - - /** ReusableConfigValues aiaOcspServers */ - aiaOcspServers?: (string[]|null); - - /** ReusableConfigValues additionalExtensions */ - additionalExtensions?: (google.cloud.security.privateca.v1beta1.IX509Extension[]|null); - } - - /** Represents a ReusableConfigValues. */ - class ReusableConfigValues implements IReusableConfigValues { - - /** - * Constructs a new ReusableConfigValues. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IReusableConfigValues); - - /** ReusableConfigValues keyUsage. */ - public keyUsage?: (google.cloud.security.privateca.v1beta1.IKeyUsage|null); - - /** ReusableConfigValues caOptions. */ - public caOptions?: (google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions|null); - - /** ReusableConfigValues policyIds. */ - public policyIds: google.cloud.security.privateca.v1beta1.IObjectId[]; - - /** ReusableConfigValues aiaOcspServers. */ - public aiaOcspServers: string[]; - - /** ReusableConfigValues additionalExtensions. */ - public additionalExtensions: google.cloud.security.privateca.v1beta1.IX509Extension[]; - - /** - * Creates a new ReusableConfigValues instance using the specified properties. - * @param [properties] Properties to set - * @returns ReusableConfigValues instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IReusableConfigValues): google.cloud.security.privateca.v1beta1.ReusableConfigValues; - - /** - * Encodes the specified ReusableConfigValues message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify|verify} messages. - * @param message ReusableConfigValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IReusableConfigValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReusableConfigValues message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify|verify} messages. - * @param message ReusableConfigValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IReusableConfigValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReusableConfigValues message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReusableConfigValues - * @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.security.privateca.v1beta1.ReusableConfigValues; - - /** - * Decodes a ReusableConfigValues message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReusableConfigValues - * @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.security.privateca.v1beta1.ReusableConfigValues; - - /** - * Verifies a ReusableConfigValues 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 ReusableConfigValues message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReusableConfigValues - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ReusableConfigValues; - - /** - * Creates a plain object from a ReusableConfigValues message. Also converts values to other types if specified. - * @param message ReusableConfigValues - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ReusableConfigValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReusableConfigValues to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReusableConfigValues - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReusableConfigValues { - - /** Properties of a CaOptions. */ - interface ICaOptions { - - /** CaOptions isCa */ - isCa?: (google.protobuf.IBoolValue|null); - - /** CaOptions maxIssuerPathLength */ - maxIssuerPathLength?: (google.protobuf.IInt32Value|null); - } - - /** Represents a CaOptions. */ - class CaOptions implements ICaOptions { - - /** - * Constructs a new CaOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions); - - /** CaOptions isCa. */ - public isCa?: (google.protobuf.IBoolValue|null); - - /** CaOptions maxIssuerPathLength. */ - public maxIssuerPathLength?: (google.protobuf.IInt32Value|null); - - /** - * Creates a new CaOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns CaOptions instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions): google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions; - - /** - * Encodes the specified CaOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.verify|verify} messages. - * @param message CaOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CaOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.verify|verify} messages. - * @param message CaOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CaOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CaOptions - * @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.security.privateca.v1beta1.ReusableConfigValues.CaOptions; - - /** - * Decodes a CaOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CaOptions - * @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.security.privateca.v1beta1.ReusableConfigValues.CaOptions; - - /** - * Verifies a CaOptions 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 CaOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CaOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions; - - /** - * Creates a plain object from a CaOptions message. Also converts values to other types if specified. - * @param message CaOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CaOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CaOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ReusableConfigWrapper. */ - interface IReusableConfigWrapper { - - /** ReusableConfigWrapper reusableConfig */ - reusableConfig?: (string|null); - - /** ReusableConfigWrapper reusableConfigValues */ - reusableConfigValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); - } - - /** Represents a ReusableConfigWrapper. */ - class ReusableConfigWrapper implements IReusableConfigWrapper { - - /** - * Constructs a new ReusableConfigWrapper. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IReusableConfigWrapper); - - /** ReusableConfigWrapper reusableConfig. */ - public reusableConfig?: (string|null); - - /** ReusableConfigWrapper reusableConfigValues. */ - public reusableConfigValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); - - /** ReusableConfigWrapper configValues. */ - public configValues?: ("reusableConfig"|"reusableConfigValues"); - - /** - * Creates a new ReusableConfigWrapper instance using the specified properties. - * @param [properties] Properties to set - * @returns ReusableConfigWrapper instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IReusableConfigWrapper): google.cloud.security.privateca.v1beta1.ReusableConfigWrapper; - - /** - * Encodes the specified ReusableConfigWrapper message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify|verify} messages. - * @param message ReusableConfigWrapper message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IReusableConfigWrapper, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReusableConfigWrapper message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify|verify} messages. - * @param message ReusableConfigWrapper message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IReusableConfigWrapper, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReusableConfigWrapper message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReusableConfigWrapper - * @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.security.privateca.v1beta1.ReusableConfigWrapper; - - /** - * Decodes a ReusableConfigWrapper message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReusableConfigWrapper - * @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.security.privateca.v1beta1.ReusableConfigWrapper; - - /** - * Verifies a ReusableConfigWrapper 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 ReusableConfigWrapper message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReusableConfigWrapper - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ReusableConfigWrapper; - - /** - * Creates a plain object from a ReusableConfigWrapper message. Also converts values to other types if specified. - * @param message ReusableConfigWrapper - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ReusableConfigWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReusableConfigWrapper to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReusableConfigWrapper - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SubordinateConfig. */ - interface ISubordinateConfig { - - /** SubordinateConfig certificateAuthority */ - certificateAuthority?: (string|null); - - /** SubordinateConfig pemIssuerChain */ - pemIssuerChain?: (google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain|null); - } - - /** Represents a SubordinateConfig. */ - class SubordinateConfig implements ISubordinateConfig { - - /** - * Constructs a new SubordinateConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.ISubordinateConfig); - - /** SubordinateConfig certificateAuthority. */ - public certificateAuthority?: (string|null); - - /** SubordinateConfig pemIssuerChain. */ - public pemIssuerChain?: (google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain|null); - - /** SubordinateConfig subordinateConfig. */ - public subordinateConfig?: ("certificateAuthority"|"pemIssuerChain"); - - /** - * Creates a new SubordinateConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SubordinateConfig instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.ISubordinateConfig): google.cloud.security.privateca.v1beta1.SubordinateConfig; - - /** - * Encodes the specified SubordinateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.verify|verify} messages. - * @param message SubordinateConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.ISubordinateConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubordinateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.verify|verify} messages. - * @param message SubordinateConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ISubordinateConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubordinateConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubordinateConfig - * @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.security.privateca.v1beta1.SubordinateConfig; - - /** - * Decodes a SubordinateConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubordinateConfig - * @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.security.privateca.v1beta1.SubordinateConfig; - - /** - * Verifies a SubordinateConfig 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 SubordinateConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubordinateConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.SubordinateConfig; - - /** - * Creates a plain object from a SubordinateConfig message. Also converts values to other types if specified. - * @param message SubordinateConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.SubordinateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubordinateConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubordinateConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SubordinateConfig { - - /** Properties of a SubordinateConfigChain. */ - interface ISubordinateConfigChain { - - /** SubordinateConfigChain pemCertificates */ - pemCertificates?: (string[]|null); - } - - /** Represents a SubordinateConfigChain. */ - class SubordinateConfigChain implements ISubordinateConfigChain { - - /** - * Constructs a new SubordinateConfigChain. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain); - - /** SubordinateConfigChain pemCertificates. */ - public pemCertificates: string[]; - - /** - * Creates a new SubordinateConfigChain instance using the specified properties. - * @param [properties] Properties to set - * @returns SubordinateConfigChain instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain): google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain; - - /** - * Encodes the specified SubordinateConfigChain message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. - * @param message SubordinateConfigChain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubordinateConfigChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. - * @param message SubordinateConfigChain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubordinateConfigChain message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubordinateConfigChain - * @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.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain; - - /** - * Decodes a SubordinateConfigChain message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubordinateConfigChain - * @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.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain; - - /** - * Verifies a SubordinateConfigChain 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 SubordinateConfigChain message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubordinateConfigChain - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain; - - /** - * Creates a plain object from a SubordinateConfigChain message. Also converts values to other types if specified. - * @param message SubordinateConfigChain - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubordinateConfigChain to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubordinateConfigChain - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a PublicKey. */ - interface IPublicKey { - - /** PublicKey type */ - type?: (google.cloud.security.privateca.v1beta1.PublicKey.KeyType|keyof typeof google.cloud.security.privateca.v1beta1.PublicKey.KeyType|null); - - /** PublicKey key */ - key?: (Uint8Array|Buffer|string|null); - } - - /** Represents a PublicKey. */ - class PublicKey implements IPublicKey { - - /** - * Constructs a new PublicKey. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IPublicKey); - - /** PublicKey type. */ - public type: (google.cloud.security.privateca.v1beta1.PublicKey.KeyType|keyof typeof google.cloud.security.privateca.v1beta1.PublicKey.KeyType); - - /** PublicKey key. */ - public key: (Uint8Array|Buffer|string); - - /** - * Creates a new PublicKey instance using the specified properties. - * @param [properties] Properties to set - * @returns PublicKey instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IPublicKey): google.cloud.security.privateca.v1beta1.PublicKey; - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.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.security.privateca.v1beta1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.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.security.privateca.v1beta1.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.security.privateca.v1beta1.PublicKey; - - /** - * 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.security.privateca.v1beta1.PublicKey; - - /** - * 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 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.security.privateca.v1beta1.PublicKey; - - /** - * 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.security.privateca.v1beta1.PublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PublicKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PublicKey - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PublicKey { - - /** KeyType enum. */ - enum KeyType { - KEY_TYPE_UNSPECIFIED = 0, - PEM_RSA_KEY = 1, - PEM_EC_KEY = 2 - } - } - - /** Properties of a CertificateConfig. */ - interface ICertificateConfig { - - /** CertificateConfig subjectConfig */ - subjectConfig?: (google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig|null); - - /** CertificateConfig reusableConfig */ - reusableConfig?: (google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null); - - /** CertificateConfig publicKey */ - publicKey?: (google.cloud.security.privateca.v1beta1.IPublicKey|null); - } - - /** Represents a CertificateConfig. */ - class CertificateConfig implements ICertificateConfig { - - /** - * Constructs a new CertificateConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.ICertificateConfig); - - /** CertificateConfig subjectConfig. */ - public subjectConfig?: (google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig|null); - - /** CertificateConfig reusableConfig. */ - public reusableConfig?: (google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null); - - /** CertificateConfig publicKey. */ - public publicKey?: (google.cloud.security.privateca.v1beta1.IPublicKey|null); - - /** - * Creates a new CertificateConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateConfig instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.ICertificateConfig): google.cloud.security.privateca.v1beta1.CertificateConfig; - - /** - * Encodes the specified CertificateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.verify|verify} messages. - * @param message CertificateConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.ICertificateConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.verify|verify} messages. - * @param message CertificateConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICertificateConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateConfig - * @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.security.privateca.v1beta1.CertificateConfig; - - /** - * Decodes a CertificateConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateConfig - * @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.security.privateca.v1beta1.CertificateConfig; - - /** - * Verifies a CertificateConfig 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 CertificateConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateConfig; - - /** - * Creates a plain object from a CertificateConfig message. Also converts values to other types if specified. - * @param message CertificateConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CertificateConfig { - - /** Properties of a SubjectConfig. */ - interface ISubjectConfig { - - /** SubjectConfig subject */ - subject?: (google.cloud.security.privateca.v1beta1.ISubject|null); - - /** SubjectConfig commonName */ - commonName?: (string|null); - - /** SubjectConfig subjectAltName */ - subjectAltName?: (google.cloud.security.privateca.v1beta1.ISubjectAltNames|null); - } - - /** Represents a SubjectConfig. */ - class SubjectConfig implements ISubjectConfig { - - /** - * Constructs a new SubjectConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig); - - /** SubjectConfig subject. */ - public subject?: (google.cloud.security.privateca.v1beta1.ISubject|null); - - /** SubjectConfig commonName. */ - public commonName: string; - - /** SubjectConfig subjectAltName. */ - public subjectAltName?: (google.cloud.security.privateca.v1beta1.ISubjectAltNames|null); - - /** - * Creates a new SubjectConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SubjectConfig instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig): google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig; - - /** - * Encodes the specified SubjectConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.verify|verify} messages. - * @param message SubjectConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubjectConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.verify|verify} messages. - * @param message SubjectConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubjectConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubjectConfig - * @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.security.privateca.v1beta1.CertificateConfig.SubjectConfig; - - /** - * Decodes a SubjectConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubjectConfig - * @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.security.privateca.v1beta1.CertificateConfig.SubjectConfig; - - /** - * Verifies a SubjectConfig 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 SubjectConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubjectConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig; - - /** - * Creates a plain object from a SubjectConfig message. Also converts values to other types if specified. - * @param message SubjectConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubjectConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubjectConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a CertificateDescription. */ - interface ICertificateDescription { - - /** CertificateDescription subjectDescription */ - subjectDescription?: (google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription|null); - - /** CertificateDescription configValues */ - configValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); - - /** CertificateDescription publicKey */ - publicKey?: (google.cloud.security.privateca.v1beta1.IPublicKey|null); - - /** CertificateDescription subjectKeyId */ - subjectKeyId?: (google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null); - - /** CertificateDescription authorityKeyId */ - authorityKeyId?: (google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null); - - /** CertificateDescription crlDistributionPoints */ - crlDistributionPoints?: (string[]|null); - - /** CertificateDescription aiaIssuingCertificateUrls */ - aiaIssuingCertificateUrls?: (string[]|null); - - /** CertificateDescription certFingerprint */ - certFingerprint?: (google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint|null); - } - - /** Represents a CertificateDescription. */ - class CertificateDescription implements ICertificateDescription { - - /** - * Constructs a new CertificateDescription. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.ICertificateDescription); - - /** CertificateDescription subjectDescription. */ - public subjectDescription?: (google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription|null); - - /** CertificateDescription configValues. */ - public configValues?: (google.cloud.security.privateca.v1beta1.IReusableConfigValues|null); - - /** CertificateDescription publicKey. */ - public publicKey?: (google.cloud.security.privateca.v1beta1.IPublicKey|null); - - /** CertificateDescription subjectKeyId. */ - public subjectKeyId?: (google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null); - - /** CertificateDescription authorityKeyId. */ - public authorityKeyId?: (google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null); - - /** CertificateDescription crlDistributionPoints. */ - public crlDistributionPoints: string[]; - - /** CertificateDescription aiaIssuingCertificateUrls. */ - public aiaIssuingCertificateUrls: string[]; - - /** CertificateDescription certFingerprint. */ - public certFingerprint?: (google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint|null); - - /** - * Creates a new CertificateDescription instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateDescription instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.ICertificateDescription): google.cloud.security.privateca.v1beta1.CertificateDescription; - - /** - * Encodes the specified CertificateDescription message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.verify|verify} messages. - * @param message CertificateDescription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.ICertificateDescription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.verify|verify} messages. - * @param message CertificateDescription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICertificateDescription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateDescription message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateDescription - * @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.security.privateca.v1beta1.CertificateDescription; - - /** - * Decodes a CertificateDescription message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateDescription - * @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.security.privateca.v1beta1.CertificateDescription; - - /** - * Verifies a CertificateDescription 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 CertificateDescription message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateDescription - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateDescription; - - /** - * Creates a plain object from a CertificateDescription message. Also converts values to other types if specified. - * @param message CertificateDescription - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateDescription, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateDescription to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateDescription - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CertificateDescription { - - /** Properties of a SubjectDescription. */ - interface ISubjectDescription { - - /** SubjectDescription subject */ - subject?: (google.cloud.security.privateca.v1beta1.ISubject|null); - - /** SubjectDescription commonName */ - commonName?: (string|null); - - /** SubjectDescription subjectAltName */ - subjectAltName?: (google.cloud.security.privateca.v1beta1.ISubjectAltNames|null); - - /** SubjectDescription hexSerialNumber */ - hexSerialNumber?: (string|null); - - /** SubjectDescription lifetime */ - lifetime?: (google.protobuf.IDuration|null); - - /** SubjectDescription notBeforeTime */ - notBeforeTime?: (google.protobuf.ITimestamp|null); - - /** SubjectDescription notAfterTime */ - notAfterTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a SubjectDescription. */ - class SubjectDescription implements ISubjectDescription { - - /** - * Constructs a new SubjectDescription. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription); - - /** SubjectDescription subject. */ - public subject?: (google.cloud.security.privateca.v1beta1.ISubject|null); - - /** SubjectDescription commonName. */ - public commonName: string; - - /** SubjectDescription subjectAltName. */ - public subjectAltName?: (google.cloud.security.privateca.v1beta1.ISubjectAltNames|null); - - /** SubjectDescription hexSerialNumber. */ - public hexSerialNumber: string; - - /** SubjectDescription lifetime. */ - public lifetime?: (google.protobuf.IDuration|null); - - /** SubjectDescription notBeforeTime. */ - public notBeforeTime?: (google.protobuf.ITimestamp|null); - - /** SubjectDescription notAfterTime. */ - public notAfterTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new SubjectDescription instance using the specified properties. - * @param [properties] Properties to set - * @returns SubjectDescription instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription): google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription; - - /** - * Encodes the specified SubjectDescription message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.verify|verify} messages. - * @param message SubjectDescription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubjectDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.verify|verify} messages. - * @param message SubjectDescription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubjectDescription message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubjectDescription - * @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.security.privateca.v1beta1.CertificateDescription.SubjectDescription; - - /** - * Decodes a SubjectDescription message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubjectDescription - * @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.security.privateca.v1beta1.CertificateDescription.SubjectDescription; - - /** - * Verifies a SubjectDescription 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 SubjectDescription message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubjectDescription - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription; - - /** - * Creates a plain object from a SubjectDescription message. Also converts values to other types if specified. - * @param message SubjectDescription - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubjectDescription to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubjectDescription - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyId. */ - interface IKeyId { - - /** KeyId keyId */ - keyId?: (string|null); - } - - /** Represents a KeyId. */ - class KeyId implements IKeyId { - - /** - * Constructs a new KeyId. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId); - - /** KeyId keyId. */ - public keyId: string; - - /** - * Creates a new KeyId instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyId instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId): google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId; - - /** - * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify|verify} messages. - * @param message KeyId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify|verify} messages. - * @param message KeyId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyId message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyId - * @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.security.privateca.v1beta1.CertificateDescription.KeyId; - - /** - * Decodes a KeyId message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyId - * @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.security.privateca.v1beta1.CertificateDescription.KeyId; - - /** - * Verifies a KeyId 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 KeyId message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyId - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId; - - /** - * Creates a plain object from a KeyId message. Also converts values to other types if specified. - * @param message KeyId - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyId to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyId - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CertificateFingerprint. */ - interface ICertificateFingerprint { - - /** CertificateFingerprint sha256Hash */ - sha256Hash?: (string|null); - } - - /** Represents a CertificateFingerprint. */ - class CertificateFingerprint implements ICertificateFingerprint { - - /** - * Constructs a new CertificateFingerprint. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint); - - /** CertificateFingerprint sha256Hash. */ - public sha256Hash: string; - - /** - * Creates a new CertificateFingerprint instance using the specified properties. - * @param [properties] Properties to set - * @returns CertificateFingerprint instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint): google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint; - - /** - * Encodes the specified CertificateFingerprint message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.verify|verify} messages. - * @param message CertificateFingerprint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CertificateFingerprint message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.verify|verify} messages. - * @param message CertificateFingerprint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CertificateFingerprint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CertificateFingerprint - * @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.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint; - - /** - * Decodes a CertificateFingerprint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CertificateFingerprint - * @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.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint; - - /** - * Verifies a CertificateFingerprint 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 CertificateFingerprint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CertificateFingerprint - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint; - - /** - * Creates a plain object from a CertificateFingerprint message. Also converts values to other types if specified. - * @param message CertificateFingerprint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CertificateFingerprint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CertificateFingerprint - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ObjectId. */ - interface IObjectId { - - /** ObjectId objectIdPath */ - objectIdPath?: (number[]|null); - } - - /** Represents an ObjectId. */ - class ObjectId implements IObjectId { - - /** - * Constructs a new ObjectId. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IObjectId); - - /** ObjectId objectIdPath. */ - public objectIdPath: number[]; - - /** - * Creates a new ObjectId instance using the specified properties. - * @param [properties] Properties to set - * @returns ObjectId instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IObjectId): google.cloud.security.privateca.v1beta1.ObjectId; - - /** - * Encodes the specified ObjectId message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ObjectId.verify|verify} messages. - * @param message ObjectId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IObjectId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ObjectId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ObjectId.verify|verify} messages. - * @param message ObjectId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IObjectId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ObjectId message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ObjectId - * @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.security.privateca.v1beta1.ObjectId; - - /** - * Decodes an ObjectId message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ObjectId - * @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.security.privateca.v1beta1.ObjectId; - - /** - * Verifies an ObjectId 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 ObjectId message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ObjectId - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ObjectId; - - /** - * Creates a plain object from an ObjectId message. Also converts values to other types if specified. - * @param message ObjectId - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ObjectId, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ObjectId to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ObjectId - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a X509Extension. */ - interface IX509Extension { - - /** X509Extension objectId */ - objectId?: (google.cloud.security.privateca.v1beta1.IObjectId|null); - - /** X509Extension critical */ - critical?: (boolean|null); - - /** X509Extension value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents a X509Extension. */ - class X509Extension implements IX509Extension { - - /** - * Constructs a new X509Extension. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IX509Extension); - - /** X509Extension objectId. */ - public objectId?: (google.cloud.security.privateca.v1beta1.IObjectId|null); - - /** X509Extension critical. */ - public critical: boolean; - - /** X509Extension value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new X509Extension instance using the specified properties. - * @param [properties] Properties to set - * @returns X509Extension instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IX509Extension): google.cloud.security.privateca.v1beta1.X509Extension; - - /** - * Encodes the specified X509Extension message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.X509Extension.verify|verify} messages. - * @param message X509Extension message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IX509Extension, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified X509Extension message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.X509Extension.verify|verify} messages. - * @param message X509Extension message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IX509Extension, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a X509Extension message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns X509Extension - * @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.security.privateca.v1beta1.X509Extension; - - /** - * Decodes a X509Extension message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns X509Extension - * @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.security.privateca.v1beta1.X509Extension; - - /** - * Verifies a X509Extension 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 X509Extension message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns X509Extension - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.X509Extension; - - /** - * Creates a plain object from a X509Extension message. Also converts values to other types if specified. - * @param message X509Extension - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.X509Extension, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this X509Extension to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for X509Extension - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KeyUsage. */ - interface IKeyUsage { - - /** KeyUsage baseKeyUsage */ - baseKeyUsage?: (google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions|null); - - /** KeyUsage extendedKeyUsage */ - extendedKeyUsage?: (google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions|null); - - /** KeyUsage unknownExtendedKeyUsages */ - unknownExtendedKeyUsages?: (google.cloud.security.privateca.v1beta1.IObjectId[]|null); - } - - /** Represents a KeyUsage. */ - class KeyUsage implements IKeyUsage { - - /** - * Constructs a new KeyUsage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IKeyUsage); - - /** KeyUsage baseKeyUsage. */ - public baseKeyUsage?: (google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions|null); - - /** KeyUsage extendedKeyUsage. */ - public extendedKeyUsage?: (google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions|null); - - /** KeyUsage unknownExtendedKeyUsages. */ - public unknownExtendedKeyUsages: google.cloud.security.privateca.v1beta1.IObjectId[]; - - /** - * Creates a new KeyUsage instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyUsage instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IKeyUsage): google.cloud.security.privateca.v1beta1.KeyUsage; - - /** - * Encodes the specified KeyUsage message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.verify|verify} messages. - * @param message KeyUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IKeyUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyUsage message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.verify|verify} messages. - * @param message KeyUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IKeyUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyUsage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyUsage - * @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.security.privateca.v1beta1.KeyUsage; - - /** - * Decodes a KeyUsage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyUsage - * @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.security.privateca.v1beta1.KeyUsage; - - /** - * Verifies a KeyUsage 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 KeyUsage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyUsage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.KeyUsage; - - /** - * Creates a plain object from a KeyUsage message. Also converts values to other types if specified. - * @param message KeyUsage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.KeyUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyUsage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyUsage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace KeyUsage { - - /** Properties of a KeyUsageOptions. */ - interface IKeyUsageOptions { - - /** KeyUsageOptions digitalSignature */ - digitalSignature?: (boolean|null); - - /** KeyUsageOptions contentCommitment */ - contentCommitment?: (boolean|null); - - /** KeyUsageOptions keyEncipherment */ - keyEncipherment?: (boolean|null); - - /** KeyUsageOptions dataEncipherment */ - dataEncipherment?: (boolean|null); - - /** KeyUsageOptions keyAgreement */ - keyAgreement?: (boolean|null); - - /** KeyUsageOptions certSign */ - certSign?: (boolean|null); - - /** KeyUsageOptions crlSign */ - crlSign?: (boolean|null); - - /** KeyUsageOptions encipherOnly */ - encipherOnly?: (boolean|null); - - /** KeyUsageOptions decipherOnly */ - decipherOnly?: (boolean|null); - } - - /** Represents a KeyUsageOptions. */ - class KeyUsageOptions implements IKeyUsageOptions { - - /** - * Constructs a new KeyUsageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions); - - /** KeyUsageOptions digitalSignature. */ - public digitalSignature: boolean; - - /** KeyUsageOptions contentCommitment. */ - public contentCommitment: boolean; - - /** KeyUsageOptions keyEncipherment. */ - public keyEncipherment: boolean; - - /** KeyUsageOptions dataEncipherment. */ - public dataEncipherment: boolean; - - /** KeyUsageOptions keyAgreement. */ - public keyAgreement: boolean; - - /** KeyUsageOptions certSign. */ - public certSign: boolean; - - /** KeyUsageOptions crlSign. */ - public crlSign: boolean; - - /** KeyUsageOptions encipherOnly. */ - public encipherOnly: boolean; - - /** KeyUsageOptions decipherOnly. */ - public decipherOnly: boolean; - - /** - * Creates a new KeyUsageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns KeyUsageOptions instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions): google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions; - - /** - * Encodes the specified KeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.verify|verify} messages. - * @param message KeyUsageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.verify|verify} messages. - * @param message KeyUsageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KeyUsageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KeyUsageOptions - * @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.security.privateca.v1beta1.KeyUsage.KeyUsageOptions; - - /** - * Decodes a KeyUsageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KeyUsageOptions - * @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.security.privateca.v1beta1.KeyUsage.KeyUsageOptions; - - /** - * Verifies a KeyUsageOptions 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 KeyUsageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KeyUsageOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions; - - /** - * Creates a plain object from a KeyUsageOptions message. Also converts values to other types if specified. - * @param message KeyUsageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KeyUsageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KeyUsageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExtendedKeyUsageOptions. */ - interface IExtendedKeyUsageOptions { - - /** ExtendedKeyUsageOptions serverAuth */ - serverAuth?: (boolean|null); - - /** ExtendedKeyUsageOptions clientAuth */ - clientAuth?: (boolean|null); - - /** ExtendedKeyUsageOptions codeSigning */ - codeSigning?: (boolean|null); - - /** ExtendedKeyUsageOptions emailProtection */ - emailProtection?: (boolean|null); - - /** ExtendedKeyUsageOptions timeStamping */ - timeStamping?: (boolean|null); - - /** ExtendedKeyUsageOptions ocspSigning */ - ocspSigning?: (boolean|null); - } - - /** Represents an ExtendedKeyUsageOptions. */ - class ExtendedKeyUsageOptions implements IExtendedKeyUsageOptions { - - /** - * Constructs a new ExtendedKeyUsageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions); - - /** ExtendedKeyUsageOptions serverAuth. */ - public serverAuth: boolean; - - /** ExtendedKeyUsageOptions clientAuth. */ - public clientAuth: boolean; - - /** ExtendedKeyUsageOptions codeSigning. */ - public codeSigning: boolean; - - /** ExtendedKeyUsageOptions emailProtection. */ - public emailProtection: boolean; - - /** ExtendedKeyUsageOptions timeStamping. */ - public timeStamping: boolean; - - /** ExtendedKeyUsageOptions ocspSigning. */ - public ocspSigning: boolean; - - /** - * Creates a new ExtendedKeyUsageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtendedKeyUsageOptions instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions): google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions; - - /** - * Encodes the specified ExtendedKeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. - * @param message ExtendedKeyUsageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtendedKeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. - * @param message ExtendedKeyUsageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtendedKeyUsageOptions - * @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.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions; - - /** - * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtendedKeyUsageOptions - * @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.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions; - - /** - * Verifies an ExtendedKeyUsageOptions 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 ExtendedKeyUsageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtendedKeyUsageOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions; - - /** - * Creates a plain object from an ExtendedKeyUsageOptions message. Also converts values to other types if specified. - * @param message ExtendedKeyUsageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtendedKeyUsageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtendedKeyUsageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Subject. */ - interface ISubject { - - /** Subject countryCode */ - countryCode?: (string|null); - - /** Subject organization */ - organization?: (string|null); - - /** Subject organizationalUnit */ - organizationalUnit?: (string|null); - - /** Subject locality */ - locality?: (string|null); - - /** Subject province */ - province?: (string|null); - - /** Subject streetAddress */ - streetAddress?: (string|null); - - /** Subject postalCode */ - postalCode?: (string|null); - } - - /** Represents a Subject. */ - class Subject implements ISubject { - - /** - * Constructs a new Subject. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.ISubject); - - /** Subject countryCode. */ - public countryCode: string; - - /** Subject organization. */ - public organization: string; - - /** Subject organizationalUnit. */ - public organizationalUnit: string; - - /** Subject locality. */ - public locality: string; - - /** Subject province. */ - public province: string; - - /** Subject streetAddress. */ - public streetAddress: string; - - /** Subject postalCode. */ - public postalCode: string; - - /** - * Creates a new Subject instance using the specified properties. - * @param [properties] Properties to set - * @returns Subject instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.ISubject): google.cloud.security.privateca.v1beta1.Subject; - - /** - * Encodes the specified Subject message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Subject.verify|verify} messages. - * @param message Subject message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Subject.verify|verify} messages. - * @param message Subject message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Subject message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Subject - * @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.security.privateca.v1beta1.Subject; - - /** - * Decodes a Subject message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Subject - * @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.security.privateca.v1beta1.Subject; - - /** - * Verifies a Subject 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 Subject message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Subject - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.Subject; - - /** - * Creates a plain object from a Subject message. Also converts values to other types if specified. - * @param message Subject - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.Subject, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Subject to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Subject - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SubjectAltNames. */ - interface ISubjectAltNames { - - /** SubjectAltNames dnsNames */ - dnsNames?: (string[]|null); - - /** SubjectAltNames uris */ - uris?: (string[]|null); - - /** SubjectAltNames emailAddresses */ - emailAddresses?: (string[]|null); - - /** SubjectAltNames ipAddresses */ - ipAddresses?: (string[]|null); - - /** SubjectAltNames customSans */ - customSans?: (google.cloud.security.privateca.v1beta1.IX509Extension[]|null); - } - - /** Represents a SubjectAltNames. */ - class SubjectAltNames implements ISubjectAltNames { - - /** - * Constructs a new SubjectAltNames. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.ISubjectAltNames); - - /** SubjectAltNames dnsNames. */ - public dnsNames: string[]; - - /** SubjectAltNames uris. */ - public uris: string[]; - - /** SubjectAltNames emailAddresses. */ - public emailAddresses: string[]; - - /** SubjectAltNames ipAddresses. */ - public ipAddresses: string[]; - - /** SubjectAltNames customSans. */ - public customSans: google.cloud.security.privateca.v1beta1.IX509Extension[]; - - /** - * Creates a new SubjectAltNames instance using the specified properties. - * @param [properties] Properties to set - * @returns SubjectAltNames instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.ISubjectAltNames): google.cloud.security.privateca.v1beta1.SubjectAltNames; - - /** - * Encodes the specified SubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubjectAltNames.verify|verify} messages. - * @param message SubjectAltNames message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.ISubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubjectAltNames.verify|verify} messages. - * @param message SubjectAltNames message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ISubjectAltNames, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubjectAltNames message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubjectAltNames - * @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.security.privateca.v1beta1.SubjectAltNames; - - /** - * Decodes a SubjectAltNames message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubjectAltNames - * @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.security.privateca.v1beta1.SubjectAltNames; - - /** - * Verifies a SubjectAltNames 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 SubjectAltNames message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubjectAltNames - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.SubjectAltNames; - - /** - * Creates a plain object from a SubjectAltNames message. Also converts values to other types if specified. - * @param message SubjectAltNames - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.SubjectAltNames, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubjectAltNames to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubjectAltNames - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** RevocationReason enum. */ - enum RevocationReason { - REVOCATION_REASON_UNSPECIFIED = 0, - KEY_COMPROMISE = 1, - CERTIFICATE_AUTHORITY_COMPROMISE = 2, - AFFILIATION_CHANGED = 3, - SUPERSEDED = 4, - CESSATION_OF_OPERATION = 5, - CERTIFICATE_HOLD = 6, - PRIVILEGE_WITHDRAWN = 7, - ATTRIBUTE_AUTHORITY_COMPROMISE = 8 - } - - /** Represents a CertificateAuthorityService */ - class CertificateAuthorityService extends $protobuf.rpc.Service { - - /** - * Constructs a new CertificateAuthorityService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new CertificateAuthorityService 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): CertificateAuthorityService; - - /** - * Calls CreateCertificate. - * @param request CreateCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Certificate - */ - public createCertificate(request: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateCallback): void; - - /** - * Calls CreateCertificate. - * @param request CreateCertificateRequest message or plain object - * @returns Promise - */ - public createCertificate(request: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest): Promise; - - /** - * Calls GetCertificate. - * @param request GetCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Certificate - */ - public getCertificate(request: google.cloud.security.privateca.v1beta1.IGetCertificateRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateCallback): void; - - /** - * Calls GetCertificate. - * @param request GetCertificateRequest message or plain object - * @returns Promise - */ - public getCertificate(request: google.cloud.security.privateca.v1beta1.IGetCertificateRequest): Promise; - - /** - * Calls ListCertificates. - * @param request ListCertificatesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCertificatesResponse - */ - public listCertificates(request: google.cloud.security.privateca.v1beta1.IListCertificatesRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificatesCallback): void; - - /** - * Calls ListCertificates. - * @param request ListCertificatesRequest message or plain object - * @returns Promise - */ - public listCertificates(request: google.cloud.security.privateca.v1beta1.IListCertificatesRequest): Promise; - - /** - * Calls RevokeCertificate. - * @param request RevokeCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Certificate - */ - public revokeCertificate(request: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificateCallback): void; - - /** - * Calls RevokeCertificate. - * @param request RevokeCertificateRequest message or plain object - * @returns Promise - */ - public revokeCertificate(request: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest): Promise; - - /** - * Calls UpdateCertificate. - * @param request UpdateCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Certificate - */ - public updateCertificate(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateCallback): void; - - /** - * Calls UpdateCertificate. - * @param request UpdateCertificateRequest message or plain object - * @returns Promise - */ - public updateCertificate(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest): Promise; - - /** - * Calls ActivateCertificateAuthority. - * @param request ActivateCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public activateCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthorityCallback): void; - - /** - * Calls ActivateCertificateAuthority. - * @param request ActivateCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public activateCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest): Promise; - - /** - * Calls CreateCertificateAuthority. - * @param request CreateCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createCertificateAuthority(request: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthorityCallback): void; - - /** - * Calls CreateCertificateAuthority. - * @param request CreateCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public createCertificateAuthority(request: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest): Promise; - - /** - * Calls DisableCertificateAuthority. - * @param request DisableCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public disableCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthorityCallback): void; - - /** - * Calls DisableCertificateAuthority. - * @param request DisableCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public disableCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest): Promise; - - /** - * Calls EnableCertificateAuthority. - * @param request EnableCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public enableCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthorityCallback): void; - - /** - * Calls EnableCertificateAuthority. - * @param request EnableCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public enableCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest): Promise; - - /** - * Calls FetchCertificateAuthorityCsr. - * @param request FetchCertificateAuthorityCsrRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchCertificateAuthorityCsrResponse - */ - public fetchCertificateAuthorityCsr(request: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsrCallback): void; - - /** - * Calls FetchCertificateAuthorityCsr. - * @param request FetchCertificateAuthorityCsrRequest message or plain object - * @returns Promise - */ - public fetchCertificateAuthorityCsr(request: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest): Promise; - - /** - * Calls GetCertificateAuthority. - * @param request GetCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CertificateAuthority - */ - public getCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthorityCallback): void; - - /** - * Calls GetCertificateAuthority. - * @param request GetCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public getCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest): Promise; - - /** - * Calls ListCertificateAuthorities. - * @param request ListCertificateAuthoritiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCertificateAuthoritiesResponse - */ - public listCertificateAuthorities(request: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthoritiesCallback): void; - - /** - * Calls ListCertificateAuthorities. - * @param request ListCertificateAuthoritiesRequest message or plain object - * @returns Promise - */ - public listCertificateAuthorities(request: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest): Promise; - - /** - * Calls RestoreCertificateAuthority. - * @param request RestoreCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthorityCallback): void; - - /** - * Calls RestoreCertificateAuthority. - * @param request RestoreCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public restoreCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest): Promise; - - /** - * Calls ScheduleDeleteCertificateAuthority. - * @param request ScheduleDeleteCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public scheduleDeleteCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthorityCallback): void; - - /** - * Calls ScheduleDeleteCertificateAuthority. - * @param request ScheduleDeleteCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public scheduleDeleteCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest): Promise; - - /** - * Calls UpdateCertificateAuthority. - * @param request UpdateCertificateAuthorityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthorityCallback): void; - - /** - * Calls UpdateCertificateAuthority. - * @param request UpdateCertificateAuthorityRequest message or plain object - * @returns Promise - */ - public updateCertificateAuthority(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest): Promise; - - /** - * Calls GetCertificateRevocationList. - * @param request GetCertificateRevocationListRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CertificateRevocationList - */ - public getCertificateRevocationList(request: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationListCallback): void; - - /** - * Calls GetCertificateRevocationList. - * @param request GetCertificateRevocationListRequest message or plain object - * @returns Promise - */ - public getCertificateRevocationList(request: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest): Promise; - - /** - * Calls ListCertificateRevocationLists. - * @param request ListCertificateRevocationListsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCertificateRevocationListsResponse - */ - public listCertificateRevocationLists(request: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationListsCallback): void; - - /** - * Calls ListCertificateRevocationLists. - * @param request ListCertificateRevocationListsRequest message or plain object - * @returns Promise - */ - public listCertificateRevocationLists(request: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest): Promise; - - /** - * Calls UpdateCertificateRevocationList. - * @param request UpdateCertificateRevocationListRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateCertificateRevocationList(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationListCallback): void; - - /** - * Calls UpdateCertificateRevocationList. - * @param request UpdateCertificateRevocationListRequest message or plain object - * @returns Promise - */ - public updateCertificateRevocationList(request: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest): Promise; - - /** - * Calls GetReusableConfig. - * @param request GetReusableConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ReusableConfig - */ - public getReusableConfig(request: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfigCallback): void; - - /** - * Calls GetReusableConfig. - * @param request GetReusableConfigRequest message or plain object - * @returns Promise - */ - public getReusableConfig(request: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest): Promise; - - /** - * Calls ListReusableConfigs. - * @param request ListReusableConfigsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListReusableConfigsResponse - */ - public listReusableConfigs(request: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, callback: google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigsCallback): void; - - /** - * Calls ListReusableConfigs. - * @param request ListReusableConfigsRequest message or plain object - * @returns Promise - */ - public listReusableConfigs(request: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest): Promise; - } - - namespace CertificateAuthorityService { - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|createCertificate}. - * @param error Error, if any - * @param [response] Certificate - */ - type CreateCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.Certificate) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificate}. - * @param error Error, if any - * @param [response] Certificate - */ - type GetCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.Certificate) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificates}. - * @param error Error, if any - * @param [response] ListCertificatesResponse - */ - type ListCertificatesCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.ListCertificatesResponse) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|revokeCertificate}. - * @param error Error, if any - * @param [response] Certificate - */ - type RevokeCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.Certificate) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificate}. - * @param error Error, if any - * @param [response] Certificate - */ - type UpdateCertificateCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.Certificate) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|activateCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type ActivateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|createCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|disableCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type DisableCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|enableCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type EnableCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|fetchCertificateAuthorityCsr}. - * @param error Error, if any - * @param [response] FetchCertificateAuthorityCsrResponse - */ - type FetchCertificateAuthorityCsrCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificateAuthority}. - * @param error Error, if any - * @param [response] CertificateAuthority - */ - type GetCertificateAuthorityCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.CertificateAuthority) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificateAuthorities}. - * @param error Error, if any - * @param [response] ListCertificateAuthoritiesResponse - */ - type ListCertificateAuthoritiesCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|restoreCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|scheduleDeleteCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type ScheduleDeleteCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificateAuthority}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateCertificateAuthorityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificateRevocationList}. - * @param error Error, if any - * @param [response] CertificateRevocationList - */ - type GetCertificateRevocationListCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.CertificateRevocationList) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificateRevocationLists}. - * @param error Error, if any - * @param [response] ListCertificateRevocationListsResponse - */ - type ListCertificateRevocationListsCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificateRevocationList}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateCertificateRevocationListCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getReusableConfig}. - * @param error Error, if any - * @param [response] ReusableConfig - */ - type GetReusableConfigCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.ReusableConfig) => void; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listReusableConfigs}. - * @param error Error, if any - * @param [response] ListReusableConfigsResponse - */ - type ListReusableConfigsCallback = (error: (Error|null), response?: google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse) => void; - } - - /** Properties of a CreateCertificateRequest. */ - interface ICreateCertificateRequest { - - /** CreateCertificateRequest parent */ - parent?: (string|null); - - /** CreateCertificateRequest certificateId */ - certificateId?: (string|null); - - /** CreateCertificateRequest certificate */ - certificate?: (google.cloud.security.privateca.v1beta1.ICertificate|null); - - /** CreateCertificateRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateCertificateRequest. */ - class CreateCertificateRequest implements ICreateCertificateRequest { - - /** - * Constructs a new CreateCertificateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest); - - /** CreateCertificateRequest parent. */ - public parent: string; - - /** CreateCertificateRequest certificateId. */ - public certificateId: string; - - /** CreateCertificateRequest certificate. */ - public certificate?: (google.cloud.security.privateca.v1beta1.ICertificate|null); - - /** CreateCertificateRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateCertificateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCertificateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest): google.cloud.security.privateca.v1beta1.CreateCertificateRequest; - - /** - * Encodes the specified CreateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateRequest.verify|verify} messages. - * @param message CreateCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateRequest.verify|verify} messages. - * @param message CreateCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCertificateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCertificateRequest - * @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.security.privateca.v1beta1.CreateCertificateRequest; - - /** - * Decodes a CreateCertificateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCertificateRequest - * @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.security.privateca.v1beta1.CreateCertificateRequest; - - /** - * Verifies a CreateCertificateRequest 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 CreateCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCertificateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CreateCertificateRequest; - - /** - * Creates a plain object from a CreateCertificateRequest message. Also converts values to other types if specified. - * @param message CreateCertificateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CreateCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCertificateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCertificateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCertificateRequest. */ - interface IGetCertificateRequest { - - /** GetCertificateRequest name */ - name?: (string|null); - } - - /** Represents a GetCertificateRequest. */ - class GetCertificateRequest implements IGetCertificateRequest { - - /** - * Constructs a new GetCertificateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateRequest); - - /** GetCertificateRequest name. */ - public name: string; - - /** - * Creates a new GetCertificateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCertificateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateRequest): google.cloud.security.privateca.v1beta1.GetCertificateRequest; - - /** - * Encodes the specified GetCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRequest.verify|verify} messages. - * @param message GetCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IGetCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRequest.verify|verify} messages. - * @param message GetCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IGetCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCertificateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCertificateRequest - * @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.security.privateca.v1beta1.GetCertificateRequest; - - /** - * Decodes a GetCertificateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCertificateRequest - * @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.security.privateca.v1beta1.GetCertificateRequest; - - /** - * Verifies a GetCertificateRequest 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 GetCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCertificateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.GetCertificateRequest; - - /** - * Creates a plain object from a GetCertificateRequest message. Also converts values to other types if specified. - * @param message GetCertificateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.GetCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCertificateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCertificateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificatesRequest. */ - interface IListCertificatesRequest { - - /** ListCertificatesRequest parent */ - parent?: (string|null); - - /** ListCertificatesRequest pageSize */ - pageSize?: (number|null); - - /** ListCertificatesRequest pageToken */ - pageToken?: (string|null); - - /** ListCertificatesRequest filter */ - filter?: (string|null); - - /** ListCertificatesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListCertificatesRequest. */ - class ListCertificatesRequest implements IListCertificatesRequest { - - /** - * Constructs a new ListCertificatesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificatesRequest); - - /** ListCertificatesRequest parent. */ - public parent: string; - - /** ListCertificatesRequest pageSize. */ - public pageSize: number; - - /** ListCertificatesRequest pageToken. */ - public pageToken: string; - - /** ListCertificatesRequest filter. */ - public filter: string; - - /** ListCertificatesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListCertificatesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificatesRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificatesRequest): google.cloud.security.privateca.v1beta1.ListCertificatesRequest; - - /** - * Encodes the specified ListCertificatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesRequest.verify|verify} messages. - * @param message ListCertificatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesRequest.verify|verify} messages. - * @param message ListCertificatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificatesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificatesRequest - * @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.security.privateca.v1beta1.ListCertificatesRequest; - - /** - * Decodes a ListCertificatesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificatesRequest - * @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.security.privateca.v1beta1.ListCertificatesRequest; - - /** - * Verifies a ListCertificatesRequest 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 ListCertificatesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificatesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificatesRequest; - - /** - * Creates a plain object from a ListCertificatesRequest message. Also converts values to other types if specified. - * @param message ListCertificatesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificatesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificatesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificatesResponse. */ - interface IListCertificatesResponse { - - /** ListCertificatesResponse certificates */ - certificates?: (google.cloud.security.privateca.v1beta1.ICertificate[]|null); - - /** ListCertificatesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListCertificatesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListCertificatesResponse. */ - class ListCertificatesResponse implements IListCertificatesResponse { - - /** - * Constructs a new ListCertificatesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificatesResponse); - - /** ListCertificatesResponse certificates. */ - public certificates: google.cloud.security.privateca.v1beta1.ICertificate[]; - - /** ListCertificatesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListCertificatesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListCertificatesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificatesResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificatesResponse): google.cloud.security.privateca.v1beta1.ListCertificatesResponse; - - /** - * Encodes the specified ListCertificatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesResponse.verify|verify} messages. - * @param message ListCertificatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesResponse.verify|verify} messages. - * @param message ListCertificatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificatesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificatesResponse - * @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.security.privateca.v1beta1.ListCertificatesResponse; - - /** - * Decodes a ListCertificatesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificatesResponse - * @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.security.privateca.v1beta1.ListCertificatesResponse; - - /** - * Verifies a ListCertificatesResponse 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 ListCertificatesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificatesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificatesResponse; - - /** - * Creates a plain object from a ListCertificatesResponse message. Also converts values to other types if specified. - * @param message ListCertificatesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificatesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificatesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RevokeCertificateRequest. */ - interface IRevokeCertificateRequest { - - /** RevokeCertificateRequest name */ - name?: (string|null); - - /** RevokeCertificateRequest reason */ - reason?: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason|null); - - /** RevokeCertificateRequest requestId */ - requestId?: (string|null); - } - - /** Represents a RevokeCertificateRequest. */ - class RevokeCertificateRequest implements IRevokeCertificateRequest { - - /** - * Constructs a new RevokeCertificateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest); - - /** RevokeCertificateRequest name. */ - public name: string; - - /** RevokeCertificateRequest reason. */ - public reason: (google.cloud.security.privateca.v1beta1.RevocationReason|keyof typeof google.cloud.security.privateca.v1beta1.RevocationReason); - - /** RevokeCertificateRequest requestId. */ - public requestId: string; - - /** - * Creates a new RevokeCertificateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RevokeCertificateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest): google.cloud.security.privateca.v1beta1.RevokeCertificateRequest; - - /** - * Encodes the specified RevokeCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RevokeCertificateRequest.verify|verify} messages. - * @param message RevokeCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevokeCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RevokeCertificateRequest.verify|verify} messages. - * @param message RevokeCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevokeCertificateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevokeCertificateRequest - * @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.security.privateca.v1beta1.RevokeCertificateRequest; - - /** - * Decodes a RevokeCertificateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevokeCertificateRequest - * @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.security.privateca.v1beta1.RevokeCertificateRequest; - - /** - * Verifies a RevokeCertificateRequest 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 RevokeCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevokeCertificateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.RevokeCertificateRequest; - - /** - * Creates a plain object from a RevokeCertificateRequest message. Also converts values to other types if specified. - * @param message RevokeCertificateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.RevokeCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevokeCertificateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevokeCertificateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCertificateRequest. */ - interface IUpdateCertificateRequest { - - /** UpdateCertificateRequest certificate */ - certificate?: (google.cloud.security.privateca.v1beta1.ICertificate|null); - - /** UpdateCertificateRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateCertificateRequest. */ - class UpdateCertificateRequest implements IUpdateCertificateRequest { - - /** - * Constructs a new UpdateCertificateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest); - - /** UpdateCertificateRequest certificate. */ - public certificate?: (google.cloud.security.privateca.v1beta1.ICertificate|null); - - /** UpdateCertificateRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateCertificateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCertificateRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest): google.cloud.security.privateca.v1beta1.UpdateCertificateRequest; - - /** - * Encodes the specified UpdateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.verify|verify} messages. - * @param message UpdateCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.verify|verify} messages. - * @param message UpdateCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCertificateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCertificateRequest - * @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.security.privateca.v1beta1.UpdateCertificateRequest; - - /** - * Decodes an UpdateCertificateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCertificateRequest - * @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.security.privateca.v1beta1.UpdateCertificateRequest; - - /** - * Verifies an UpdateCertificateRequest 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 UpdateCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCertificateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.UpdateCertificateRequest; - - /** - * Creates a plain object from an UpdateCertificateRequest message. Also converts values to other types if specified. - * @param message UpdateCertificateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.UpdateCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCertificateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCertificateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ActivateCertificateAuthorityRequest. */ - interface IActivateCertificateAuthorityRequest { - - /** ActivateCertificateAuthorityRequest name */ - name?: (string|null); - - /** ActivateCertificateAuthorityRequest pemCaCertificate */ - pemCaCertificate?: (string|null); - - /** ActivateCertificateAuthorityRequest subordinateConfig */ - subordinateConfig?: (google.cloud.security.privateca.v1beta1.ISubordinateConfig|null); - - /** ActivateCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents an ActivateCertificateAuthorityRequest. */ - class ActivateCertificateAuthorityRequest implements IActivateCertificateAuthorityRequest { - - /** - * Constructs a new ActivateCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest); - - /** ActivateCertificateAuthorityRequest name. */ - public name: string; - - /** ActivateCertificateAuthorityRequest pemCaCertificate. */ - public pemCaCertificate: string; - - /** ActivateCertificateAuthorityRequest subordinateConfig. */ - public subordinateConfig?: (google.cloud.security.privateca.v1beta1.ISubordinateConfig|null); - - /** ActivateCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new ActivateCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ActivateCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest; - - /** - * Encodes the specified ActivateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest.verify|verify} messages. - * @param message ActivateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ActivateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest.verify|verify} messages. - * @param message ActivateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ActivateCertificateAuthorityRequest - * @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.security.privateca.v1beta1.ActivateCertificateAuthorityRequest; - - /** - * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ActivateCertificateAuthorityRequest - * @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.security.privateca.v1beta1.ActivateCertificateAuthorityRequest; - - /** - * Verifies an ActivateCertificateAuthorityRequest 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 ActivateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ActivateCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest; - - /** - * Creates a plain object from an ActivateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message ActivateCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ActivateCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ActivateCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateCertificateAuthorityRequest. */ - interface ICreateCertificateAuthorityRequest { - - /** CreateCertificateAuthorityRequest parent */ - parent?: (string|null); - - /** CreateCertificateAuthorityRequest certificateAuthorityId */ - certificateAuthorityId?: (string|null); - - /** CreateCertificateAuthorityRequest certificateAuthority */ - certificateAuthority?: (google.cloud.security.privateca.v1beta1.ICertificateAuthority|null); - - /** CreateCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateCertificateAuthorityRequest. */ - class CreateCertificateAuthorityRequest implements ICreateCertificateAuthorityRequest { - - /** - * Constructs a new CreateCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest); - - /** CreateCertificateAuthorityRequest parent. */ - public parent: string; - - /** CreateCertificateAuthorityRequest certificateAuthorityId. */ - public certificateAuthorityId: string; - - /** CreateCertificateAuthorityRequest certificateAuthority. */ - public certificateAuthority?: (google.cloud.security.privateca.v1beta1.ICertificateAuthority|null); - - /** CreateCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest; - - /** - * Encodes the specified CreateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest.verify|verify} messages. - * @param message CreateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest.verify|verify} messages. - * @param message CreateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCertificateAuthorityRequest - * @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.security.privateca.v1beta1.CreateCertificateAuthorityRequest; - - /** - * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCertificateAuthorityRequest - * @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.security.privateca.v1beta1.CreateCertificateAuthorityRequest; - - /** - * Verifies a CreateCertificateAuthorityRequest 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 CreateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest; - - /** - * Creates a plain object from a CreateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message CreateCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisableCertificateAuthorityRequest. */ - interface IDisableCertificateAuthorityRequest { - - /** DisableCertificateAuthorityRequest name */ - name?: (string|null); - - /** DisableCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DisableCertificateAuthorityRequest. */ - class DisableCertificateAuthorityRequest implements IDisableCertificateAuthorityRequest { - - /** - * Constructs a new DisableCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest); - - /** DisableCertificateAuthorityRequest name. */ - public name: string; - - /** DisableCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new DisableCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DisableCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest; - - /** - * Encodes the specified DisableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest.verify|verify} messages. - * @param message DisableCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest.verify|verify} messages. - * @param message DisableCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisableCertificateAuthorityRequest - * @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.security.privateca.v1beta1.DisableCertificateAuthorityRequest; - - /** - * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisableCertificateAuthorityRequest - * @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.security.privateca.v1beta1.DisableCertificateAuthorityRequest; - - /** - * Verifies a DisableCertificateAuthorityRequest 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 DisableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisableCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest; - - /** - * Creates a plain object from a DisableCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message DisableCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisableCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisableCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnableCertificateAuthorityRequest. */ - interface IEnableCertificateAuthorityRequest { - - /** EnableCertificateAuthorityRequest name */ - name?: (string|null); - - /** EnableCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents an EnableCertificateAuthorityRequest. */ - class EnableCertificateAuthorityRequest implements IEnableCertificateAuthorityRequest { - - /** - * Constructs a new EnableCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest); - - /** EnableCertificateAuthorityRequest name. */ - public name: string; - - /** EnableCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new EnableCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns EnableCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest; - - /** - * Encodes the specified EnableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest.verify|verify} messages. - * @param message EnableCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest.verify|verify} messages. - * @param message EnableCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnableCertificateAuthorityRequest - * @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.security.privateca.v1beta1.EnableCertificateAuthorityRequest; - - /** - * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnableCertificateAuthorityRequest - * @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.security.privateca.v1beta1.EnableCertificateAuthorityRequest; - - /** - * Verifies an EnableCertificateAuthorityRequest 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 EnableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnableCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest; - - /** - * Creates a plain object from an EnableCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message EnableCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnableCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnableCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchCertificateAuthorityCsrRequest. */ - interface IFetchCertificateAuthorityCsrRequest { - - /** FetchCertificateAuthorityCsrRequest name */ - name?: (string|null); - } - - /** Represents a FetchCertificateAuthorityCsrRequest. */ - class FetchCertificateAuthorityCsrRequest implements IFetchCertificateAuthorityCsrRequest { - - /** - * Constructs a new FetchCertificateAuthorityCsrRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest); - - /** FetchCertificateAuthorityCsrRequest name. */ - public name: string; - - /** - * Creates a new FetchCertificateAuthorityCsrRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchCertificateAuthorityCsrRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest): google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest; - - /** - * Encodes the specified FetchCertificateAuthorityCsrRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. - * @param message FetchCertificateAuthorityCsrRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchCertificateAuthorityCsrRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. - * @param message FetchCertificateAuthorityCsrRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchCertificateAuthorityCsrRequest - * @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.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest; - - /** - * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchCertificateAuthorityCsrRequest - * @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.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest; - - /** - * Verifies a FetchCertificateAuthorityCsrRequest 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 FetchCertificateAuthorityCsrRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchCertificateAuthorityCsrRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest; - - /** - * Creates a plain object from a FetchCertificateAuthorityCsrRequest message. Also converts values to other types if specified. - * @param message FetchCertificateAuthorityCsrRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchCertificateAuthorityCsrRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchCertificateAuthorityCsrRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchCertificateAuthorityCsrResponse. */ - interface IFetchCertificateAuthorityCsrResponse { - - /** FetchCertificateAuthorityCsrResponse pemCsr */ - pemCsr?: (string|null); - } - - /** Represents a FetchCertificateAuthorityCsrResponse. */ - class FetchCertificateAuthorityCsrResponse implements IFetchCertificateAuthorityCsrResponse { - - /** - * Constructs a new FetchCertificateAuthorityCsrResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse); - - /** FetchCertificateAuthorityCsrResponse pemCsr. */ - public pemCsr: string; - - /** - * Creates a new FetchCertificateAuthorityCsrResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchCertificateAuthorityCsrResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse): google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse; - - /** - * Encodes the specified FetchCertificateAuthorityCsrResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. - * @param message FetchCertificateAuthorityCsrResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchCertificateAuthorityCsrResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. - * @param message FetchCertificateAuthorityCsrResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchCertificateAuthorityCsrResponse - * @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.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse; - - /** - * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchCertificateAuthorityCsrResponse - * @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.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse; - - /** - * Verifies a FetchCertificateAuthorityCsrResponse 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 FetchCertificateAuthorityCsrResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchCertificateAuthorityCsrResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse; - - /** - * Creates a plain object from a FetchCertificateAuthorityCsrResponse message. Also converts values to other types if specified. - * @param message FetchCertificateAuthorityCsrResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchCertificateAuthorityCsrResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchCertificateAuthorityCsrResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCertificateAuthorityRequest. */ - interface IGetCertificateAuthorityRequest { - - /** GetCertificateAuthorityRequest name */ - name?: (string|null); - } - - /** Represents a GetCertificateAuthorityRequest. */ - class GetCertificateAuthorityRequest implements IGetCertificateAuthorityRequest { - - /** - * Constructs a new GetCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest); - - /** GetCertificateAuthorityRequest name. */ - public name: string; - - /** - * Creates a new GetCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest; - - /** - * Encodes the specified GetCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest.verify|verify} messages. - * @param message GetCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest.verify|verify} messages. - * @param message GetCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCertificateAuthorityRequest - * @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.security.privateca.v1beta1.GetCertificateAuthorityRequest; - - /** - * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCertificateAuthorityRequest - * @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.security.privateca.v1beta1.GetCertificateAuthorityRequest; - - /** - * Verifies a GetCertificateAuthorityRequest 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 GetCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest; - - /** - * Creates a plain object from a GetCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message GetCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificateAuthoritiesRequest. */ - interface IListCertificateAuthoritiesRequest { - - /** ListCertificateAuthoritiesRequest parent */ - parent?: (string|null); - - /** ListCertificateAuthoritiesRequest pageSize */ - pageSize?: (number|null); - - /** ListCertificateAuthoritiesRequest pageToken */ - pageToken?: (string|null); - - /** ListCertificateAuthoritiesRequest filter */ - filter?: (string|null); - - /** ListCertificateAuthoritiesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListCertificateAuthoritiesRequest. */ - class ListCertificateAuthoritiesRequest implements IListCertificateAuthoritiesRequest { - - /** - * Constructs a new ListCertificateAuthoritiesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest); - - /** ListCertificateAuthoritiesRequest parent. */ - public parent: string; - - /** ListCertificateAuthoritiesRequest pageSize. */ - public pageSize: number; - - /** ListCertificateAuthoritiesRequest pageToken. */ - public pageToken: string; - - /** ListCertificateAuthoritiesRequest filter. */ - public filter: string; - - /** ListCertificateAuthoritiesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListCertificateAuthoritiesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificateAuthoritiesRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest): google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest; - - /** - * Encodes the specified ListCertificateAuthoritiesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest.verify|verify} messages. - * @param message ListCertificateAuthoritiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificateAuthoritiesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest.verify|verify} messages. - * @param message ListCertificateAuthoritiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificateAuthoritiesRequest - * @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.security.privateca.v1beta1.ListCertificateAuthoritiesRequest; - - /** - * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificateAuthoritiesRequest - * @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.security.privateca.v1beta1.ListCertificateAuthoritiesRequest; - - /** - * Verifies a ListCertificateAuthoritiesRequest 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 ListCertificateAuthoritiesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificateAuthoritiesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest; - - /** - * Creates a plain object from a ListCertificateAuthoritiesRequest message. Also converts values to other types if specified. - * @param message ListCertificateAuthoritiesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificateAuthoritiesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificateAuthoritiesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificateAuthoritiesResponse. */ - interface IListCertificateAuthoritiesResponse { - - /** ListCertificateAuthoritiesResponse certificateAuthorities */ - certificateAuthorities?: (google.cloud.security.privateca.v1beta1.ICertificateAuthority[]|null); - - /** ListCertificateAuthoritiesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListCertificateAuthoritiesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListCertificateAuthoritiesResponse. */ - class ListCertificateAuthoritiesResponse implements IListCertificateAuthoritiesResponse { - - /** - * Constructs a new ListCertificateAuthoritiesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse); - - /** ListCertificateAuthoritiesResponse certificateAuthorities. */ - public certificateAuthorities: google.cloud.security.privateca.v1beta1.ICertificateAuthority[]; - - /** ListCertificateAuthoritiesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListCertificateAuthoritiesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListCertificateAuthoritiesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificateAuthoritiesResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse): google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse; - - /** - * Encodes the specified ListCertificateAuthoritiesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.verify|verify} messages. - * @param message ListCertificateAuthoritiesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificateAuthoritiesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.verify|verify} messages. - * @param message ListCertificateAuthoritiesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificateAuthoritiesResponse - * @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.security.privateca.v1beta1.ListCertificateAuthoritiesResponse; - - /** - * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificateAuthoritiesResponse - * @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.security.privateca.v1beta1.ListCertificateAuthoritiesResponse; - - /** - * Verifies a ListCertificateAuthoritiesResponse 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 ListCertificateAuthoritiesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificateAuthoritiesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse; - - /** - * Creates a plain object from a ListCertificateAuthoritiesResponse message. Also converts values to other types if specified. - * @param message ListCertificateAuthoritiesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificateAuthoritiesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificateAuthoritiesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreCertificateAuthorityRequest. */ - interface IRestoreCertificateAuthorityRequest { - - /** RestoreCertificateAuthorityRequest name */ - name?: (string|null); - - /** RestoreCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents a RestoreCertificateAuthorityRequest. */ - class RestoreCertificateAuthorityRequest implements IRestoreCertificateAuthorityRequest { - - /** - * Constructs a new RestoreCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest); - - /** RestoreCertificateAuthorityRequest name. */ - public name: string; - - /** RestoreCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new RestoreCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest; - - /** - * Encodes the specified RestoreCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest.verify|verify} messages. - * @param message RestoreCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest.verify|verify} messages. - * @param message RestoreCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreCertificateAuthorityRequest - * @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.security.privateca.v1beta1.RestoreCertificateAuthorityRequest; - - /** - * Decodes a RestoreCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreCertificateAuthorityRequest - * @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.security.privateca.v1beta1.RestoreCertificateAuthorityRequest; - - /** - * Verifies a RestoreCertificateAuthorityRequest 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 RestoreCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest; - - /** - * Creates a plain object from a RestoreCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message RestoreCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ScheduleDeleteCertificateAuthorityRequest. */ - interface IScheduleDeleteCertificateAuthorityRequest { - - /** ScheduleDeleteCertificateAuthorityRequest name */ - name?: (string|null); - - /** ScheduleDeleteCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents a ScheduleDeleteCertificateAuthorityRequest. */ - class ScheduleDeleteCertificateAuthorityRequest implements IScheduleDeleteCertificateAuthorityRequest { - - /** - * Constructs a new ScheduleDeleteCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest); - - /** ScheduleDeleteCertificateAuthorityRequest name. */ - public name: string; - - /** ScheduleDeleteCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new ScheduleDeleteCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ScheduleDeleteCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest; - - /** - * Encodes the specified ScheduleDeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest.verify|verify} messages. - * @param message ScheduleDeleteCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ScheduleDeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest.verify|verify} messages. - * @param message ScheduleDeleteCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ScheduleDeleteCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ScheduleDeleteCertificateAuthorityRequest - * @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.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest; - - /** - * Decodes a ScheduleDeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ScheduleDeleteCertificateAuthorityRequest - * @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.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest; - - /** - * Verifies a ScheduleDeleteCertificateAuthorityRequest 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 ScheduleDeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ScheduleDeleteCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest; - - /** - * Creates a plain object from a ScheduleDeleteCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message ScheduleDeleteCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ScheduleDeleteCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ScheduleDeleteCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCertificateAuthorityRequest. */ - interface IUpdateCertificateAuthorityRequest { - - /** UpdateCertificateAuthorityRequest certificateAuthority */ - certificateAuthority?: (google.cloud.security.privateca.v1beta1.ICertificateAuthority|null); - - /** UpdateCertificateAuthorityRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateAuthorityRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateCertificateAuthorityRequest. */ - class UpdateCertificateAuthorityRequest implements IUpdateCertificateAuthorityRequest { - - /** - * Constructs a new UpdateCertificateAuthorityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest); - - /** UpdateCertificateAuthorityRequest certificateAuthority. */ - public certificateAuthority?: (google.cloud.security.privateca.v1beta1.ICertificateAuthority|null); - - /** UpdateCertificateAuthorityRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateAuthorityRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateCertificateAuthorityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCertificateAuthorityRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest): google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest; - - /** - * Encodes the specified UpdateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.verify|verify} messages. - * @param message UpdateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.verify|verify} messages. - * @param message UpdateCertificateAuthorityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCertificateAuthorityRequest - * @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.security.privateca.v1beta1.UpdateCertificateAuthorityRequest; - - /** - * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCertificateAuthorityRequest - * @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.security.privateca.v1beta1.UpdateCertificateAuthorityRequest; - - /** - * Verifies an UpdateCertificateAuthorityRequest 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 UpdateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCertificateAuthorityRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest; - - /** - * Creates a plain object from an UpdateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @param message UpdateCertificateAuthorityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCertificateAuthorityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCertificateAuthorityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCertificateRevocationListRequest. */ - interface IGetCertificateRevocationListRequest { - - /** GetCertificateRevocationListRequest name */ - name?: (string|null); - } - - /** Represents a GetCertificateRevocationListRequest. */ - class GetCertificateRevocationListRequest implements IGetCertificateRevocationListRequest { - - /** - * Constructs a new GetCertificateRevocationListRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest); - - /** GetCertificateRevocationListRequest name. */ - public name: string; - - /** - * Creates a new GetCertificateRevocationListRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCertificateRevocationListRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest): google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest; - - /** - * Encodes the specified GetCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest.verify|verify} messages. - * @param message GetCertificateRevocationListRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest.verify|verify} messages. - * @param message GetCertificateRevocationListRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCertificateRevocationListRequest - * @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.security.privateca.v1beta1.GetCertificateRevocationListRequest; - - /** - * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCertificateRevocationListRequest - * @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.security.privateca.v1beta1.GetCertificateRevocationListRequest; - - /** - * Verifies a GetCertificateRevocationListRequest 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 GetCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCertificateRevocationListRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest; - - /** - * Creates a plain object from a GetCertificateRevocationListRequest message. Also converts values to other types if specified. - * @param message GetCertificateRevocationListRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCertificateRevocationListRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCertificateRevocationListRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificateRevocationListsRequest. */ - interface IListCertificateRevocationListsRequest { - - /** ListCertificateRevocationListsRequest parent */ - parent?: (string|null); - - /** ListCertificateRevocationListsRequest pageSize */ - pageSize?: (number|null); - - /** ListCertificateRevocationListsRequest pageToken */ - pageToken?: (string|null); - - /** ListCertificateRevocationListsRequest filter */ - filter?: (string|null); - - /** ListCertificateRevocationListsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListCertificateRevocationListsRequest. */ - class ListCertificateRevocationListsRequest implements IListCertificateRevocationListsRequest { - - /** - * Constructs a new ListCertificateRevocationListsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest); - - /** ListCertificateRevocationListsRequest parent. */ - public parent: string; - - /** ListCertificateRevocationListsRequest pageSize. */ - public pageSize: number; - - /** ListCertificateRevocationListsRequest pageToken. */ - public pageToken: string; - - /** ListCertificateRevocationListsRequest filter. */ - public filter: string; - - /** ListCertificateRevocationListsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListCertificateRevocationListsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificateRevocationListsRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest): google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest; - - /** - * Encodes the specified ListCertificateRevocationListsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest.verify|verify} messages. - * @param message ListCertificateRevocationListsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificateRevocationListsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest.verify|verify} messages. - * @param message ListCertificateRevocationListsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificateRevocationListsRequest - * @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.security.privateca.v1beta1.ListCertificateRevocationListsRequest; - - /** - * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificateRevocationListsRequest - * @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.security.privateca.v1beta1.ListCertificateRevocationListsRequest; - - /** - * Verifies a ListCertificateRevocationListsRequest 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 ListCertificateRevocationListsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificateRevocationListsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest; - - /** - * Creates a plain object from a ListCertificateRevocationListsRequest message. Also converts values to other types if specified. - * @param message ListCertificateRevocationListsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificateRevocationListsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificateRevocationListsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCertificateRevocationListsResponse. */ - interface IListCertificateRevocationListsResponse { - - /** ListCertificateRevocationListsResponse certificateRevocationLists */ - certificateRevocationLists?: (google.cloud.security.privateca.v1beta1.ICertificateRevocationList[]|null); - - /** ListCertificateRevocationListsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListCertificateRevocationListsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListCertificateRevocationListsResponse. */ - class ListCertificateRevocationListsResponse implements IListCertificateRevocationListsResponse { - - /** - * Constructs a new ListCertificateRevocationListsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse); - - /** ListCertificateRevocationListsResponse certificateRevocationLists. */ - public certificateRevocationLists: google.cloud.security.privateca.v1beta1.ICertificateRevocationList[]; - - /** ListCertificateRevocationListsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListCertificateRevocationListsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListCertificateRevocationListsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCertificateRevocationListsResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse): google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse; - - /** - * Encodes the specified ListCertificateRevocationListsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.verify|verify} messages. - * @param message ListCertificateRevocationListsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCertificateRevocationListsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.verify|verify} messages. - * @param message ListCertificateRevocationListsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCertificateRevocationListsResponse - * @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.security.privateca.v1beta1.ListCertificateRevocationListsResponse; - - /** - * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCertificateRevocationListsResponse - * @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.security.privateca.v1beta1.ListCertificateRevocationListsResponse; - - /** - * Verifies a ListCertificateRevocationListsResponse 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 ListCertificateRevocationListsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCertificateRevocationListsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse; - - /** - * Creates a plain object from a ListCertificateRevocationListsResponse message. Also converts values to other types if specified. - * @param message ListCertificateRevocationListsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCertificateRevocationListsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCertificateRevocationListsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCertificateRevocationListRequest. */ - interface IUpdateCertificateRevocationListRequest { - - /** UpdateCertificateRevocationListRequest certificateRevocationList */ - certificateRevocationList?: (google.cloud.security.privateca.v1beta1.ICertificateRevocationList|null); - - /** UpdateCertificateRevocationListRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateRevocationListRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateCertificateRevocationListRequest. */ - class UpdateCertificateRevocationListRequest implements IUpdateCertificateRevocationListRequest { - - /** - * Constructs a new UpdateCertificateRevocationListRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest); - - /** UpdateCertificateRevocationListRequest certificateRevocationList. */ - public certificateRevocationList?: (google.cloud.security.privateca.v1beta1.ICertificateRevocationList|null); - - /** UpdateCertificateRevocationListRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateCertificateRevocationListRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateCertificateRevocationListRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCertificateRevocationListRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest): google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest; - - /** - * Encodes the specified UpdateCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.verify|verify} messages. - * @param message UpdateCertificateRevocationListRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.verify|verify} messages. - * @param message UpdateCertificateRevocationListRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCertificateRevocationListRequest - * @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.security.privateca.v1beta1.UpdateCertificateRevocationListRequest; - - /** - * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCertificateRevocationListRequest - * @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.security.privateca.v1beta1.UpdateCertificateRevocationListRequest; - - /** - * Verifies an UpdateCertificateRevocationListRequest 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 UpdateCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCertificateRevocationListRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest; - - /** - * Creates a plain object from an UpdateCertificateRevocationListRequest message. Also converts values to other types if specified. - * @param message UpdateCertificateRevocationListRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCertificateRevocationListRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCertificateRevocationListRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetReusableConfigRequest. */ - interface IGetReusableConfigRequest { - - /** GetReusableConfigRequest name */ - name?: (string|null); - } - - /** Represents a GetReusableConfigRequest. */ - class GetReusableConfigRequest implements IGetReusableConfigRequest { - - /** - * Constructs a new GetReusableConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest); - - /** GetReusableConfigRequest name. */ - public name: string; - - /** - * Creates a new GetReusableConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetReusableConfigRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest): google.cloud.security.privateca.v1beta1.GetReusableConfigRequest; - - /** - * Encodes the specified GetReusableConfigRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetReusableConfigRequest.verify|verify} messages. - * @param message GetReusableConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetReusableConfigRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetReusableConfigRequest.verify|verify} messages. - * @param message GetReusableConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetReusableConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetReusableConfigRequest - * @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.security.privateca.v1beta1.GetReusableConfigRequest; - - /** - * Decodes a GetReusableConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetReusableConfigRequest - * @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.security.privateca.v1beta1.GetReusableConfigRequest; - - /** - * Verifies a GetReusableConfigRequest 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 GetReusableConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetReusableConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.GetReusableConfigRequest; - - /** - * Creates a plain object from a GetReusableConfigRequest message. Also converts values to other types if specified. - * @param message GetReusableConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.GetReusableConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetReusableConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetReusableConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListReusableConfigsRequest. */ - interface IListReusableConfigsRequest { - - /** ListReusableConfigsRequest parent */ - parent?: (string|null); - - /** ListReusableConfigsRequest pageSize */ - pageSize?: (number|null); - - /** ListReusableConfigsRequest pageToken */ - pageToken?: (string|null); - - /** ListReusableConfigsRequest filter */ - filter?: (string|null); - - /** ListReusableConfigsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListReusableConfigsRequest. */ - class ListReusableConfigsRequest implements IListReusableConfigsRequest { - - /** - * Constructs a new ListReusableConfigsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest); - - /** ListReusableConfigsRequest parent. */ - public parent: string; - - /** ListReusableConfigsRequest pageSize. */ - public pageSize: number; - - /** ListReusableConfigsRequest pageToken. */ - public pageToken: string; - - /** ListReusableConfigsRequest filter. */ - public filter: string; - - /** ListReusableConfigsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListReusableConfigsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListReusableConfigsRequest instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest): google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest; - - /** - * Encodes the specified ListReusableConfigsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest.verify|verify} messages. - * @param message ListReusableConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListReusableConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest.verify|verify} messages. - * @param message ListReusableConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListReusableConfigsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListReusableConfigsRequest - * @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.security.privateca.v1beta1.ListReusableConfigsRequest; - - /** - * Decodes a ListReusableConfigsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListReusableConfigsRequest - * @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.security.privateca.v1beta1.ListReusableConfigsRequest; - - /** - * Verifies a ListReusableConfigsRequest 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 ListReusableConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListReusableConfigsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest; - - /** - * Creates a plain object from a ListReusableConfigsRequest message. Also converts values to other types if specified. - * @param message ListReusableConfigsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListReusableConfigsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListReusableConfigsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListReusableConfigsResponse. */ - interface IListReusableConfigsResponse { - - /** ListReusableConfigsResponse reusableConfigs */ - reusableConfigs?: (google.cloud.security.privateca.v1beta1.IReusableConfig[]|null); - - /** ListReusableConfigsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListReusableConfigsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListReusableConfigsResponse. */ - class ListReusableConfigsResponse implements IListReusableConfigsResponse { - - /** - * Constructs a new ListReusableConfigsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse); - - /** ListReusableConfigsResponse reusableConfigs. */ - public reusableConfigs: google.cloud.security.privateca.v1beta1.IReusableConfig[]; - - /** ListReusableConfigsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListReusableConfigsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListReusableConfigsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListReusableConfigsResponse instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse): google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse; - - /** - * Encodes the specified ListReusableConfigsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.verify|verify} messages. - * @param message ListReusableConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListReusableConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.verify|verify} messages. - * @param message ListReusableConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListReusableConfigsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListReusableConfigsResponse - * @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.security.privateca.v1beta1.ListReusableConfigsResponse; - - /** - * Decodes a ListReusableConfigsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListReusableConfigsResponse - * @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.security.privateca.v1beta1.ListReusableConfigsResponse; - - /** - * Verifies a ListReusableConfigsResponse 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 ListReusableConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListReusableConfigsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse; - - /** - * Creates a plain object from a ListReusableConfigsResponse message. Also converts values to other types if specified. - * @param message ListReusableConfigsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListReusableConfigsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListReusableConfigsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.security.privateca.v1beta1.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** OperationMetadata apiVersion. */ - public apiVersion: string; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.security.privateca.v1beta1.IOperationMetadata): google.cloud.security.privateca.v1beta1.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.security.privateca.v1beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.security.privateca.v1beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.security.privateca.v1beta1.OperationMetadata; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.security.privateca.v1beta1.OperationMetadata; - - /** - * Verifies an OperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1beta1.OperationMetadata; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.security.privateca.v1beta1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @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); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: 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; - - /** - * 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 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; - - /** - * 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 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; - - /** - * 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); - - /** - * 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 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 }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - - /** CommonLanguageSettings selectiveGapicGeneration */ - selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** CommonLanguageSettings selectiveGapicGeneration. */ - public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @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.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @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.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @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.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @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.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @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.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @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.Publishing; - - /** - * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @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.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @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.JavaSettings; - - /** - * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @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.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @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.CppSettings; - - /** - * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @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.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @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.PhpSettings; - - /** - * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** PythonSettings experimentalFeatures */ - experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** PythonSettings experimentalFeatures. */ - public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @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.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @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.PythonSettings; - - /** - * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PythonSettings { - - /** Properties of an ExperimentalFeatures. */ - interface IExperimentalFeatures { - - /** ExperimentalFeatures restAsyncIoEnabled */ - restAsyncIoEnabled?: (boolean|null); - - /** ExperimentalFeatures protobufPythonicTypesEnabled */ - protobufPythonicTypesEnabled?: (boolean|null); - - /** ExperimentalFeatures unversionedPackageDisabled */ - unversionedPackageDisabled?: (boolean|null); - } - - /** Represents an ExperimentalFeatures. */ - class ExperimentalFeatures implements IExperimentalFeatures { - - /** - * Constructs a new ExperimentalFeatures. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); - - /** ExperimentalFeatures restAsyncIoEnabled. */ - public restAsyncIoEnabled: boolean; - - /** ExperimentalFeatures protobufPythonicTypesEnabled. */ - public protobufPythonicTypesEnabled: boolean; - - /** ExperimentalFeatures unversionedPackageDisabled. */ - public unversionedPackageDisabled: boolean; - - /** - * Creates a new ExperimentalFeatures instance using the specified properties. - * @param [properties] Properties to set - * @returns ExperimentalFeatures instance - */ - public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; - - /** - * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. - * @param message ExperimentalFeatures message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. - * @param message ExperimentalFeatures message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExperimentalFeatures message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExperimentalFeatures - * @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.PythonSettings.ExperimentalFeatures; - - /** - * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExperimentalFeatures - * @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.PythonSettings.ExperimentalFeatures; - - /** - * Verifies an ExperimentalFeatures 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 ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExperimentalFeatures - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; - - /** - * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. - * @param message ExperimentalFeatures - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExperimentalFeatures to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExperimentalFeatures - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @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.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @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.NodeSettings; - - /** - * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @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.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @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.DotnetSettings; - - /** - * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @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.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @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.RubySettings; - - /** - * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** GoSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** GoSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @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.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @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.GoSettings; - - /** - * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @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.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @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.MethodSettings; - - /** - * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @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.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @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.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** Properties of a SelectiveGapicGeneration. */ - interface ISelectiveGapicGeneration { - - /** SelectiveGapicGeneration methods */ - methods?: (string[]|null); - - /** SelectiveGapicGeneration generateOmittedAsInternal */ - generateOmittedAsInternal?: (boolean|null); - } - - /** Represents a SelectiveGapicGeneration. */ - class SelectiveGapicGeneration implements ISelectiveGapicGeneration { - - /** - * Constructs a new SelectiveGapicGeneration. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ISelectiveGapicGeneration); - - /** SelectiveGapicGeneration methods. */ - public methods: string[]; - - /** SelectiveGapicGeneration generateOmittedAsInternal. */ - public generateOmittedAsInternal: boolean; - - /** - * Creates a new SelectiveGapicGeneration instance using the specified properties. - * @param [properties] Properties to set - * @returns SelectiveGapicGeneration instance - */ - public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; - - /** - * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. - * @param message SelectiveGapicGeneration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. - * @param message SelectiveGapicGeneration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SelectiveGapicGeneration - * @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.SelectiveGapicGeneration; - - /** - * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SelectiveGapicGeneration - * @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.SelectiveGapicGeneration; - - /** - * Verifies a SelectiveGapicGeneration 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 SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SelectiveGapicGeneration - */ - public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; - - /** - * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. - * @param message SelectiveGapicGeneration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SelectiveGapicGeneration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SelectiveGapicGeneration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - - /** Properties of a FieldInfo. */ - interface IFieldInfo { - - /** FieldInfo format */ - format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); - - /** FieldInfo referencedTypes */ - referencedTypes?: (google.api.ITypeReference[]|null); - } - - /** Represents a FieldInfo. */ - class FieldInfo implements IFieldInfo { - - /** - * Constructs a new FieldInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IFieldInfo); - - /** FieldInfo format. */ - public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); - - /** FieldInfo referencedTypes. */ - public referencedTypes: google.api.ITypeReference[]; - - /** - * Creates a new FieldInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldInfo instance - */ - public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldInfo - * @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.FieldInfo; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldInfo - * @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.FieldInfo; - - /** - * Verifies a FieldInfo 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 FieldInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldInfo - */ - public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @param message FieldInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldInfo { - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - UUID4 = 1, - IPV4 = 2, - IPV6 = 3, - IPV4_OR_IPV6 = 4 - } - } - - /** Properties of a TypeReference. */ - interface ITypeReference { - - /** TypeReference typeName */ - typeName?: (string|null); - } - - /** Represents a TypeReference. */ - class TypeReference implements ITypeReference { - - /** - * Constructs a new TypeReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ITypeReference); - - /** TypeReference typeName. */ - public typeName: string; - - /** - * Creates a new TypeReference instance using the specified properties. - * @param [properties] Properties to set - * @returns TypeReference instance - */ - public static create(properties?: google.api.ITypeReference): google.api.TypeReference; - - /** - * Encodes the specified TypeReference message. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. - * @param message TypeReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ITypeReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TypeReference message, length delimited. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. - * @param message TypeReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ITypeReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TypeReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TypeReference - * @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.TypeReference; - - /** - * Decodes a TypeReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TypeReference - * @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.TypeReference; - - /** - * Verifies a TypeReference 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 TypeReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TypeReference - */ - public static fromObject(object: { [k: string]: any }): google.api.TypeReference; - - /** - * Creates a plain object from a TypeReference message. Also converts values to other types if specified. - * @param message TypeReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.TypeReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TypeReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TypeReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_LEGACY = 900, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** 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 optionDependency */ - optionDependency?: (string[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto optionDependency. */ - public optionDependency: string[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - - /** DescriptorProto visibility */ - visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** DescriptorProto visibility. */ - public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * 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; - - /** - * 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 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; - - /** - * 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 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; - - /** - * 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); - - /** - * 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 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 }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @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.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @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.Declaration; - - /** - * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * 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 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 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 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 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 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 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 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 FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** 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 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - - /** EnumDescriptorProto visibility */ - visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** EnumDescriptorProto visibility. */ - public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * 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 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 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 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 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 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 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 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 EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions featureSupport */ - featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - - /** FieldOptions .google.api.fieldInfo */ - ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions featureSupport. */ - public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @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.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @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.EditionDefault; - - /** - * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FeatureSupport. */ - interface IFeatureSupport { - - /** FeatureSupport editionIntroduced */ - editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSupport editionDeprecated */ - editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSupport deprecationWarning */ - deprecationWarning?: (string|null); - - /** FeatureSupport editionRemoved */ - editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSupport. */ - class FeatureSupport implements IFeatureSupport { - - /** - * Constructs a new FeatureSupport. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); - - /** FeatureSupport editionIntroduced. */ - public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSupport editionDeprecated. */ - public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSupport deprecationWarning. */ - public deprecationWarning: string; - - /** FeatureSupport editionRemoved. */ - public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSupport instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSupport instance - */ - public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; - - /** - * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. - * @param message FeatureSupport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. - * @param message FeatureSupport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSupport message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSupport - * @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.FeatureSupport; - - /** - * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSupport - * @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.FeatureSupport; - - /** - * Verifies a FeatureSupport 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 FeatureSupport message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSupport - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; - - /** - * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. - * @param message FeatureSupport - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSupport to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSupport - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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 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 }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions featureSupport */ - featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions featureSupport. */ - public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * 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 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 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 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 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 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 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 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 ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * 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 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; - - /** - * 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 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - - /** FeatureSet enforceNamingStyle */ - enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); - - /** FeatureSet defaultSymbolVisibility */ - defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** FeatureSet enforceNamingStyle. */ - public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); - - /** FeatureSet defaultSymbolVisibility. */ - public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @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.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @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.FeatureSet; - - /** - * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - - /** EnforceNamingStyle enum. */ - enum EnforceNamingStyle { - ENFORCE_NAMING_STYLE_UNKNOWN = 0, - STYLE2024 = 1, - STYLE_LEGACY = 2 - } - - /** Properties of a VisibilityFeature. */ - interface IVisibilityFeature { - } - - /** Represents a VisibilityFeature. */ - class VisibilityFeature implements IVisibilityFeature { - - /** - * Constructs a new VisibilityFeature. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); - - /** - * Creates a new VisibilityFeature instance using the specified properties. - * @param [properties] Properties to set - * @returns VisibilityFeature instance - */ - public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; - - /** - * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. - * @param message VisibilityFeature message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. - * @param message VisibilityFeature message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VisibilityFeature message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VisibilityFeature - * @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.FeatureSet.VisibilityFeature; - - /** - * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VisibilityFeature - * @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.FeatureSet.VisibilityFeature; - - /** - * Verifies a VisibilityFeature 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 VisibilityFeature message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VisibilityFeature - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; - - /** - * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. - * @param message VisibilityFeature - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VisibilityFeature to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VisibilityFeature - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace VisibilityFeature { - - /** DefaultSymbolVisibility enum. */ - enum DefaultSymbolVisibility { - DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, - EXPORT_ALL = 1, - EXPORT_TOP_LEVEL = 2, - LOCAL_ALL = 3, - STRICT = 4 - } - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @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.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @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.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault overridableFeatures */ - overridableFeatures?: (google.protobuf.IFeatureSet|null); - - /** FeatureSetEditionDefault fixedFeatures */ - fixedFeatures?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault overridableFeatures. */ - public overridableFeatures?: (google.protobuf.IFeatureSet|null); - - /** FeatureSetEditionDefault fixedFeatures. */ - public fixedFeatures?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @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.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @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.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|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); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** SymbolVisibility enum. */ - enum SymbolVisibility { - VISIBILITY_UNSET = 0, - VISIBILITY_LOCAL = 1, - VISIBILITY_EXPORT = 2 - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @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.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @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.Any; - - /** - * Verifies an Any 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 Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @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.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @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.Empty; - - /** - * Verifies an Empty 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 Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DoubleValue. */ - interface IDoubleValue { - - /** DoubleValue value */ - value?: (number|null); - } - - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { - - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); - - /** DoubleValue value. */ - public value: number; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @param [properties] Properties to set - * @returns DoubleValue instance - */ - public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoubleValue - * @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.DoubleValue; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoubleValue - * @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.DoubleValue; - - /** - * Verifies a DoubleValue 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 DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DoubleValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FloatValue. */ - interface IFloatValue { - - /** FloatValue value */ - value?: (number|null); - } - - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { - - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); - - /** FloatValue value. */ - public value: number; - - /** - * Creates a new FloatValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatValue instance - */ - public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatValue - * @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.FloatValue; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatValue - * @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.FloatValue; - - /** - * Verifies a FloatValue 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 FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FloatValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int64Value. */ - interface IInt64Value { - - /** Int64Value value */ - value?: (number|Long|string|null); - } - - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { - - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); - - /** Int64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new Int64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int64Value instance - */ - public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int64Value - * @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.Int64Value; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int64Value - * @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.Int64Value; - - /** - * Verifies an Int64Value 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 Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt64Value. */ - interface IUInt64Value { - - /** UInt64Value value */ - value?: (number|Long|string|null); - } - - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { - - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); - - /** UInt64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new UInt64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt64Value instance - */ - public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt64Value - * @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.UInt64Value; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt64Value - * @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.UInt64Value; - - /** - * Verifies a UInt64Value 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 UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int32Value. */ - interface IInt32Value { - - /** Int32Value value */ - value?: (number|null); - } - - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { - - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); - - /** Int32Value value. */ - public value: number; - - /** - * Creates a new Int32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int32Value instance - */ - public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int32Value - * @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.Int32Value; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int32Value - * @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.Int32Value; - - /** - * Verifies an Int32Value 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 Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt32Value. */ - interface IUInt32Value { - - /** UInt32Value value */ - value?: (number|null); - } - - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { - - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); - - /** UInt32Value value. */ - public value: number; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt32Value instance - */ - public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt32Value - * @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.UInt32Value; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt32Value - * @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.UInt32Value; - - /** - * Verifies a UInt32Value 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 UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoolValue. */ - interface IBoolValue { - - /** BoolValue value */ - value?: (boolean|null); - } - - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { - - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); - - /** BoolValue value. */ - public value: boolean; - - /** - * Creates a new BoolValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BoolValue instance - */ - public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoolValue - * @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.BoolValue; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoolValue - * @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.BoolValue; - - /** - * Verifies a BoolValue 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 BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoolValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StringValue. */ - interface IStringValue { - - /** StringValue value */ - value?: (string|null); - } - - /** Represents a StringValue. */ - class StringValue implements IStringValue { - - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); - - /** StringValue value. */ - public value: string; - - /** - * Creates a new StringValue instance using the specified properties. - * @param [properties] Properties to set - * @returns StringValue instance - */ - public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringValue - * @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.StringValue; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringValue - * @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.StringValue; - - /** - * Verifies a StringValue 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 StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new BytesValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BytesValue instance - */ - public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BytesValue - * @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.BytesValue; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BytesValue - * @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.BytesValue; - - /** - * Verifies a BytesValue 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 BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BytesValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of an Expr. */ - interface IExpr { - - /** Expr expression */ - expression?: (string|null); - - /** Expr title */ - title?: (string|null); - - /** Expr description */ - description?: (string|null); - - /** Expr location */ - location?: (string|null); - } - - /** Represents an Expr. */ - class Expr implements IExpr { - - /** - * Constructs a new Expr. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IExpr); - - /** Expr expression. */ - public expression: string; - - /** Expr title. */ - public title: string; - - /** Expr description. */ - public description: string; - - /** Expr location. */ - public location: string; - - /** - * 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 }; - - /** - * Gets the default type url for Expr - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations 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): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @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.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @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.longrunning.Operation; - - /** - * Verifies an Operation 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 Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @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.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @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.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest 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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @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.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @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.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @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.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @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.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse 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 ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @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.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @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.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest 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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @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.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @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.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest 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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @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.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @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.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest 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 WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @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.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @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.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo 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 OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @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.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @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.rpc.Status; - - /** - * Verifies a Status 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 Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/protos.js b/owl-bot-staging/google-cloud-security-privateca/protos/protos.js deleted file mode 100644 index c44fa93b948e..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/protos/protos.js +++ /dev/null @@ -1,68543 +0,0 @@ -// Copyright 2026 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. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_security_private_ca_protos || ($protobuf.roots._google_cloud_security_private_ca_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.security = (function() { - - /** - * Namespace security. - * @memberof google.cloud - * @namespace - */ - var security = {}; - - security.privateca = (function() { - - /** - * Namespace privateca. - * @memberof google.cloud.security - * @namespace - */ - var privateca = {}; - - privateca.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.cloud.security.privateca - * @namespace - */ - var v1 = {}; - - v1.CertificateAuthority = (function() { - - /** - * Properties of a CertificateAuthority. - * @memberof google.cloud.security.privateca.v1 - * @interface ICertificateAuthority - * @property {string|null} [name] CertificateAuthority name - * @property {google.cloud.security.privateca.v1.CertificateAuthority.Type|null} [type] CertificateAuthority type - * @property {google.cloud.security.privateca.v1.ICertificateConfig|null} [config] CertificateAuthority config - * @property {google.protobuf.IDuration|null} [lifetime] CertificateAuthority lifetime - * @property {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec|null} [keySpec] CertificateAuthority keySpec - * @property {google.cloud.security.privateca.v1.ISubordinateConfig|null} [subordinateConfig] CertificateAuthority subordinateConfig - * @property {google.cloud.security.privateca.v1.CaPool.Tier|null} [tier] CertificateAuthority tier - * @property {google.cloud.security.privateca.v1.CertificateAuthority.State|null} [state] CertificateAuthority state - * @property {Array.|null} [pemCaCertificates] CertificateAuthority pemCaCertificates - * @property {Array.|null} [caCertificateDescriptions] CertificateAuthority caCertificateDescriptions - * @property {string|null} [gcsBucket] CertificateAuthority gcsBucket - * @property {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls|null} [accessUrls] CertificateAuthority accessUrls - * @property {google.protobuf.ITimestamp|null} [createTime] CertificateAuthority createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateAuthority updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] CertificateAuthority deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] CertificateAuthority expireTime - * @property {Object.|null} [labels] CertificateAuthority labels - * @property {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls|null} [userDefinedAccessUrls] CertificateAuthority userDefinedAccessUrls - * @property {boolean|null} [satisfiesPzs] CertificateAuthority satisfiesPzs - * @property {boolean|null} [satisfiesPzi] CertificateAuthority satisfiesPzi - */ - - /** - * Constructs a new CertificateAuthority. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CertificateAuthority. - * @implements ICertificateAuthority - * @constructor - * @param {google.cloud.security.privateca.v1.ICertificateAuthority=} [properties] Properties to set - */ - function CertificateAuthority(properties) { - this.pemCaCertificates = []; - this.caCertificateDescriptions = []; - 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]]; - } - - /** - * CertificateAuthority name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.name = ""; - - /** - * CertificateAuthority type. - * @member {google.cloud.security.privateca.v1.CertificateAuthority.Type} type - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.type = 0; - - /** - * CertificateAuthority config. - * @member {google.cloud.security.privateca.v1.ICertificateConfig|null|undefined} config - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.config = null; - - /** - * CertificateAuthority lifetime. - * @member {google.protobuf.IDuration|null|undefined} lifetime - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.lifetime = null; - - /** - * CertificateAuthority keySpec. - * @member {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec|null|undefined} keySpec - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.keySpec = null; - - /** - * CertificateAuthority subordinateConfig. - * @member {google.cloud.security.privateca.v1.ISubordinateConfig|null|undefined} subordinateConfig - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.subordinateConfig = null; - - /** - * CertificateAuthority tier. - * @member {google.cloud.security.privateca.v1.CaPool.Tier} tier - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.tier = 0; - - /** - * CertificateAuthority state. - * @member {google.cloud.security.privateca.v1.CertificateAuthority.State} state - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.state = 0; - - /** - * CertificateAuthority pemCaCertificates. - * @member {Array.} pemCaCertificates - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.pemCaCertificates = $util.emptyArray; - - /** - * CertificateAuthority caCertificateDescriptions. - * @member {Array.} caCertificateDescriptions - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.caCertificateDescriptions = $util.emptyArray; - - /** - * CertificateAuthority gcsBucket. - * @member {string} gcsBucket - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.gcsBucket = ""; - - /** - * CertificateAuthority accessUrls. - * @member {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls|null|undefined} accessUrls - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.accessUrls = null; - - /** - * CertificateAuthority createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.createTime = null; - - /** - * CertificateAuthority updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.updateTime = null; - - /** - * CertificateAuthority deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.deleteTime = null; - - /** - * CertificateAuthority expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.expireTime = null; - - /** - * CertificateAuthority labels. - * @member {Object.} labels - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.labels = $util.emptyObject; - - /** - * CertificateAuthority userDefinedAccessUrls. - * @member {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls|null|undefined} userDefinedAccessUrls - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.userDefinedAccessUrls = null; - - /** - * CertificateAuthority satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.satisfiesPzs = false; - - /** - * CertificateAuthority satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.satisfiesPzi = false; - - /** - * Creates a new CertificateAuthority instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @static - * @param {google.cloud.security.privateca.v1.ICertificateAuthority=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateAuthority} CertificateAuthority instance - */ - CertificateAuthority.create = function create(properties) { - return new CertificateAuthority(properties); - }; - - /** - * Encodes the specified CertificateAuthority message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @static - * @param {google.cloud.security.privateca.v1.ICertificateAuthority} message CertificateAuthority message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateAuthority.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.security.privateca.v1.CertificateConfig.encode(message.config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) - $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.keySpec != null && Object.hasOwnProperty.call(message, "keySpec")) - $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.encode(message.keySpec, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.subordinateConfig != null && Object.hasOwnProperty.call(message, "subordinateConfig")) - $root.google.cloud.security.privateca.v1.SubordinateConfig.encode(message.subordinateConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.tier); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.pemCaCertificates != null && message.pemCaCertificates.length) - for (var i = 0; i < message.pemCaCertificates.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.pemCaCertificates[i]); - if (message.caCertificateDescriptions != null && message.caCertificateDescriptions.length) - for (var i = 0; i < message.caCertificateDescriptions.length; ++i) - $root.google.cloud.security.privateca.v1.CertificateDescription.encode(message.caCertificateDescriptions[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.gcsBucket); - if (message.accessUrls != null && Object.hasOwnProperty.call(message, "accessUrls")) - $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.encode(message.accessUrls, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 17, wireType 2 =*/138).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.userDefinedAccessUrls != null && Object.hasOwnProperty.call(message, "userDefinedAccessUrls")) - $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.encode(message.userDefinedAccessUrls, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 19, wireType 0 =*/152).bool(message.satisfiesPzs); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.satisfiesPzi); - return writer; - }; - - /** - * Encodes the specified CertificateAuthority message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @static - * @param {google.cloud.security.privateca.v1.ICertificateAuthority} message CertificateAuthority message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateAuthority.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateAuthority message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateAuthority} CertificateAuthority - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateAuthority.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateAuthority(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - case 3: { - message.config = $root.google.cloud.security.privateca.v1.CertificateConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.keySpec = $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.decode(reader, reader.uint32()); - break; - } - case 6: { - message.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.tier = reader.int32(); - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 9: { - if (!(message.pemCaCertificates && message.pemCaCertificates.length)) - message.pemCaCertificates = []; - message.pemCaCertificates.push(reader.string()); - break; - } - case 10: { - if (!(message.caCertificateDescriptions && message.caCertificateDescriptions.length)) - message.caCertificateDescriptions = []; - message.caCertificateDescriptions.push($root.google.cloud.security.privateca.v1.CertificateDescription.decode(reader, reader.uint32())); - break; - } - case 11: { - message.gcsBucket = reader.string(); - break; - } - case 12: { - message.accessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.decode(reader, reader.uint32()); - break; - } - case 13: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 15: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 16: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 17: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 18: { - message.userDefinedAccessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.decode(reader, reader.uint32()); - break; - } - case 19: { - message.satisfiesPzs = reader.bool(); - break; - } - case 20: { - message.satisfiesPzi = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateAuthority message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateAuthority} CertificateAuthority - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateAuthority.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateAuthority message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateAuthority.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.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.security.privateca.v1.CertificateConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.lifetime != null && message.hasOwnProperty("lifetime")) { - var error = $root.google.protobuf.Duration.verify(message.lifetime); - if (error) - return "lifetime." + error; - } - if (message.keySpec != null && message.hasOwnProperty("keySpec")) { - var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.verify(message.keySpec); - if (error) - return "keySpec." + error; - } - if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) { - var error = $root.google.cloud.security.privateca.v1.SubordinateConfig.verify(message.subordinateConfig); - if (error) - return "subordinateConfig." + error; - } - if (message.tier != null && message.hasOwnProperty("tier")) - switch (message.tier) { - default: - return "tier: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.pemCaCertificates != null && message.hasOwnProperty("pemCaCertificates")) { - if (!Array.isArray(message.pemCaCertificates)) - return "pemCaCertificates: array expected"; - for (var i = 0; i < message.pemCaCertificates.length; ++i) - if (!$util.isString(message.pemCaCertificates[i])) - return "pemCaCertificates: string[] expected"; - } - if (message.caCertificateDescriptions != null && message.hasOwnProperty("caCertificateDescriptions")) { - if (!Array.isArray(message.caCertificateDescriptions)) - return "caCertificateDescriptions: array expected"; - for (var i = 0; i < message.caCertificateDescriptions.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.CertificateDescription.verify(message.caCertificateDescriptions[i]); - if (error) - return "caCertificateDescriptions." + error; - } - } - if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) - if (!$util.isString(message.gcsBucket)) - return "gcsBucket: string expected"; - if (message.accessUrls != null && message.hasOwnProperty("accessUrls")) { - var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.verify(message.accessUrls); - if (error) - return "accessUrls." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.userDefinedAccessUrls != null && message.hasOwnProperty("userDefinedAccessUrls")) { - var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.verify(message.userDefinedAccessUrls); - if (error) - return "userDefinedAccessUrls." + error; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - return null; - }; - - /** - * Creates a CertificateAuthority message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateAuthority} CertificateAuthority - */ - CertificateAuthority.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateAuthority) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateAuthority(); - if (object.name != null) - message.name = String(object.name); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "SELF_SIGNED": - case 1: - message.type = 1; - break; - case "SUBORDINATE": - case 2: - message.type = 2; - break; - } - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.config: object expected"); - message.config = $root.google.cloud.security.privateca.v1.CertificateConfig.fromObject(object.config); - } - if (object.lifetime != null) { - if (typeof object.lifetime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.lifetime: object expected"); - message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); - } - if (object.keySpec != null) { - if (typeof object.keySpec !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.keySpec: object expected"); - message.keySpec = $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.fromObject(object.keySpec); - } - if (object.subordinateConfig != null) { - if (typeof object.subordinateConfig !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.subordinateConfig: object expected"); - message.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.fromObject(object.subordinateConfig); - } - switch (object.tier) { - default: - if (typeof object.tier === "number") { - message.tier = object.tier; - break; - } - break; - case "TIER_UNSPECIFIED": - case 0: - message.tier = 0; - break; - case "ENTERPRISE": - case 1: - message.tier = 1; - break; - case "DEVOPS": - case 2: - message.tier = 2; - break; - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ENABLED": - case 1: - message.state = 1; - break; - case "DISABLED": - case 2: - message.state = 2; - break; - case "STAGED": - case 3: - message.state = 3; - break; - case "AWAITING_USER_ACTIVATION": - case 4: - message.state = 4; - break; - case "DELETED": - case 5: - message.state = 5; - break; - } - if (object.pemCaCertificates) { - if (!Array.isArray(object.pemCaCertificates)) - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.pemCaCertificates: array expected"); - message.pemCaCertificates = []; - for (var i = 0; i < object.pemCaCertificates.length; ++i) - message.pemCaCertificates[i] = String(object.pemCaCertificates[i]); - } - if (object.caCertificateDescriptions) { - if (!Array.isArray(object.caCertificateDescriptions)) - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.caCertificateDescriptions: array expected"); - message.caCertificateDescriptions = []; - for (var i = 0; i < object.caCertificateDescriptions.length; ++i) { - if (typeof object.caCertificateDescriptions[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.caCertificateDescriptions: object expected"); - message.caCertificateDescriptions[i] = $root.google.cloud.security.privateca.v1.CertificateDescription.fromObject(object.caCertificateDescriptions[i]); - } - } - if (object.gcsBucket != null) - message.gcsBucket = String(object.gcsBucket); - if (object.accessUrls != null) { - if (typeof object.accessUrls !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.accessUrls: object expected"); - message.accessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.fromObject(object.accessUrls); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.userDefinedAccessUrls != null) { - if (typeof object.userDefinedAccessUrls !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.userDefinedAccessUrls: object expected"); - message.userDefinedAccessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.fromObject(object.userDefinedAccessUrls); - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - return message; - }; - - /** - * Creates a plain object from a CertificateAuthority message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority} message CertificateAuthority - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateAuthority.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pemCaCertificates = []; - object.caCertificateDescriptions = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.config = null; - object.lifetime = null; - object.keySpec = null; - object.subordinateConfig = null; - object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.gcsBucket = ""; - object.accessUrls = null; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.userDefinedAccessUrls = null; - object.satisfiesPzs = false; - object.satisfiesPzi = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.security.privateca.v1.CertificateAuthority.Type[message.type] === undefined ? message.type : $root.google.cloud.security.privateca.v1.CertificateAuthority.Type[message.type] : message.type; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.security.privateca.v1.CertificateConfig.toObject(message.config, options); - if (message.lifetime != null && message.hasOwnProperty("lifetime")) - object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); - if (message.keySpec != null && message.hasOwnProperty("keySpec")) - object.keySpec = $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.toObject(message.keySpec, options); - if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) - object.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.toObject(message.subordinateConfig, options); - if (message.tier != null && message.hasOwnProperty("tier")) - object.tier = options.enums === String ? $root.google.cloud.security.privateca.v1.CaPool.Tier[message.tier] === undefined ? message.tier : $root.google.cloud.security.privateca.v1.CaPool.Tier[message.tier] : message.tier; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.security.privateca.v1.CertificateAuthority.State[message.state] === undefined ? message.state : $root.google.cloud.security.privateca.v1.CertificateAuthority.State[message.state] : message.state; - if (message.pemCaCertificates && message.pemCaCertificates.length) { - object.pemCaCertificates = []; - for (var j = 0; j < message.pemCaCertificates.length; ++j) - object.pemCaCertificates[j] = message.pemCaCertificates[j]; - } - if (message.caCertificateDescriptions && message.caCertificateDescriptions.length) { - object.caCertificateDescriptions = []; - for (var j = 0; j < message.caCertificateDescriptions.length; ++j) - object.caCertificateDescriptions[j] = $root.google.cloud.security.privateca.v1.CertificateDescription.toObject(message.caCertificateDescriptions[j], options); - } - if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) - object.gcsBucket = message.gcsBucket; - if (message.accessUrls != null && message.hasOwnProperty("accessUrls")) - object.accessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.toObject(message.accessUrls, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.userDefinedAccessUrls != null && message.hasOwnProperty("userDefinedAccessUrls")) - object.userDefinedAccessUrls = $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.toObject(message.userDefinedAccessUrls, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - return object; - }; - - /** - * Converts this CertificateAuthority to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @instance - * @returns {Object.} JSON object - */ - CertificateAuthority.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateAuthority - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateAuthority.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateAuthority"; - }; - - /** - * Type enum. - * @name google.cloud.security.privateca.v1.CertificateAuthority.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} SELF_SIGNED=1 SELF_SIGNED value - * @property {number} SUBORDINATE=2 SUBORDINATE value - */ - CertificateAuthority.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SELF_SIGNED"] = 1; - values[valuesById[2] = "SUBORDINATE"] = 2; - return values; - })(); - - /** - * State enum. - * @name google.cloud.security.privateca.v1.CertificateAuthority.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ENABLED=1 ENABLED value - * @property {number} DISABLED=2 DISABLED value - * @property {number} STAGED=3 STAGED value - * @property {number} AWAITING_USER_ACTIVATION=4 AWAITING_USER_ACTIVATION value - * @property {number} DELETED=5 DELETED value - */ - CertificateAuthority.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENABLED"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - values[valuesById[3] = "STAGED"] = 3; - values[valuesById[4] = "AWAITING_USER_ACTIVATION"] = 4; - values[valuesById[5] = "DELETED"] = 5; - return values; - })(); - - CertificateAuthority.AccessUrls = (function() { - - /** - * Properties of an AccessUrls. - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @interface IAccessUrls - * @property {string|null} [caCertificateAccessUrl] AccessUrls caCertificateAccessUrl - * @property {Array.|null} [crlAccessUrls] AccessUrls crlAccessUrls - */ - - /** - * Constructs a new AccessUrls. - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @classdesc Represents an AccessUrls. - * @implements IAccessUrls - * @constructor - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls=} [properties] Properties to set - */ - function AccessUrls(properties) { - this.crlAccessUrls = []; - 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]]; - } - - /** - * AccessUrls caCertificateAccessUrl. - * @member {string} caCertificateAccessUrl - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @instance - */ - AccessUrls.prototype.caCertificateAccessUrl = ""; - - /** - * AccessUrls crlAccessUrls. - * @member {Array.} crlAccessUrls - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @instance - */ - AccessUrls.prototype.crlAccessUrls = $util.emptyArray; - - /** - * Creates a new AccessUrls instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls} AccessUrls instance - */ - AccessUrls.create = function create(properties) { - return new AccessUrls(properties); - }; - - /** - * Encodes the specified AccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls} message AccessUrls message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessUrls.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.caCertificateAccessUrl != null && Object.hasOwnProperty.call(message, "caCertificateAccessUrl")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.caCertificateAccessUrl); - if (message.crlAccessUrls != null && message.crlAccessUrls.length) - for (var i = 0; i < message.crlAccessUrls.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.crlAccessUrls[i]); - return writer; - }; - - /** - * Encodes the specified AccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IAccessUrls} message AccessUrls message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessUrls.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AccessUrls message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls} AccessUrls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessUrls.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.caCertificateAccessUrl = reader.string(); - break; - } - case 2: { - if (!(message.crlAccessUrls && message.crlAccessUrls.length)) - message.crlAccessUrls = []; - message.crlAccessUrls.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AccessUrls message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls} AccessUrls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessUrls.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AccessUrls message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AccessUrls.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.caCertificateAccessUrl != null && message.hasOwnProperty("caCertificateAccessUrl")) - if (!$util.isString(message.caCertificateAccessUrl)) - return "caCertificateAccessUrl: string expected"; - if (message.crlAccessUrls != null && message.hasOwnProperty("crlAccessUrls")) { - if (!Array.isArray(message.crlAccessUrls)) - return "crlAccessUrls: array expected"; - for (var i = 0; i < message.crlAccessUrls.length; ++i) - if (!$util.isString(message.crlAccessUrls[i])) - return "crlAccessUrls: string[] expected"; - } - return null; - }; - - /** - * Creates an AccessUrls message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls} AccessUrls - */ - AccessUrls.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls(); - if (object.caCertificateAccessUrl != null) - message.caCertificateAccessUrl = String(object.caCertificateAccessUrl); - if (object.crlAccessUrls) { - if (!Array.isArray(object.crlAccessUrls)) - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.crlAccessUrls: array expected"); - message.crlAccessUrls = []; - for (var i = 0; i < object.crlAccessUrls.length; ++i) - message.crlAccessUrls[i] = String(object.crlAccessUrls[i]); - } - return message; - }; - - /** - * Creates a plain object from an AccessUrls message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls} message AccessUrls - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AccessUrls.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.crlAccessUrls = []; - if (options.defaults) - object.caCertificateAccessUrl = ""; - if (message.caCertificateAccessUrl != null && message.hasOwnProperty("caCertificateAccessUrl")) - object.caCertificateAccessUrl = message.caCertificateAccessUrl; - if (message.crlAccessUrls && message.crlAccessUrls.length) { - object.crlAccessUrls = []; - for (var j = 0; j < message.crlAccessUrls.length; ++j) - object.crlAccessUrls[j] = message.crlAccessUrls[j]; - } - return object; - }; - - /** - * Converts this AccessUrls to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @instance - * @returns {Object.} JSON object - */ - AccessUrls.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AccessUrls - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AccessUrls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls"; - }; - - return AccessUrls; - })(); - - CertificateAuthority.KeyVersionSpec = (function() { - - /** - * Properties of a KeyVersionSpec. - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @interface IKeyVersionSpec - * @property {string|null} [cloudKmsKeyVersion] KeyVersionSpec cloudKmsKeyVersion - * @property {google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|null} [algorithm] KeyVersionSpec algorithm - */ - - /** - * Constructs a new KeyVersionSpec. - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @classdesc Represents a KeyVersionSpec. - * @implements IKeyVersionSpec - * @constructor - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec=} [properties] Properties to set - */ - function KeyVersionSpec(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]]; - } - - /** - * KeyVersionSpec cloudKmsKeyVersion. - * @member {string|null|undefined} cloudKmsKeyVersion - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @instance - */ - KeyVersionSpec.prototype.cloudKmsKeyVersion = null; - - /** - * KeyVersionSpec algorithm. - * @member {google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm|null|undefined} algorithm - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @instance - */ - KeyVersionSpec.prototype.algorithm = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * KeyVersionSpec KeyVersion. - * @member {"cloudKmsKeyVersion"|"algorithm"|undefined} KeyVersion - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @instance - */ - Object.defineProperty(KeyVersionSpec.prototype, "KeyVersion", { - get: $util.oneOfGetter($oneOfFields = ["cloudKmsKeyVersion", "algorithm"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new KeyVersionSpec instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec instance - */ - KeyVersionSpec.create = function create(properties) { - return new KeyVersionSpec(properties); - }; - - /** - * Encodes the specified KeyVersionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec} message KeyVersionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyVersionSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cloudKmsKeyVersion != null && Object.hasOwnProperty.call(message, "cloudKmsKeyVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudKmsKeyVersion); - if (message.algorithm != null && Object.hasOwnProperty.call(message, "algorithm")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.algorithm); - return writer; - }; - - /** - * Encodes the specified KeyVersionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IKeyVersionSpec} message KeyVersionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyVersionSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyVersionSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyVersionSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cloudKmsKeyVersion = reader.string(); - break; - } - case 2: { - message.algorithm = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyVersionSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyVersionSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyVersionSpec message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyVersionSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cloudKmsKeyVersion != null && message.hasOwnProperty("cloudKmsKeyVersion")) { - properties.KeyVersion = 1; - if (!$util.isString(message.cloudKmsKeyVersion)) - return "cloudKmsKeyVersion: string expected"; - } - if (message.algorithm != null && message.hasOwnProperty("algorithm")) { - if (properties.KeyVersion === 1) - return "KeyVersion: multiple values"; - properties.KeyVersion = 1; - switch (message.algorithm) { - default: - return "algorithm: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 6: - case 7: - case 8: - case 4: - case 5: - break; - } - } - return null; - }; - - /** - * Creates a KeyVersionSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec - */ - KeyVersionSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec(); - if (object.cloudKmsKeyVersion != null) - message.cloudKmsKeyVersion = String(object.cloudKmsKeyVersion); - switch (object.algorithm) { - default: - if (typeof object.algorithm === "number") { - message.algorithm = object.algorithm; - break; - } - break; - case "SIGN_HASH_ALGORITHM_UNSPECIFIED": - case 0: - message.algorithm = 0; - break; - case "RSA_PSS_2048_SHA256": - case 1: - message.algorithm = 1; - break; - case "RSA_PSS_3072_SHA256": - case 2: - message.algorithm = 2; - break; - case "RSA_PSS_4096_SHA256": - case 3: - message.algorithm = 3; - break; - case "RSA_PKCS1_2048_SHA256": - case 6: - message.algorithm = 6; - break; - case "RSA_PKCS1_3072_SHA256": - case 7: - message.algorithm = 7; - break; - case "RSA_PKCS1_4096_SHA256": - case 8: - message.algorithm = 8; - break; - case "EC_P256_SHA256": - case 4: - message.algorithm = 4; - break; - case "EC_P384_SHA384": - case 5: - message.algorithm = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from a KeyVersionSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec} message KeyVersionSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyVersionSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.cloudKmsKeyVersion != null && message.hasOwnProperty("cloudKmsKeyVersion")) { - object.cloudKmsKeyVersion = message.cloudKmsKeyVersion; - if (options.oneofs) - object.KeyVersion = "cloudKmsKeyVersion"; - } - if (message.algorithm != null && message.hasOwnProperty("algorithm")) { - object.algorithm = options.enums === String ? $root.google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm[message.algorithm] === undefined ? message.algorithm : $root.google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm[message.algorithm] : message.algorithm; - if (options.oneofs) - object.KeyVersion = "algorithm"; - } - return object; - }; - - /** - * Converts this KeyVersionSpec to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @instance - * @returns {Object.} JSON object - */ - KeyVersionSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyVersionSpec - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyVersionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec"; - }; - - return KeyVersionSpec; - })(); - - /** - * SignHashAlgorithm enum. - * @name google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm - * @enum {number} - * @property {number} SIGN_HASH_ALGORITHM_UNSPECIFIED=0 SIGN_HASH_ALGORITHM_UNSPECIFIED value - * @property {number} RSA_PSS_2048_SHA256=1 RSA_PSS_2048_SHA256 value - * @property {number} RSA_PSS_3072_SHA256=2 RSA_PSS_3072_SHA256 value - * @property {number} RSA_PSS_4096_SHA256=3 RSA_PSS_4096_SHA256 value - * @property {number} RSA_PKCS1_2048_SHA256=6 RSA_PKCS1_2048_SHA256 value - * @property {number} RSA_PKCS1_3072_SHA256=7 RSA_PKCS1_3072_SHA256 value - * @property {number} RSA_PKCS1_4096_SHA256=8 RSA_PKCS1_4096_SHA256 value - * @property {number} EC_P256_SHA256=4 EC_P256_SHA256 value - * @property {number} EC_P384_SHA384=5 EC_P384_SHA384 value - */ - CertificateAuthority.SignHashAlgorithm = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SIGN_HASH_ALGORITHM_UNSPECIFIED"] = 0; - values[valuesById[1] = "RSA_PSS_2048_SHA256"] = 1; - values[valuesById[2] = "RSA_PSS_3072_SHA256"] = 2; - values[valuesById[3] = "RSA_PSS_4096_SHA256"] = 3; - values[valuesById[6] = "RSA_PKCS1_2048_SHA256"] = 6; - values[valuesById[7] = "RSA_PKCS1_3072_SHA256"] = 7; - values[valuesById[8] = "RSA_PKCS1_4096_SHA256"] = 8; - values[valuesById[4] = "EC_P256_SHA256"] = 4; - values[valuesById[5] = "EC_P384_SHA384"] = 5; - return values; - })(); - - CertificateAuthority.UserDefinedAccessUrls = (function() { - - /** - * Properties of a UserDefinedAccessUrls. - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @interface IUserDefinedAccessUrls - * @property {Array.|null} [aiaIssuingCertificateUrls] UserDefinedAccessUrls aiaIssuingCertificateUrls - * @property {Array.|null} [crlAccessUrls] UserDefinedAccessUrls crlAccessUrls - */ - - /** - * Constructs a new UserDefinedAccessUrls. - * @memberof google.cloud.security.privateca.v1.CertificateAuthority - * @classdesc Represents a UserDefinedAccessUrls. - * @implements IUserDefinedAccessUrls - * @constructor - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls=} [properties] Properties to set - */ - function UserDefinedAccessUrls(properties) { - this.aiaIssuingCertificateUrls = []; - this.crlAccessUrls = []; - 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]]; - } - - /** - * UserDefinedAccessUrls aiaIssuingCertificateUrls. - * @member {Array.} aiaIssuingCertificateUrls - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @instance - */ - UserDefinedAccessUrls.prototype.aiaIssuingCertificateUrls = $util.emptyArray; - - /** - * UserDefinedAccessUrls crlAccessUrls. - * @member {Array.} crlAccessUrls - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @instance - */ - UserDefinedAccessUrls.prototype.crlAccessUrls = $util.emptyArray; - - /** - * Creates a new UserDefinedAccessUrls instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls} UserDefinedAccessUrls instance - */ - UserDefinedAccessUrls.create = function create(properties) { - return new UserDefinedAccessUrls(properties); - }; - - /** - * Encodes the specified UserDefinedAccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls} message UserDefinedAccessUrls message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserDefinedAccessUrls.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.aiaIssuingCertificateUrls != null && message.aiaIssuingCertificateUrls.length) - for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.aiaIssuingCertificateUrls[i]); - if (message.crlAccessUrls != null && message.crlAccessUrls.length) - for (var i = 0; i < message.crlAccessUrls.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.crlAccessUrls[i]); - return writer; - }; - - /** - * Encodes the specified UserDefinedAccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.IUserDefinedAccessUrls} message UserDefinedAccessUrls message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserDefinedAccessUrls.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UserDefinedAccessUrls message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls} UserDefinedAccessUrls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserDefinedAccessUrls.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length)) - message.aiaIssuingCertificateUrls = []; - message.aiaIssuingCertificateUrls.push(reader.string()); - break; - } - case 2: { - if (!(message.crlAccessUrls && message.crlAccessUrls.length)) - message.crlAccessUrls = []; - message.crlAccessUrls.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UserDefinedAccessUrls message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls} UserDefinedAccessUrls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserDefinedAccessUrls.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UserDefinedAccessUrls message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UserDefinedAccessUrls.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.aiaIssuingCertificateUrls != null && message.hasOwnProperty("aiaIssuingCertificateUrls")) { - if (!Array.isArray(message.aiaIssuingCertificateUrls)) - return "aiaIssuingCertificateUrls: array expected"; - for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) - if (!$util.isString(message.aiaIssuingCertificateUrls[i])) - return "aiaIssuingCertificateUrls: string[] expected"; - } - if (message.crlAccessUrls != null && message.hasOwnProperty("crlAccessUrls")) { - if (!Array.isArray(message.crlAccessUrls)) - return "crlAccessUrls: array expected"; - for (var i = 0; i < message.crlAccessUrls.length; ++i) - if (!$util.isString(message.crlAccessUrls[i])) - return "crlAccessUrls: string[] expected"; - } - return null; - }; - - /** - * Creates a UserDefinedAccessUrls message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls} UserDefinedAccessUrls - */ - UserDefinedAccessUrls.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls(); - if (object.aiaIssuingCertificateUrls) { - if (!Array.isArray(object.aiaIssuingCertificateUrls)) - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.aiaIssuingCertificateUrls: array expected"); - message.aiaIssuingCertificateUrls = []; - for (var i = 0; i < object.aiaIssuingCertificateUrls.length; ++i) - message.aiaIssuingCertificateUrls[i] = String(object.aiaIssuingCertificateUrls[i]); - } - if (object.crlAccessUrls) { - if (!Array.isArray(object.crlAccessUrls)) - throw TypeError(".google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls.crlAccessUrls: array expected"); - message.crlAccessUrls = []; - for (var i = 0; i < object.crlAccessUrls.length; ++i) - message.crlAccessUrls[i] = String(object.crlAccessUrls[i]); - } - return message; - }; - - /** - * Creates a plain object from a UserDefinedAccessUrls message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @static - * @param {google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls} message UserDefinedAccessUrls - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UserDefinedAccessUrls.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.aiaIssuingCertificateUrls = []; - object.crlAccessUrls = []; - } - if (message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length) { - object.aiaIssuingCertificateUrls = []; - for (var j = 0; j < message.aiaIssuingCertificateUrls.length; ++j) - object.aiaIssuingCertificateUrls[j] = message.aiaIssuingCertificateUrls[j]; - } - if (message.crlAccessUrls && message.crlAccessUrls.length) { - object.crlAccessUrls = []; - for (var j = 0; j < message.crlAccessUrls.length; ++j) - object.crlAccessUrls[j] = message.crlAccessUrls[j]; - } - return object; - }; - - /** - * Converts this UserDefinedAccessUrls to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @instance - * @returns {Object.} JSON object - */ - UserDefinedAccessUrls.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UserDefinedAccessUrls - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UserDefinedAccessUrls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls"; - }; - - return UserDefinedAccessUrls; - })(); - - return CertificateAuthority; - })(); - - v1.CaPool = (function() { - - /** - * Properties of a CaPool. - * @memberof google.cloud.security.privateca.v1 - * @interface ICaPool - * @property {string|null} [name] CaPool name - * @property {google.cloud.security.privateca.v1.CaPool.Tier|null} [tier] CaPool tier - * @property {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy|null} [issuancePolicy] CaPool issuancePolicy - * @property {google.cloud.security.privateca.v1.CaPool.IPublishingOptions|null} [publishingOptions] CaPool publishingOptions - * @property {google.cloud.security.privateca.v1.IEncryptionSpec|null} [encryptionSpec] CaPool encryptionSpec - * @property {Object.|null} [labels] CaPool labels - */ - - /** - * Constructs a new CaPool. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CaPool. - * @implements ICaPool - * @constructor - * @param {google.cloud.security.privateca.v1.ICaPool=} [properties] Properties to set - */ - function CaPool(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]]; - } - - /** - * CaPool name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.CaPool - * @instance - */ - CaPool.prototype.name = ""; - - /** - * CaPool tier. - * @member {google.cloud.security.privateca.v1.CaPool.Tier} tier - * @memberof google.cloud.security.privateca.v1.CaPool - * @instance - */ - CaPool.prototype.tier = 0; - - /** - * CaPool issuancePolicy. - * @member {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy|null|undefined} issuancePolicy - * @memberof google.cloud.security.privateca.v1.CaPool - * @instance - */ - CaPool.prototype.issuancePolicy = null; - - /** - * CaPool publishingOptions. - * @member {google.cloud.security.privateca.v1.CaPool.IPublishingOptions|null|undefined} publishingOptions - * @memberof google.cloud.security.privateca.v1.CaPool - * @instance - */ - CaPool.prototype.publishingOptions = null; - - /** - * CaPool encryptionSpec. - * @member {google.cloud.security.privateca.v1.IEncryptionSpec|null|undefined} encryptionSpec - * @memberof google.cloud.security.privateca.v1.CaPool - * @instance - */ - CaPool.prototype.encryptionSpec = null; - - /** - * CaPool labels. - * @member {Object.} labels - * @memberof google.cloud.security.privateca.v1.CaPool - * @instance - */ - CaPool.prototype.labels = $util.emptyObject; - - /** - * Creates a new CaPool instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CaPool - * @static - * @param {google.cloud.security.privateca.v1.ICaPool=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CaPool} CaPool instance - */ - CaPool.create = function create(properties) { - return new CaPool(properties); - }; - - /** - * Encodes the specified CaPool message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CaPool - * @static - * @param {google.cloud.security.privateca.v1.ICaPool} message CaPool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaPool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.tier); - if (message.issuancePolicy != null && Object.hasOwnProperty.call(message, "issuancePolicy")) - $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.encode(message.issuancePolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.publishingOptions != null && Object.hasOwnProperty.call(message, "publishingOptions")) - $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.encode(message.publishingOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) - $root.google.cloud.security.privateca.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CaPool message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool - * @static - * @param {google.cloud.security.privateca.v1.ICaPool} message CaPool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaPool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CaPool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CaPool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CaPool} CaPool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaPool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.tier = reader.int32(); - break; - } - case 3: { - message.issuancePolicy = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.decode(reader, reader.uint32()); - break; - } - case 4: { - message.publishingOptions = $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.decode(reader, reader.uint32()); - break; - } - case 8: { - message.encryptionSpec = $root.google.cloud.security.privateca.v1.EncryptionSpec.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CaPool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CaPool} CaPool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaPool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CaPool message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CaPool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CaPool.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.tier != null && message.hasOwnProperty("tier")) - switch (message.tier) { - default: - return "tier: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.issuancePolicy != null && message.hasOwnProperty("issuancePolicy")) { - var error = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.verify(message.issuancePolicy); - if (error) - return "issuancePolicy." + error; - } - if (message.publishingOptions != null && message.hasOwnProperty("publishingOptions")) { - var error = $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.verify(message.publishingOptions); - if (error) - return "publishingOptions." + error; - } - if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { - var error = $root.google.cloud.security.privateca.v1.EncryptionSpec.verify(message.encryptionSpec); - if (error) - return "encryptionSpec." + 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 CaPool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CaPool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CaPool} CaPool - */ - CaPool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CaPool) - return object; - var message = new $root.google.cloud.security.privateca.v1.CaPool(); - if (object.name != null) - message.name = String(object.name); - switch (object.tier) { - default: - if (typeof object.tier === "number") { - message.tier = object.tier; - break; - } - break; - case "TIER_UNSPECIFIED": - case 0: - message.tier = 0; - break; - case "ENTERPRISE": - case 1: - message.tier = 1; - break; - case "DEVOPS": - case 2: - message.tier = 2; - break; - } - if (object.issuancePolicy != null) { - if (typeof object.issuancePolicy !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.issuancePolicy: object expected"); - message.issuancePolicy = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.fromObject(object.issuancePolicy); - } - if (object.publishingOptions != null) { - if (typeof object.publishingOptions !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.publishingOptions: object expected"); - message.publishingOptions = $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.fromObject(object.publishingOptions); - } - if (object.encryptionSpec != null) { - if (typeof object.encryptionSpec !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.encryptionSpec: object expected"); - message.encryptionSpec = $root.google.cloud.security.privateca.v1.EncryptionSpec.fromObject(object.encryptionSpec); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.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 CaPool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CaPool - * @static - * @param {google.cloud.security.privateca.v1.CaPool} message CaPool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CaPool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; - object.issuancePolicy = null; - object.publishingOptions = null; - object.encryptionSpec = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.tier != null && message.hasOwnProperty("tier")) - object.tier = options.enums === String ? $root.google.cloud.security.privateca.v1.CaPool.Tier[message.tier] === undefined ? message.tier : $root.google.cloud.security.privateca.v1.CaPool.Tier[message.tier] : message.tier; - if (message.issuancePolicy != null && message.hasOwnProperty("issuancePolicy")) - object.issuancePolicy = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.toObject(message.issuancePolicy, options); - if (message.publishingOptions != null && message.hasOwnProperty("publishingOptions")) - object.publishingOptions = $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.toObject(message.publishingOptions, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) - object.encryptionSpec = $root.google.cloud.security.privateca.v1.EncryptionSpec.toObject(message.encryptionSpec, options); - return object; - }; - - /** - * Converts this CaPool to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CaPool - * @instance - * @returns {Object.} JSON object - */ - CaPool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CaPool - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CaPool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CaPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool"; - }; - - /** - * Tier enum. - * @name google.cloud.security.privateca.v1.CaPool.Tier - * @enum {number} - * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value - * @property {number} ENTERPRISE=1 ENTERPRISE value - * @property {number} DEVOPS=2 DEVOPS value - */ - CaPool.Tier = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENTERPRISE"] = 1; - values[valuesById[2] = "DEVOPS"] = 2; - return values; - })(); - - CaPool.PublishingOptions = (function() { - - /** - * Properties of a PublishingOptions. - * @memberof google.cloud.security.privateca.v1.CaPool - * @interface IPublishingOptions - * @property {boolean|null} [publishCaCert] PublishingOptions publishCaCert - * @property {boolean|null} [publishCrl] PublishingOptions publishCrl - * @property {google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat|null} [encodingFormat] PublishingOptions encodingFormat - */ - - /** - * Constructs a new PublishingOptions. - * @memberof google.cloud.security.privateca.v1.CaPool - * @classdesc Represents a PublishingOptions. - * @implements IPublishingOptions - * @constructor - * @param {google.cloud.security.privateca.v1.CaPool.IPublishingOptions=} [properties] Properties to set - */ - function PublishingOptions(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]]; - } - - /** - * PublishingOptions publishCaCert. - * @member {boolean} publishCaCert - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @instance - */ - PublishingOptions.prototype.publishCaCert = false; - - /** - * PublishingOptions publishCrl. - * @member {boolean} publishCrl - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @instance - */ - PublishingOptions.prototype.publishCrl = false; - - /** - * PublishingOptions encodingFormat. - * @member {google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat} encodingFormat - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @instance - */ - PublishingOptions.prototype.encodingFormat = 0; - - /** - * Creates a new PublishingOptions instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IPublishingOptions=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CaPool.PublishingOptions} PublishingOptions instance - */ - PublishingOptions.create = function create(properties) { - return new PublishingOptions(properties); - }; - - /** - * Encodes the specified PublishingOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.PublishingOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IPublishingOptions} message PublishingOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublishingOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.publishCaCert != null && Object.hasOwnProperty.call(message, "publishCaCert")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.publishCaCert); - if (message.publishCrl != null && Object.hasOwnProperty.call(message, "publishCrl")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.publishCrl); - if (message.encodingFormat != null && Object.hasOwnProperty.call(message, "encodingFormat")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encodingFormat); - return writer; - }; - - /** - * Encodes the specified PublishingOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.PublishingOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IPublishingOptions} message PublishingOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublishingOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PublishingOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CaPool.PublishingOptions} PublishingOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublishingOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.publishCaCert = reader.bool(); - break; - } - case 2: { - message.publishCrl = reader.bool(); - break; - } - case 3: { - message.encodingFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PublishingOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CaPool.PublishingOptions} PublishingOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublishingOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PublishingOptions message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PublishingOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.publishCaCert != null && message.hasOwnProperty("publishCaCert")) - if (typeof message.publishCaCert !== "boolean") - return "publishCaCert: boolean expected"; - if (message.publishCrl != null && message.hasOwnProperty("publishCrl")) - if (typeof message.publishCrl !== "boolean") - return "publishCrl: boolean expected"; - if (message.encodingFormat != null && message.hasOwnProperty("encodingFormat")) - switch (message.encodingFormat) { - default: - return "encodingFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a PublishingOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CaPool.PublishingOptions} PublishingOptions - */ - PublishingOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions) - return object; - var message = new $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions(); - if (object.publishCaCert != null) - message.publishCaCert = Boolean(object.publishCaCert); - if (object.publishCrl != null) - message.publishCrl = Boolean(object.publishCrl); - switch (object.encodingFormat) { - default: - if (typeof object.encodingFormat === "number") { - message.encodingFormat = object.encodingFormat; - break; - } - break; - case "ENCODING_FORMAT_UNSPECIFIED": - case 0: - message.encodingFormat = 0; - break; - case "PEM": - case 1: - message.encodingFormat = 1; - break; - case "DER": - case 2: - message.encodingFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a PublishingOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @static - * @param {google.cloud.security.privateca.v1.CaPool.PublishingOptions} message PublishingOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PublishingOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.publishCaCert = false; - object.publishCrl = false; - object.encodingFormat = options.enums === String ? "ENCODING_FORMAT_UNSPECIFIED" : 0; - } - if (message.publishCaCert != null && message.hasOwnProperty("publishCaCert")) - object.publishCaCert = message.publishCaCert; - if (message.publishCrl != null && message.hasOwnProperty("publishCrl")) - object.publishCrl = message.publishCrl; - if (message.encodingFormat != null && message.hasOwnProperty("encodingFormat")) - object.encodingFormat = options.enums === String ? $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat[message.encodingFormat] === undefined ? message.encodingFormat : $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat[message.encodingFormat] : message.encodingFormat; - return object; - }; - - /** - * Converts this PublishingOptions to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @instance - * @returns {Object.} JSON object - */ - PublishingOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PublishingOptions - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CaPool.PublishingOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PublishingOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.PublishingOptions"; - }; - - /** - * EncodingFormat enum. - * @name google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat - * @enum {number} - * @property {number} ENCODING_FORMAT_UNSPECIFIED=0 ENCODING_FORMAT_UNSPECIFIED value - * @property {number} PEM=1 PEM value - * @property {number} DER=2 DER value - */ - PublishingOptions.EncodingFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENCODING_FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "PEM"] = 1; - values[valuesById[2] = "DER"] = 2; - return values; - })(); - - return PublishingOptions; - })(); - - CaPool.IssuancePolicy = (function() { - - /** - * Properties of an IssuancePolicy. - * @memberof google.cloud.security.privateca.v1.CaPool - * @interface IIssuancePolicy - * @property {Array.|null} [allowedKeyTypes] IssuancePolicy allowedKeyTypes - * @property {google.protobuf.IDuration|null} [backdateDuration] IssuancePolicy backdateDuration - * @property {boolean|null} [allowRequesterSpecifiedNotBeforeTime] IssuancePolicy allowRequesterSpecifiedNotBeforeTime - * @property {google.protobuf.IDuration|null} [maximumLifetime] IssuancePolicy maximumLifetime - * @property {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes|null} [allowedIssuanceModes] IssuancePolicy allowedIssuanceModes - * @property {google.cloud.security.privateca.v1.IX509Parameters|null} [baselineValues] IssuancePolicy baselineValues - * @property {google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null} [identityConstraints] IssuancePolicy identityConstraints - * @property {google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null} [passthroughExtensions] IssuancePolicy passthroughExtensions - */ - - /** - * Constructs a new IssuancePolicy. - * @memberof google.cloud.security.privateca.v1.CaPool - * @classdesc Represents an IssuancePolicy. - * @implements IIssuancePolicy - * @constructor - * @param {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy=} [properties] Properties to set - */ - function IssuancePolicy(properties) { - this.allowedKeyTypes = []; - 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]]; - } - - /** - * IssuancePolicy allowedKeyTypes. - * @member {Array.} allowedKeyTypes - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @instance - */ - IssuancePolicy.prototype.allowedKeyTypes = $util.emptyArray; - - /** - * IssuancePolicy backdateDuration. - * @member {google.protobuf.IDuration|null|undefined} backdateDuration - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @instance - */ - IssuancePolicy.prototype.backdateDuration = null; - - /** - * IssuancePolicy allowRequesterSpecifiedNotBeforeTime. - * @member {boolean} allowRequesterSpecifiedNotBeforeTime - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @instance - */ - IssuancePolicy.prototype.allowRequesterSpecifiedNotBeforeTime = false; - - /** - * IssuancePolicy maximumLifetime. - * @member {google.protobuf.IDuration|null|undefined} maximumLifetime - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @instance - */ - IssuancePolicy.prototype.maximumLifetime = null; - - /** - * IssuancePolicy allowedIssuanceModes. - * @member {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes|null|undefined} allowedIssuanceModes - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @instance - */ - IssuancePolicy.prototype.allowedIssuanceModes = null; - - /** - * IssuancePolicy baselineValues. - * @member {google.cloud.security.privateca.v1.IX509Parameters|null|undefined} baselineValues - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @instance - */ - IssuancePolicy.prototype.baselineValues = null; - - /** - * IssuancePolicy identityConstraints. - * @member {google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null|undefined} identityConstraints - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @instance - */ - IssuancePolicy.prototype.identityConstraints = null; - - /** - * IssuancePolicy passthroughExtensions. - * @member {google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null|undefined} passthroughExtensions - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @instance - */ - IssuancePolicy.prototype.passthroughExtensions = null; - - /** - * Creates a new IssuancePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy} IssuancePolicy instance - */ - IssuancePolicy.create = function create(properties) { - return new IssuancePolicy(properties); - }; - - /** - * Encodes the specified IssuancePolicy message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy} message IssuancePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IssuancePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedKeyTypes != null && message.allowedKeyTypes.length) - for (var i = 0; i < message.allowedKeyTypes.length; ++i) - $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.encode(message.allowedKeyTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.maximumLifetime != null && Object.hasOwnProperty.call(message, "maximumLifetime")) - $root.google.protobuf.Duration.encode(message.maximumLifetime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.allowedIssuanceModes != null && Object.hasOwnProperty.call(message, "allowedIssuanceModes")) - $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.encode(message.allowedIssuanceModes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.baselineValues != null && Object.hasOwnProperty.call(message, "baselineValues")) - $root.google.cloud.security.privateca.v1.X509Parameters.encode(message.baselineValues, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.identityConstraints != null && Object.hasOwnProperty.call(message, "identityConstraints")) - $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.encode(message.identityConstraints, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.passthroughExtensions != null && Object.hasOwnProperty.call(message, "passthroughExtensions")) - $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.encode(message.passthroughExtensions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.backdateDuration != null && Object.hasOwnProperty.call(message, "backdateDuration")) - $root.google.protobuf.Duration.encode(message.backdateDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.allowRequesterSpecifiedNotBeforeTime != null && Object.hasOwnProperty.call(message, "allowRequesterSpecifiedNotBeforeTime")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.allowRequesterSpecifiedNotBeforeTime); - return writer; - }; - - /** - * Encodes the specified IssuancePolicy message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy} message IssuancePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IssuancePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IssuancePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy} IssuancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IssuancePolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.allowedKeyTypes && message.allowedKeyTypes.length)) - message.allowedKeyTypes = []; - message.allowedKeyTypes.push($root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.decode(reader, reader.uint32())); - break; - } - case 7: { - message.backdateDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 8: { - message.allowRequesterSpecifiedNotBeforeTime = reader.bool(); - break; - } - case 2: { - message.maximumLifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 3: { - message.allowedIssuanceModes = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.decode(reader, reader.uint32()); - break; - } - case 4: { - message.baselineValues = $root.google.cloud.security.privateca.v1.X509Parameters.decode(reader, reader.uint32()); - break; - } - case 5: { - message.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.decode(reader, reader.uint32()); - break; - } - case 6: { - message.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IssuancePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy} IssuancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IssuancePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IssuancePolicy message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IssuancePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedKeyTypes != null && message.hasOwnProperty("allowedKeyTypes")) { - if (!Array.isArray(message.allowedKeyTypes)) - return "allowedKeyTypes: array expected"; - for (var i = 0; i < message.allowedKeyTypes.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.verify(message.allowedKeyTypes[i]); - if (error) - return "allowedKeyTypes." + error; - } - } - if (message.backdateDuration != null && message.hasOwnProperty("backdateDuration")) { - var error = $root.google.protobuf.Duration.verify(message.backdateDuration); - if (error) - return "backdateDuration." + error; - } - if (message.allowRequesterSpecifiedNotBeforeTime != null && message.hasOwnProperty("allowRequesterSpecifiedNotBeforeTime")) - if (typeof message.allowRequesterSpecifiedNotBeforeTime !== "boolean") - return "allowRequesterSpecifiedNotBeforeTime: boolean expected"; - if (message.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) { - var error = $root.google.protobuf.Duration.verify(message.maximumLifetime); - if (error) - return "maximumLifetime." + error; - } - if (message.allowedIssuanceModes != null && message.hasOwnProperty("allowedIssuanceModes")) { - var error = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.verify(message.allowedIssuanceModes); - if (error) - return "allowedIssuanceModes." + error; - } - if (message.baselineValues != null && message.hasOwnProperty("baselineValues")) { - var error = $root.google.cloud.security.privateca.v1.X509Parameters.verify(message.baselineValues); - if (error) - return "baselineValues." + error; - } - if (message.identityConstraints != null && message.hasOwnProperty("identityConstraints")) { - var error = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify(message.identityConstraints); - if (error) - return "identityConstraints." + error; - } - if (message.passthroughExtensions != null && message.hasOwnProperty("passthroughExtensions")) { - var error = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify(message.passthroughExtensions); - if (error) - return "passthroughExtensions." + error; - } - return null; - }; - - /** - * Creates an IssuancePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy} IssuancePolicy - */ - IssuancePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy) - return object; - var message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy(); - if (object.allowedKeyTypes) { - if (!Array.isArray(object.allowedKeyTypes)) - throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allowedKeyTypes: array expected"); - message.allowedKeyTypes = []; - for (var i = 0; i < object.allowedKeyTypes.length; ++i) { - if (typeof object.allowedKeyTypes[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allowedKeyTypes: object expected"); - message.allowedKeyTypes[i] = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.fromObject(object.allowedKeyTypes[i]); - } - } - if (object.backdateDuration != null) { - if (typeof object.backdateDuration !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdateDuration: object expected"); - message.backdateDuration = $root.google.protobuf.Duration.fromObject(object.backdateDuration); - } - if (object.allowRequesterSpecifiedNotBeforeTime != null) - message.allowRequesterSpecifiedNotBeforeTime = Boolean(object.allowRequesterSpecifiedNotBeforeTime); - if (object.maximumLifetime != null) { - if (typeof object.maximumLifetime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.maximumLifetime: object expected"); - message.maximumLifetime = $root.google.protobuf.Duration.fromObject(object.maximumLifetime); - } - if (object.allowedIssuanceModes != null) { - if (typeof object.allowedIssuanceModes !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allowedIssuanceModes: object expected"); - message.allowedIssuanceModes = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.fromObject(object.allowedIssuanceModes); - } - if (object.baselineValues != null) { - if (typeof object.baselineValues !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baselineValues: object expected"); - message.baselineValues = $root.google.cloud.security.privateca.v1.X509Parameters.fromObject(object.baselineValues); - } - if (object.identityConstraints != null) { - if (typeof object.identityConstraints !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.identityConstraints: object expected"); - message.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.fromObject(object.identityConstraints); - } - if (object.passthroughExtensions != null) { - if (typeof object.passthroughExtensions !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.passthroughExtensions: object expected"); - message.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.fromObject(object.passthroughExtensions); - } - return message; - }; - - /** - * Creates a plain object from an IssuancePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy} message IssuancePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IssuancePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedKeyTypes = []; - if (options.defaults) { - object.maximumLifetime = null; - object.allowedIssuanceModes = null; - object.baselineValues = null; - object.identityConstraints = null; - object.passthroughExtensions = null; - object.backdateDuration = null; - object.allowRequesterSpecifiedNotBeforeTime = false; - } - if (message.allowedKeyTypes && message.allowedKeyTypes.length) { - object.allowedKeyTypes = []; - for (var j = 0; j < message.allowedKeyTypes.length; ++j) - object.allowedKeyTypes[j] = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.toObject(message.allowedKeyTypes[j], options); - } - if (message.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) - object.maximumLifetime = $root.google.protobuf.Duration.toObject(message.maximumLifetime, options); - if (message.allowedIssuanceModes != null && message.hasOwnProperty("allowedIssuanceModes")) - object.allowedIssuanceModes = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.toObject(message.allowedIssuanceModes, options); - if (message.baselineValues != null && message.hasOwnProperty("baselineValues")) - object.baselineValues = $root.google.cloud.security.privateca.v1.X509Parameters.toObject(message.baselineValues, options); - if (message.identityConstraints != null && message.hasOwnProperty("identityConstraints")) - object.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.toObject(message.identityConstraints, options); - if (message.passthroughExtensions != null && message.hasOwnProperty("passthroughExtensions")) - object.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.toObject(message.passthroughExtensions, options); - if (message.backdateDuration != null && message.hasOwnProperty("backdateDuration")) - object.backdateDuration = $root.google.protobuf.Duration.toObject(message.backdateDuration, options); - if (message.allowRequesterSpecifiedNotBeforeTime != null && message.hasOwnProperty("allowRequesterSpecifiedNotBeforeTime")) - object.allowRequesterSpecifiedNotBeforeTime = message.allowRequesterSpecifiedNotBeforeTime; - return object; - }; - - /** - * Converts this IssuancePolicy to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @instance - * @returns {Object.} JSON object - */ - IssuancePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IssuancePolicy - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IssuancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.IssuancePolicy"; - }; - - IssuancePolicy.AllowedKeyType = (function() { - - /** - * Properties of an AllowedKeyType. - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @interface IAllowedKeyType - * @property {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType|null} [rsa] AllowedKeyType rsa - * @property {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType|null} [ellipticCurve] AllowedKeyType ellipticCurve - */ - - /** - * Constructs a new AllowedKeyType. - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @classdesc Represents an AllowedKeyType. - * @implements IAllowedKeyType - * @constructor - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType=} [properties] Properties to set - */ - function AllowedKeyType(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]]; - } - - /** - * AllowedKeyType rsa. - * @member {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType|null|undefined} rsa - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @instance - */ - AllowedKeyType.prototype.rsa = null; - - /** - * AllowedKeyType ellipticCurve. - * @member {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType|null|undefined} ellipticCurve - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @instance - */ - AllowedKeyType.prototype.ellipticCurve = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AllowedKeyType keyType. - * @member {"rsa"|"ellipticCurve"|undefined} keyType - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @instance - */ - Object.defineProperty(AllowedKeyType.prototype, "keyType", { - get: $util.oneOfGetter($oneOfFields = ["rsa", "ellipticCurve"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AllowedKeyType instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType} AllowedKeyType instance - */ - AllowedKeyType.create = function create(properties) { - return new AllowedKeyType(properties); - }; - - /** - * Encodes the specified AllowedKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType} message AllowedKeyType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedKeyType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rsa != null && Object.hasOwnProperty.call(message, "rsa")) - $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.encode(message.rsa, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.ellipticCurve != null && Object.hasOwnProperty.call(message, "ellipticCurve")) - $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.encode(message.ellipticCurve, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AllowedKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IAllowedKeyType} message AllowedKeyType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedKeyType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllowedKeyType message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType} AllowedKeyType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedKeyType.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.rsa = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.decode(reader, reader.uint32()); - break; - } - case 2: { - message.ellipticCurve = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllowedKeyType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType} AllowedKeyType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedKeyType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllowedKeyType message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllowedKeyType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.rsa != null && message.hasOwnProperty("rsa")) { - properties.keyType = 1; - { - var error = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.verify(message.rsa); - if (error) - return "rsa." + error; - } - } - if (message.ellipticCurve != null && message.hasOwnProperty("ellipticCurve")) { - if (properties.keyType === 1) - return "keyType: multiple values"; - properties.keyType = 1; - { - var error = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.verify(message.ellipticCurve); - if (error) - return "ellipticCurve." + error; - } - } - return null; - }; - - /** - * Creates an AllowedKeyType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType} AllowedKeyType - */ - AllowedKeyType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType) - return object; - var message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType(); - if (object.rsa != null) { - if (typeof object.rsa !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.rsa: object expected"); - message.rsa = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.fromObject(object.rsa); - } - if (object.ellipticCurve != null) { - if (typeof object.ellipticCurve !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.ellipticCurve: object expected"); - message.ellipticCurve = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.fromObject(object.ellipticCurve); - } - return message; - }; - - /** - * Creates a plain object from an AllowedKeyType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType} message AllowedKeyType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllowedKeyType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.rsa != null && message.hasOwnProperty("rsa")) { - object.rsa = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.toObject(message.rsa, options); - if (options.oneofs) - object.keyType = "rsa"; - } - if (message.ellipticCurve != null && message.hasOwnProperty("ellipticCurve")) { - object.ellipticCurve = $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.toObject(message.ellipticCurve, options); - if (options.oneofs) - object.keyType = "ellipticCurve"; - } - return object; - }; - - /** - * Converts this AllowedKeyType to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @instance - * @returns {Object.} JSON object - */ - AllowedKeyType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AllowedKeyType - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllowedKeyType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType"; - }; - - AllowedKeyType.RsaKeyType = (function() { - - /** - * Properties of a RsaKeyType. - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @interface IRsaKeyType - * @property {number|Long|null} [minModulusSize] RsaKeyType minModulusSize - * @property {number|Long|null} [maxModulusSize] RsaKeyType maxModulusSize - */ - - /** - * Constructs a new RsaKeyType. - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @classdesc Represents a RsaKeyType. - * @implements IRsaKeyType - * @constructor - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType=} [properties] Properties to set - */ - function RsaKeyType(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]]; - } - - /** - * RsaKeyType minModulusSize. - * @member {number|Long} minModulusSize - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @instance - */ - RsaKeyType.prototype.minModulusSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * RsaKeyType maxModulusSize. - * @member {number|Long} maxModulusSize - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @instance - */ - RsaKeyType.prototype.maxModulusSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new RsaKeyType instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType} RsaKeyType instance - */ - RsaKeyType.create = function create(properties) { - return new RsaKeyType(properties); - }; - - /** - * Encodes the specified RsaKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType} message RsaKeyType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RsaKeyType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minModulusSize != null && Object.hasOwnProperty.call(message, "minModulusSize")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.minModulusSize); - if (message.maxModulusSize != null && Object.hasOwnProperty.call(message, "maxModulusSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxModulusSize); - return writer; - }; - - /** - * Encodes the specified RsaKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IRsaKeyType} message RsaKeyType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RsaKeyType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RsaKeyType message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType} RsaKeyType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RsaKeyType.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.minModulusSize = reader.int64(); - break; - } - case 2: { - message.maxModulusSize = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RsaKeyType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType} RsaKeyType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RsaKeyType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RsaKeyType message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RsaKeyType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.minModulusSize != null && message.hasOwnProperty("minModulusSize")) - if (!$util.isInteger(message.minModulusSize) && !(message.minModulusSize && $util.isInteger(message.minModulusSize.low) && $util.isInteger(message.minModulusSize.high))) - return "minModulusSize: integer|Long expected"; - if (message.maxModulusSize != null && message.hasOwnProperty("maxModulusSize")) - if (!$util.isInteger(message.maxModulusSize) && !(message.maxModulusSize && $util.isInteger(message.maxModulusSize.low) && $util.isInteger(message.maxModulusSize.high))) - return "maxModulusSize: integer|Long expected"; - return null; - }; - - /** - * Creates a RsaKeyType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType} RsaKeyType - */ - RsaKeyType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType) - return object; - var message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType(); - if (object.minModulusSize != null) - if ($util.Long) - (message.minModulusSize = $util.Long.fromValue(object.minModulusSize)).unsigned = false; - else if (typeof object.minModulusSize === "string") - message.minModulusSize = parseInt(object.minModulusSize, 10); - else if (typeof object.minModulusSize === "number") - message.minModulusSize = object.minModulusSize; - else if (typeof object.minModulusSize === "object") - message.minModulusSize = new $util.LongBits(object.minModulusSize.low >>> 0, object.minModulusSize.high >>> 0).toNumber(); - if (object.maxModulusSize != null) - if ($util.Long) - (message.maxModulusSize = $util.Long.fromValue(object.maxModulusSize)).unsigned = false; - else if (typeof object.maxModulusSize === "string") - message.maxModulusSize = parseInt(object.maxModulusSize, 10); - else if (typeof object.maxModulusSize === "number") - message.maxModulusSize = object.maxModulusSize; - else if (typeof object.maxModulusSize === "object") - message.maxModulusSize = new $util.LongBits(object.maxModulusSize.low >>> 0, object.maxModulusSize.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a RsaKeyType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType} message RsaKeyType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RsaKeyType.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.minModulusSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.minModulusSize = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxModulusSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxModulusSize = options.longs === String ? "0" : 0; - } - if (message.minModulusSize != null && message.hasOwnProperty("minModulusSize")) - if (typeof message.minModulusSize === "number") - object.minModulusSize = options.longs === String ? String(message.minModulusSize) : message.minModulusSize; - else - object.minModulusSize = options.longs === String ? $util.Long.prototype.toString.call(message.minModulusSize) : options.longs === Number ? new $util.LongBits(message.minModulusSize.low >>> 0, message.minModulusSize.high >>> 0).toNumber() : message.minModulusSize; - if (message.maxModulusSize != null && message.hasOwnProperty("maxModulusSize")) - if (typeof message.maxModulusSize === "number") - object.maxModulusSize = options.longs === String ? String(message.maxModulusSize) : message.maxModulusSize; - else - object.maxModulusSize = options.longs === String ? $util.Long.prototype.toString.call(message.maxModulusSize) : options.longs === Number ? new $util.LongBits(message.maxModulusSize.low >>> 0, message.maxModulusSize.high >>> 0).toNumber() : message.maxModulusSize; - return object; - }; - - /** - * Converts this RsaKeyType to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @instance - * @returns {Object.} JSON object - */ - RsaKeyType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RsaKeyType - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RsaKeyType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType"; - }; - - return RsaKeyType; - })(); - - AllowedKeyType.EcKeyType = (function() { - - /** - * Properties of an EcKeyType. - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @interface IEcKeyType - * @property {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm|null} [signatureAlgorithm] EcKeyType signatureAlgorithm - */ - - /** - * Constructs a new EcKeyType. - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType - * @classdesc Represents an EcKeyType. - * @implements IEcKeyType - * @constructor - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType=} [properties] Properties to set - */ - function EcKeyType(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]]; - } - - /** - * EcKeyType signatureAlgorithm. - * @member {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm} signatureAlgorithm - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType - * @instance - */ - EcKeyType.prototype.signatureAlgorithm = 0; - - /** - * Creates a new EcKeyType instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType} EcKeyType instance - */ - EcKeyType.create = function create(properties) { - return new EcKeyType(properties); - }; - - /** - * Encodes the specified EcKeyType message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType} message EcKeyType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EcKeyType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signatureAlgorithm != null && Object.hasOwnProperty.call(message, "signatureAlgorithm")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.signatureAlgorithm); - return writer; - }; - - /** - * Encodes the specified EcKeyType message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.IEcKeyType} message EcKeyType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EcKeyType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EcKeyType message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType} EcKeyType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EcKeyType.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.signatureAlgorithm = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EcKeyType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType} EcKeyType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EcKeyType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EcKeyType message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EcKeyType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signatureAlgorithm != null && message.hasOwnProperty("signatureAlgorithm")) - switch (message.signatureAlgorithm) { - default: - return "signatureAlgorithm: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates an EcKeyType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType} EcKeyType - */ - EcKeyType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType) - return object; - var message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType(); - switch (object.signatureAlgorithm) { - default: - if (typeof object.signatureAlgorithm === "number") { - message.signatureAlgorithm = object.signatureAlgorithm; - break; - } - break; - case "EC_SIGNATURE_ALGORITHM_UNSPECIFIED": - case 0: - message.signatureAlgorithm = 0; - break; - case "ECDSA_P256": - case 1: - message.signatureAlgorithm = 1; - break; - case "ECDSA_P384": - case 2: - message.signatureAlgorithm = 2; - break; - case "EDDSA_25519": - case 3: - message.signatureAlgorithm = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from an EcKeyType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType} message EcKeyType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EcKeyType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.signatureAlgorithm = options.enums === String ? "EC_SIGNATURE_ALGORITHM_UNSPECIFIED" : 0; - if (message.signatureAlgorithm != null && message.hasOwnProperty("signatureAlgorithm")) - object.signatureAlgorithm = options.enums === String ? $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm[message.signatureAlgorithm] === undefined ? message.signatureAlgorithm : $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm[message.signatureAlgorithm] : message.signatureAlgorithm; - return object; - }; - - /** - * Converts this EcKeyType to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType - * @instance - * @returns {Object.} JSON object - */ - EcKeyType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EcKeyType - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EcKeyType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType"; - }; - - /** - * EcSignatureAlgorithm enum. - * @name google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm - * @enum {number} - * @property {number} EC_SIGNATURE_ALGORITHM_UNSPECIFIED=0 EC_SIGNATURE_ALGORITHM_UNSPECIFIED value - * @property {number} ECDSA_P256=1 ECDSA_P256 value - * @property {number} ECDSA_P384=2 ECDSA_P384 value - * @property {number} EDDSA_25519=3 EDDSA_25519 value - */ - EcKeyType.EcSignatureAlgorithm = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EC_SIGNATURE_ALGORITHM_UNSPECIFIED"] = 0; - values[valuesById[1] = "ECDSA_P256"] = 1; - values[valuesById[2] = "ECDSA_P384"] = 2; - values[valuesById[3] = "EDDSA_25519"] = 3; - return values; - })(); - - return EcKeyType; - })(); - - return AllowedKeyType; - })(); - - IssuancePolicy.IssuanceModes = (function() { - - /** - * Properties of an IssuanceModes. - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @interface IIssuanceModes - * @property {boolean|null} [allowCsrBasedIssuance] IssuanceModes allowCsrBasedIssuance - * @property {boolean|null} [allowConfigBasedIssuance] IssuanceModes allowConfigBasedIssuance - */ - - /** - * Constructs a new IssuanceModes. - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy - * @classdesc Represents an IssuanceModes. - * @implements IIssuanceModes - * @constructor - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes=} [properties] Properties to set - */ - function IssuanceModes(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]]; - } - - /** - * IssuanceModes allowCsrBasedIssuance. - * @member {boolean} allowCsrBasedIssuance - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @instance - */ - IssuanceModes.prototype.allowCsrBasedIssuance = false; - - /** - * IssuanceModes allowConfigBasedIssuance. - * @member {boolean} allowConfigBasedIssuance - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @instance - */ - IssuanceModes.prototype.allowConfigBasedIssuance = false; - - /** - * Creates a new IssuanceModes instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes} IssuanceModes instance - */ - IssuanceModes.create = function create(properties) { - return new IssuanceModes(properties); - }; - - /** - * Encodes the specified IssuanceModes message. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes} message IssuanceModes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IssuanceModes.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowCsrBasedIssuance != null && Object.hasOwnProperty.call(message, "allowCsrBasedIssuance")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowCsrBasedIssuance); - if (message.allowConfigBasedIssuance != null && Object.hasOwnProperty.call(message, "allowConfigBasedIssuance")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowConfigBasedIssuance); - return writer; - }; - - /** - * Encodes the specified IssuanceModes message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes} message IssuanceModes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IssuanceModes.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IssuanceModes message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes} IssuanceModes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IssuanceModes.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.allowCsrBasedIssuance = reader.bool(); - break; - } - case 2: { - message.allowConfigBasedIssuance = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IssuanceModes message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes} IssuanceModes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IssuanceModes.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IssuanceModes message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IssuanceModes.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowCsrBasedIssuance != null && message.hasOwnProperty("allowCsrBasedIssuance")) - if (typeof message.allowCsrBasedIssuance !== "boolean") - return "allowCsrBasedIssuance: boolean expected"; - if (message.allowConfigBasedIssuance != null && message.hasOwnProperty("allowConfigBasedIssuance")) - if (typeof message.allowConfigBasedIssuance !== "boolean") - return "allowConfigBasedIssuance: boolean expected"; - return null; - }; - - /** - * Creates an IssuanceModes message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes} IssuanceModes - */ - IssuanceModes.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes) - return object; - var message = new $root.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes(); - if (object.allowCsrBasedIssuance != null) - message.allowCsrBasedIssuance = Boolean(object.allowCsrBasedIssuance); - if (object.allowConfigBasedIssuance != null) - message.allowConfigBasedIssuance = Boolean(object.allowConfigBasedIssuance); - return message; - }; - - /** - * Creates a plain object from an IssuanceModes message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @static - * @param {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes} message IssuanceModes - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IssuanceModes.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.allowCsrBasedIssuance = false; - object.allowConfigBasedIssuance = false; - } - if (message.allowCsrBasedIssuance != null && message.hasOwnProperty("allowCsrBasedIssuance")) - object.allowCsrBasedIssuance = message.allowCsrBasedIssuance; - if (message.allowConfigBasedIssuance != null && message.hasOwnProperty("allowConfigBasedIssuance")) - object.allowConfigBasedIssuance = message.allowConfigBasedIssuance; - return object; - }; - - /** - * Converts this IssuanceModes to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @instance - * @returns {Object.} JSON object - */ - IssuanceModes.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IssuanceModes - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IssuanceModes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes"; - }; - - return IssuanceModes; - })(); - - return IssuancePolicy; - })(); - - return CaPool; - })(); - - v1.EncryptionSpec = (function() { - - /** - * Properties of an EncryptionSpec. - * @memberof google.cloud.security.privateca.v1 - * @interface IEncryptionSpec - * @property {string|null} [cloudKmsKey] EncryptionSpec cloudKmsKey - */ - - /** - * Constructs a new EncryptionSpec. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an EncryptionSpec. - * @implements IEncryptionSpec - * @constructor - * @param {google.cloud.security.privateca.v1.IEncryptionSpec=} [properties] Properties to set - */ - function EncryptionSpec(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]]; - } - - /** - * EncryptionSpec cloudKmsKey. - * @member {string} cloudKmsKey - * @memberof google.cloud.security.privateca.v1.EncryptionSpec - * @instance - */ - EncryptionSpec.prototype.cloudKmsKey = ""; - - /** - * Creates a new EncryptionSpec instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.EncryptionSpec - * @static - * @param {google.cloud.security.privateca.v1.IEncryptionSpec=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec instance - */ - EncryptionSpec.create = function create(properties) { - return new EncryptionSpec(properties); - }; - - /** - * Encodes the specified EncryptionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.EncryptionSpec - * @static - * @param {google.cloud.security.privateca.v1.IEncryptionSpec} message EncryptionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cloudKmsKey != null && Object.hasOwnProperty.call(message, "cloudKmsKey")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudKmsKey); - return writer; - }; - - /** - * Encodes the specified EncryptionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.EncryptionSpec - * @static - * @param {google.cloud.security.privateca.v1.IEncryptionSpec} message EncryptionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.EncryptionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.EncryptionSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cloudKmsKey = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.EncryptionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionSpec message. - * @function verify - * @memberof google.cloud.security.privateca.v1.EncryptionSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cloudKmsKey != null && message.hasOwnProperty("cloudKmsKey")) - if (!$util.isString(message.cloudKmsKey)) - return "cloudKmsKey: string expected"; - return null; - }; - - /** - * Creates an EncryptionSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.EncryptionSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec - */ - EncryptionSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.EncryptionSpec) - return object; - var message = new $root.google.cloud.security.privateca.v1.EncryptionSpec(); - if (object.cloudKmsKey != null) - message.cloudKmsKey = String(object.cloudKmsKey); - return message; - }; - - /** - * Creates a plain object from an EncryptionSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.EncryptionSpec - * @static - * @param {google.cloud.security.privateca.v1.EncryptionSpec} message EncryptionSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.cloudKmsKey = ""; - if (message.cloudKmsKey != null && message.hasOwnProperty("cloudKmsKey")) - object.cloudKmsKey = message.cloudKmsKey; - return object; - }; - - /** - * Converts this EncryptionSpec to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.EncryptionSpec - * @instance - * @returns {Object.} JSON object - */ - EncryptionSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionSpec - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.EncryptionSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.EncryptionSpec"; - }; - - return EncryptionSpec; - })(); - - v1.CertificateRevocationList = (function() { - - /** - * Properties of a CertificateRevocationList. - * @memberof google.cloud.security.privateca.v1 - * @interface ICertificateRevocationList - * @property {string|null} [name] CertificateRevocationList name - * @property {number|Long|null} [sequenceNumber] CertificateRevocationList sequenceNumber - * @property {Array.|null} [revokedCertificates] CertificateRevocationList revokedCertificates - * @property {string|null} [pemCrl] CertificateRevocationList pemCrl - * @property {string|null} [accessUrl] CertificateRevocationList accessUrl - * @property {google.cloud.security.privateca.v1.CertificateRevocationList.State|null} [state] CertificateRevocationList state - * @property {google.protobuf.ITimestamp|null} [createTime] CertificateRevocationList createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateRevocationList updateTime - * @property {string|null} [revisionId] CertificateRevocationList revisionId - * @property {Object.|null} [labels] CertificateRevocationList labels - */ - - /** - * Constructs a new CertificateRevocationList. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CertificateRevocationList. - * @implements ICertificateRevocationList - * @constructor - * @param {google.cloud.security.privateca.v1.ICertificateRevocationList=} [properties] Properties to set - */ - function CertificateRevocationList(properties) { - this.revokedCertificates = []; - 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]]; - } - - /** - * CertificateRevocationList name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.name = ""; - - /** - * CertificateRevocationList sequenceNumber. - * @member {number|Long} sequenceNumber - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * CertificateRevocationList revokedCertificates. - * @member {Array.} revokedCertificates - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.revokedCertificates = $util.emptyArray; - - /** - * CertificateRevocationList pemCrl. - * @member {string} pemCrl - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.pemCrl = ""; - - /** - * CertificateRevocationList accessUrl. - * @member {string} accessUrl - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.accessUrl = ""; - - /** - * CertificateRevocationList state. - * @member {google.cloud.security.privateca.v1.CertificateRevocationList.State} state - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.state = 0; - - /** - * CertificateRevocationList createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.createTime = null; - - /** - * CertificateRevocationList updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.updateTime = null; - - /** - * CertificateRevocationList revisionId. - * @member {string} revisionId - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.revisionId = ""; - - /** - * CertificateRevocationList labels. - * @member {Object.} labels - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.labels = $util.emptyObject; - - /** - * Creates a new CertificateRevocationList instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @static - * @param {google.cloud.security.privateca.v1.ICertificateRevocationList=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateRevocationList} CertificateRevocationList instance - */ - CertificateRevocationList.create = function create(properties) { - return new CertificateRevocationList(properties); - }; - - /** - * Encodes the specified CertificateRevocationList message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @static - * @param {google.cloud.security.privateca.v1.ICertificateRevocationList} message CertificateRevocationList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateRevocationList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sequenceNumber); - if (message.revokedCertificates != null && message.revokedCertificates.length) - for (var i = 0; i < message.revokedCertificates.length; ++i) - $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.encode(message.revokedCertificates[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.pemCrl != null && Object.hasOwnProperty.call(message, "pemCrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pemCrl); - if (message.accessUrl != null && Object.hasOwnProperty.call(message, "accessUrl")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.accessUrl); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.revisionId); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 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(); - return writer; - }; - - /** - * Encodes the specified CertificateRevocationList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @static - * @param {google.cloud.security.privateca.v1.ICertificateRevocationList} message CertificateRevocationList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateRevocationList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateRevocationList message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateRevocationList} CertificateRevocationList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateRevocationList.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateRevocationList(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.sequenceNumber = reader.int64(); - break; - } - case 3: { - if (!(message.revokedCertificates && message.revokedCertificates.length)) - message.revokedCertificates = []; - message.revokedCertificates.push($root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.decode(reader, reader.uint32())); - break; - } - case 4: { - message.pemCrl = reader.string(); - break; - } - case 5: { - message.accessUrl = reader.string(); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.revisionId = reader.string(); - break; - } - case 10: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateRevocationList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateRevocationList} CertificateRevocationList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateRevocationList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateRevocationList message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateRevocationList.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.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) - if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) - return "sequenceNumber: integer|Long expected"; - if (message.revokedCertificates != null && message.hasOwnProperty("revokedCertificates")) { - if (!Array.isArray(message.revokedCertificates)) - return "revokedCertificates: array expected"; - for (var i = 0; i < message.revokedCertificates.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.verify(message.revokedCertificates[i]); - if (error) - return "revokedCertificates." + error; - } - } - if (message.pemCrl != null && message.hasOwnProperty("pemCrl")) - if (!$util.isString(message.pemCrl)) - return "pemCrl: string expected"; - if (message.accessUrl != null && message.hasOwnProperty("accessUrl")) - if (!$util.isString(message.accessUrl)) - return "accessUrl: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a CertificateRevocationList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateRevocationList} CertificateRevocationList - */ - CertificateRevocationList.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateRevocationList) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateRevocationList(); - if (object.name != null) - message.name = String(object.name); - if (object.sequenceNumber != null) - if ($util.Long) - (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; - else if (typeof object.sequenceNumber === "string") - message.sequenceNumber = parseInt(object.sequenceNumber, 10); - else if (typeof object.sequenceNumber === "number") - message.sequenceNumber = object.sequenceNumber; - else if (typeof object.sequenceNumber === "object") - message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); - if (object.revokedCertificates) { - if (!Array.isArray(object.revokedCertificates)) - throw TypeError(".google.cloud.security.privateca.v1.CertificateRevocationList.revokedCertificates: array expected"); - message.revokedCertificates = []; - for (var i = 0; i < object.revokedCertificates.length; ++i) { - if (typeof object.revokedCertificates[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateRevocationList.revokedCertificates: object expected"); - message.revokedCertificates[i] = $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.fromObject(object.revokedCertificates[i]); - } - } - if (object.pemCrl != null) - message.pemCrl = String(object.pemCrl); - if (object.accessUrl != null) - message.accessUrl = String(object.accessUrl); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "SUPERSEDED": - case 2: - message.state = 2; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateRevocationList.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateRevocationList.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateRevocationList.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 CertificateRevocationList message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @static - * @param {google.cloud.security.privateca.v1.CertificateRevocationList} message CertificateRevocationList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateRevocationList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.revokedCertificates = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequenceNumber = options.longs === String ? "0" : 0; - object.pemCrl = ""; - object.accessUrl = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - object.revisionId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) - if (typeof message.sequenceNumber === "number") - object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; - else - object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; - if (message.revokedCertificates && message.revokedCertificates.length) { - object.revokedCertificates = []; - for (var j = 0; j < message.revokedCertificates.length; ++j) - object.revokedCertificates[j] = $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.toObject(message.revokedCertificates[j], options); - } - if (message.pemCrl != null && message.hasOwnProperty("pemCrl")) - object.pemCrl = message.pemCrl; - if (message.accessUrl != null && message.hasOwnProperty("accessUrl")) - object.accessUrl = message.accessUrl; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.security.privateca.v1.CertificateRevocationList.State[message.state] === undefined ? message.state : $root.google.cloud.security.privateca.v1.CertificateRevocationList.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - object.revisionId = message.revisionId; - 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]]; - } - return object; - }; - - /** - * Converts this CertificateRevocationList to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @instance - * @returns {Object.} JSON object - */ - CertificateRevocationList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateRevocationList - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateRevocationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateRevocationList"; - }; - - CertificateRevocationList.RevokedCertificate = (function() { - - /** - * Properties of a RevokedCertificate. - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @interface IRevokedCertificate - * @property {string|null} [certificate] RevokedCertificate certificate - * @property {string|null} [hexSerialNumber] RevokedCertificate hexSerialNumber - * @property {google.cloud.security.privateca.v1.RevocationReason|null} [revocationReason] RevokedCertificate revocationReason - */ - - /** - * Constructs a new RevokedCertificate. - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList - * @classdesc Represents a RevokedCertificate. - * @implements IRevokedCertificate - * @constructor - * @param {google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate=} [properties] Properties to set - */ - function RevokedCertificate(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]]; - } - - /** - * RevokedCertificate certificate. - * @member {string} certificate - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @instance - */ - RevokedCertificate.prototype.certificate = ""; - - /** - * RevokedCertificate hexSerialNumber. - * @member {string} hexSerialNumber - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @instance - */ - RevokedCertificate.prototype.hexSerialNumber = ""; - - /** - * RevokedCertificate revocationReason. - * @member {google.cloud.security.privateca.v1.RevocationReason} revocationReason - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @instance - */ - RevokedCertificate.prototype.revocationReason = 0; - - /** - * Creates a new RevokedCertificate instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @static - * @param {google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate} RevokedCertificate instance - */ - RevokedCertificate.create = function create(properties) { - return new RevokedCertificate(properties); - }; - - /** - * Encodes the specified RevokedCertificate message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @static - * @param {google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate} message RevokedCertificate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevokedCertificate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificate); - if (message.hexSerialNumber != null && Object.hasOwnProperty.call(message, "hexSerialNumber")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.hexSerialNumber); - if (message.revocationReason != null && Object.hasOwnProperty.call(message, "revocationReason")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.revocationReason); - return writer; - }; - - /** - * Encodes the specified RevokedCertificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @static - * @param {google.cloud.security.privateca.v1.CertificateRevocationList.IRevokedCertificate} message RevokedCertificate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevokedCertificate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevokedCertificate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate} RevokedCertificate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevokedCertificate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.certificate = reader.string(); - break; - } - case 2: { - message.hexSerialNumber = reader.string(); - break; - } - case 3: { - message.revocationReason = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevokedCertificate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate} RevokedCertificate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevokedCertificate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevokedCertificate message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevokedCertificate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificate != null && message.hasOwnProperty("certificate")) - if (!$util.isString(message.certificate)) - return "certificate: string expected"; - if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) - if (!$util.isString(message.hexSerialNumber)) - return "hexSerialNumber: string expected"; - if (message.revocationReason != null && message.hasOwnProperty("revocationReason")) - switch (message.revocationReason) { - default: - return "revocationReason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - return null; - }; - - /** - * Creates a RevokedCertificate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate} RevokedCertificate - */ - RevokedCertificate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate(); - if (object.certificate != null) - message.certificate = String(object.certificate); - if (object.hexSerialNumber != null) - message.hexSerialNumber = String(object.hexSerialNumber); - switch (object.revocationReason) { - default: - if (typeof object.revocationReason === "number") { - message.revocationReason = object.revocationReason; - break; - } - break; - case "REVOCATION_REASON_UNSPECIFIED": - case 0: - message.revocationReason = 0; - break; - case "KEY_COMPROMISE": - case 1: - message.revocationReason = 1; - break; - case "CERTIFICATE_AUTHORITY_COMPROMISE": - case 2: - message.revocationReason = 2; - break; - case "AFFILIATION_CHANGED": - case 3: - message.revocationReason = 3; - break; - case "SUPERSEDED": - case 4: - message.revocationReason = 4; - break; - case "CESSATION_OF_OPERATION": - case 5: - message.revocationReason = 5; - break; - case "CERTIFICATE_HOLD": - case 6: - message.revocationReason = 6; - break; - case "PRIVILEGE_WITHDRAWN": - case 7: - message.revocationReason = 7; - break; - case "ATTRIBUTE_AUTHORITY_COMPROMISE": - case 8: - message.revocationReason = 8; - break; - } - return message; - }; - - /** - * Creates a plain object from a RevokedCertificate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @static - * @param {google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate} message RevokedCertificate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevokedCertificate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.certificate = ""; - object.hexSerialNumber = ""; - object.revocationReason = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; - } - if (message.certificate != null && message.hasOwnProperty("certificate")) - object.certificate = message.certificate; - if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) - object.hexSerialNumber = message.hexSerialNumber; - if (message.revocationReason != null && message.hasOwnProperty("revocationReason")) - object.revocationReason = options.enums === String ? $root.google.cloud.security.privateca.v1.RevocationReason[message.revocationReason] === undefined ? message.revocationReason : $root.google.cloud.security.privateca.v1.RevocationReason[message.revocationReason] : message.revocationReason; - return object; - }; - - /** - * Converts this RevokedCertificate to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @instance - * @returns {Object.} JSON object - */ - RevokedCertificate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevokedCertificate - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevokedCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate"; - }; - - return RevokedCertificate; - })(); - - /** - * State enum. - * @name google.cloud.security.privateca.v1.CertificateRevocationList.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} SUPERSEDED=2 SUPERSEDED value - */ - CertificateRevocationList.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "SUPERSEDED"] = 2; - return values; - })(); - - return CertificateRevocationList; - })(); - - v1.Certificate = (function() { - - /** - * Properties of a Certificate. - * @memberof google.cloud.security.privateca.v1 - * @interface ICertificate - * @property {string|null} [name] Certificate name - * @property {string|null} [pemCsr] Certificate pemCsr - * @property {google.cloud.security.privateca.v1.ICertificateConfig|null} [config] Certificate config - * @property {string|null} [issuerCertificateAuthority] Certificate issuerCertificateAuthority - * @property {google.protobuf.IDuration|null} [lifetime] Certificate lifetime - * @property {string|null} [certificateTemplate] Certificate certificateTemplate - * @property {google.cloud.security.privateca.v1.SubjectRequestMode|null} [subjectMode] Certificate subjectMode - * @property {google.cloud.security.privateca.v1.Certificate.IRevocationDetails|null} [revocationDetails] Certificate revocationDetails - * @property {string|null} [pemCertificate] Certificate pemCertificate - * @property {google.cloud.security.privateca.v1.ICertificateDescription|null} [certificateDescription] Certificate certificateDescription - * @property {Array.|null} [pemCertificateChain] Certificate pemCertificateChain - * @property {google.protobuf.ITimestamp|null} [createTime] Certificate createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Certificate updateTime - * @property {Object.|null} [labels] Certificate labels - * @property {google.protobuf.ITimestamp|null} [requestedNotBeforeTime] Certificate requestedNotBeforeTime - */ - - /** - * Constructs a new Certificate. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a Certificate. - * @implements ICertificate - * @constructor - * @param {google.cloud.security.privateca.v1.ICertificate=} [properties] Properties to set - */ - function Certificate(properties) { - this.pemCertificateChain = []; - 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]]; - } - - /** - * Certificate name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.name = ""; - - /** - * Certificate pemCsr. - * @member {string|null|undefined} pemCsr - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.pemCsr = null; - - /** - * Certificate config. - * @member {google.cloud.security.privateca.v1.ICertificateConfig|null|undefined} config - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.config = null; - - /** - * Certificate issuerCertificateAuthority. - * @member {string} issuerCertificateAuthority - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.issuerCertificateAuthority = ""; - - /** - * Certificate lifetime. - * @member {google.protobuf.IDuration|null|undefined} lifetime - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.lifetime = null; - - /** - * Certificate certificateTemplate. - * @member {string} certificateTemplate - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.certificateTemplate = ""; - - /** - * Certificate subjectMode. - * @member {google.cloud.security.privateca.v1.SubjectRequestMode} subjectMode - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.subjectMode = 0; - - /** - * Certificate revocationDetails. - * @member {google.cloud.security.privateca.v1.Certificate.IRevocationDetails|null|undefined} revocationDetails - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.revocationDetails = null; - - /** - * Certificate pemCertificate. - * @member {string} pemCertificate - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.pemCertificate = ""; - - /** - * Certificate certificateDescription. - * @member {google.cloud.security.privateca.v1.ICertificateDescription|null|undefined} certificateDescription - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.certificateDescription = null; - - /** - * Certificate pemCertificateChain. - * @member {Array.} pemCertificateChain - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.pemCertificateChain = $util.emptyArray; - - /** - * Certificate createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.createTime = null; - - /** - * Certificate updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.updateTime = null; - - /** - * Certificate labels. - * @member {Object.} labels - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.labels = $util.emptyObject; - - /** - * Certificate requestedNotBeforeTime. - * @member {google.protobuf.ITimestamp|null|undefined} requestedNotBeforeTime - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Certificate.prototype.requestedNotBeforeTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Certificate certificateConfig. - * @member {"pemCsr"|"config"|undefined} certificateConfig - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - */ - Object.defineProperty(Certificate.prototype, "certificateConfig", { - get: $util.oneOfGetter($oneOfFields = ["pemCsr", "config"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Certificate instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.Certificate - * @static - * @param {google.cloud.security.privateca.v1.ICertificate=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.Certificate} Certificate instance - */ - Certificate.create = function create(properties) { - return new Certificate(properties); - }; - - /** - * Encodes the specified Certificate message. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.Certificate - * @static - * @param {google.cloud.security.privateca.v1.ICertificate} message Certificate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Certificate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCsr); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.security.privateca.v1.CertificateConfig.encode(message.config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.issuerCertificateAuthority != null && Object.hasOwnProperty.call(message, "issuerCertificateAuthority")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.issuerCertificateAuthority); - if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) - $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.certificateTemplate != null && Object.hasOwnProperty.call(message, "certificateTemplate")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.certificateTemplate); - if (message.subjectMode != null && Object.hasOwnProperty.call(message, "subjectMode")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.subjectMode); - if (message.revocationDetails != null && Object.hasOwnProperty.call(message, "revocationDetails")) - $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails.encode(message.revocationDetails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.pemCertificate); - if (message.certificateDescription != null && Object.hasOwnProperty.call(message, "certificateDescription")) - $root.google.cloud.security.privateca.v1.CertificateDescription.encode(message.certificateDescription, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.pemCertificateChain != null && message.pemCertificateChain.length) - for (var i = 0; i < message.pemCertificateChain.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.pemCertificateChain[i]); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.requestedNotBeforeTime != null && Object.hasOwnProperty.call(message, "requestedNotBeforeTime")) - $root.google.protobuf.Timestamp.encode(message.requestedNotBeforeTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Certificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.Certificate - * @static - * @param {google.cloud.security.privateca.v1.ICertificate} message Certificate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Certificate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Certificate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.Certificate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.Certificate} Certificate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Certificate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.Certificate(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.pemCsr = reader.string(); - break; - } - case 3: { - message.config = $root.google.cloud.security.privateca.v1.CertificateConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.issuerCertificateAuthority = reader.string(); - break; - } - case 5: { - message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.certificateTemplate = reader.string(); - break; - } - case 7: { - message.subjectMode = reader.int32(); - break; - } - case 8: { - message.revocationDetails = $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails.decode(reader, reader.uint32()); - break; - } - case 9: { - message.pemCertificate = reader.string(); - break; - } - case 10: { - message.certificateDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.decode(reader, reader.uint32()); - break; - } - case 11: { - if (!(message.pemCertificateChain && message.pemCertificateChain.length)) - message.pemCertificateChain = []; - message.pemCertificateChain.push(reader.string()); - break; - } - case 12: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 13: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 15: { - message.requestedNotBeforeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Certificate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.Certificate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.Certificate} Certificate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Certificate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Certificate message. - * @function verify - * @memberof google.cloud.security.privateca.v1.Certificate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Certificate.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.pemCsr != null && message.hasOwnProperty("pemCsr")) { - properties.certificateConfig = 1; - if (!$util.isString(message.pemCsr)) - return "pemCsr: string expected"; - } - if (message.config != null && message.hasOwnProperty("config")) { - if (properties.certificateConfig === 1) - return "certificateConfig: multiple values"; - properties.certificateConfig = 1; - { - var error = $root.google.cloud.security.privateca.v1.CertificateConfig.verify(message.config); - if (error) - return "config." + error; - } - } - if (message.issuerCertificateAuthority != null && message.hasOwnProperty("issuerCertificateAuthority")) - if (!$util.isString(message.issuerCertificateAuthority)) - return "issuerCertificateAuthority: string expected"; - if (message.lifetime != null && message.hasOwnProperty("lifetime")) { - var error = $root.google.protobuf.Duration.verify(message.lifetime); - if (error) - return "lifetime." + error; - } - if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) - if (!$util.isString(message.certificateTemplate)) - return "certificateTemplate: string expected"; - if (message.subjectMode != null && message.hasOwnProperty("subjectMode")) - switch (message.subjectMode) { - default: - return "subjectMode: enum value expected"; - case 0: - case 1: - case 3: - case 2: - break; - } - if (message.revocationDetails != null && message.hasOwnProperty("revocationDetails")) { - var error = $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails.verify(message.revocationDetails); - if (error) - return "revocationDetails." + error; - } - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - if (!$util.isString(message.pemCertificate)) - return "pemCertificate: string expected"; - if (message.certificateDescription != null && message.hasOwnProperty("certificateDescription")) { - var error = $root.google.cloud.security.privateca.v1.CertificateDescription.verify(message.certificateDescription); - if (error) - return "certificateDescription." + error; - } - if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { - if (!Array.isArray(message.pemCertificateChain)) - return "pemCertificateChain: array expected"; - for (var i = 0; i < message.pemCertificateChain.length; ++i) - if (!$util.isString(message.pemCertificateChain[i])) - return "pemCertificateChain: string[] expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.requestedNotBeforeTime != null && message.hasOwnProperty("requestedNotBeforeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.requestedNotBeforeTime); - if (error) - return "requestedNotBeforeTime." + error; - } - return null; - }; - - /** - * Creates a Certificate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.Certificate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.Certificate} Certificate - */ - Certificate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.Certificate) - return object; - var message = new $root.google.cloud.security.privateca.v1.Certificate(); - if (object.name != null) - message.name = String(object.name); - if (object.pemCsr != null) - message.pemCsr = String(object.pemCsr); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.security.privateca.v1.Certificate.config: object expected"); - message.config = $root.google.cloud.security.privateca.v1.CertificateConfig.fromObject(object.config); - } - if (object.issuerCertificateAuthority != null) - message.issuerCertificateAuthority = String(object.issuerCertificateAuthority); - if (object.lifetime != null) { - if (typeof object.lifetime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.Certificate.lifetime: object expected"); - message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); - } - if (object.certificateTemplate != null) - message.certificateTemplate = String(object.certificateTemplate); - switch (object.subjectMode) { - default: - if (typeof object.subjectMode === "number") { - message.subjectMode = object.subjectMode; - break; - } - break; - case "SUBJECT_REQUEST_MODE_UNSPECIFIED": - case 0: - message.subjectMode = 0; - break; - case "DEFAULT": - case 1: - message.subjectMode = 1; - break; - case "RDN_SEQUENCE": - case 3: - message.subjectMode = 3; - break; - case "REFLECTED_SPIFFE": - case 2: - message.subjectMode = 2; - break; - } - if (object.revocationDetails != null) { - if (typeof object.revocationDetails !== "object") - throw TypeError(".google.cloud.security.privateca.v1.Certificate.revocationDetails: object expected"); - message.revocationDetails = $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails.fromObject(object.revocationDetails); - } - if (object.pemCertificate != null) - message.pemCertificate = String(object.pemCertificate); - if (object.certificateDescription != null) { - if (typeof object.certificateDescription !== "object") - throw TypeError(".google.cloud.security.privateca.v1.Certificate.certificateDescription: object expected"); - message.certificateDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.fromObject(object.certificateDescription); - } - if (object.pemCertificateChain) { - if (!Array.isArray(object.pemCertificateChain)) - throw TypeError(".google.cloud.security.privateca.v1.Certificate.pemCertificateChain: array expected"); - message.pemCertificateChain = []; - for (var i = 0; i < object.pemCertificateChain.length; ++i) - message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.Certificate.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.Certificate.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.security.privateca.v1.Certificate.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.requestedNotBeforeTime != null) { - if (typeof object.requestedNotBeforeTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.Certificate.requestedNotBeforeTime: object expected"); - message.requestedNotBeforeTime = $root.google.protobuf.Timestamp.fromObject(object.requestedNotBeforeTime); - } - return message; - }; - - /** - * Creates a plain object from a Certificate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.Certificate - * @static - * @param {google.cloud.security.privateca.v1.Certificate} message Certificate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Certificate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pemCertificateChain = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.issuerCertificateAuthority = ""; - object.lifetime = null; - object.certificateTemplate = ""; - object.subjectMode = options.enums === String ? "SUBJECT_REQUEST_MODE_UNSPECIFIED" : 0; - object.revocationDetails = null; - object.pemCertificate = ""; - object.certificateDescription = null; - object.createTime = null; - object.updateTime = null; - object.requestedNotBeforeTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) { - object.pemCsr = message.pemCsr; - if (options.oneofs) - object.certificateConfig = "pemCsr"; - } - if (message.config != null && message.hasOwnProperty("config")) { - object.config = $root.google.cloud.security.privateca.v1.CertificateConfig.toObject(message.config, options); - if (options.oneofs) - object.certificateConfig = "config"; - } - if (message.issuerCertificateAuthority != null && message.hasOwnProperty("issuerCertificateAuthority")) - object.issuerCertificateAuthority = message.issuerCertificateAuthority; - if (message.lifetime != null && message.hasOwnProperty("lifetime")) - object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); - if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) - object.certificateTemplate = message.certificateTemplate; - if (message.subjectMode != null && message.hasOwnProperty("subjectMode")) - object.subjectMode = options.enums === String ? $root.google.cloud.security.privateca.v1.SubjectRequestMode[message.subjectMode] === undefined ? message.subjectMode : $root.google.cloud.security.privateca.v1.SubjectRequestMode[message.subjectMode] : message.subjectMode; - if (message.revocationDetails != null && message.hasOwnProperty("revocationDetails")) - object.revocationDetails = $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails.toObject(message.revocationDetails, options); - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - object.pemCertificate = message.pemCertificate; - if (message.certificateDescription != null && message.hasOwnProperty("certificateDescription")) - object.certificateDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.toObject(message.certificateDescription, options); - if (message.pemCertificateChain && message.pemCertificateChain.length) { - object.pemCertificateChain = []; - for (var j = 0; j < message.pemCertificateChain.length; ++j) - object.pemCertificateChain[j] = message.pemCertificateChain[j]; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.requestedNotBeforeTime != null && message.hasOwnProperty("requestedNotBeforeTime")) - object.requestedNotBeforeTime = $root.google.protobuf.Timestamp.toObject(message.requestedNotBeforeTime, options); - return object; - }; - - /** - * Converts this Certificate to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.Certificate - * @instance - * @returns {Object.} JSON object - */ - Certificate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Certificate - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.Certificate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Certificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.Certificate"; - }; - - Certificate.RevocationDetails = (function() { - - /** - * Properties of a RevocationDetails. - * @memberof google.cloud.security.privateca.v1.Certificate - * @interface IRevocationDetails - * @property {google.cloud.security.privateca.v1.RevocationReason|null} [revocationState] RevocationDetails revocationState - * @property {google.protobuf.ITimestamp|null} [revocationTime] RevocationDetails revocationTime - */ - - /** - * Constructs a new RevocationDetails. - * @memberof google.cloud.security.privateca.v1.Certificate - * @classdesc Represents a RevocationDetails. - * @implements IRevocationDetails - * @constructor - * @param {google.cloud.security.privateca.v1.Certificate.IRevocationDetails=} [properties] Properties to set - */ - function RevocationDetails(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]]; - } - - /** - * RevocationDetails revocationState. - * @member {google.cloud.security.privateca.v1.RevocationReason} revocationState - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @instance - */ - RevocationDetails.prototype.revocationState = 0; - - /** - * RevocationDetails revocationTime. - * @member {google.protobuf.ITimestamp|null|undefined} revocationTime - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @instance - */ - RevocationDetails.prototype.revocationTime = null; - - /** - * Creates a new RevocationDetails instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @static - * @param {google.cloud.security.privateca.v1.Certificate.IRevocationDetails=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.Certificate.RevocationDetails} RevocationDetails instance - */ - RevocationDetails.create = function create(properties) { - return new RevocationDetails(properties); - }; - - /** - * Encodes the specified RevocationDetails message. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.RevocationDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @static - * @param {google.cloud.security.privateca.v1.Certificate.IRevocationDetails} message RevocationDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevocationDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revocationState != null && Object.hasOwnProperty.call(message, "revocationState")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revocationState); - if (message.revocationTime != null && Object.hasOwnProperty.call(message, "revocationTime")) - $root.google.protobuf.Timestamp.encode(message.revocationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RevocationDetails message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Certificate.RevocationDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @static - * @param {google.cloud.security.privateca.v1.Certificate.IRevocationDetails} message RevocationDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevocationDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevocationDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.Certificate.RevocationDetails} RevocationDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevocationDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revocationState = reader.int32(); - break; - } - case 2: { - message.revocationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevocationDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.Certificate.RevocationDetails} RevocationDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevocationDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevocationDetails message. - * @function verify - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevocationDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revocationState != null && message.hasOwnProperty("revocationState")) - switch (message.revocationState) { - default: - return "revocationState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.revocationTime != null && message.hasOwnProperty("revocationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.revocationTime); - if (error) - return "revocationTime." + error; - } - return null; - }; - - /** - * Creates a RevocationDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.Certificate.RevocationDetails} RevocationDetails - */ - RevocationDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails) - return object; - var message = new $root.google.cloud.security.privateca.v1.Certificate.RevocationDetails(); - switch (object.revocationState) { - default: - if (typeof object.revocationState === "number") { - message.revocationState = object.revocationState; - break; - } - break; - case "REVOCATION_REASON_UNSPECIFIED": - case 0: - message.revocationState = 0; - break; - case "KEY_COMPROMISE": - case 1: - message.revocationState = 1; - break; - case "CERTIFICATE_AUTHORITY_COMPROMISE": - case 2: - message.revocationState = 2; - break; - case "AFFILIATION_CHANGED": - case 3: - message.revocationState = 3; - break; - case "SUPERSEDED": - case 4: - message.revocationState = 4; - break; - case "CESSATION_OF_OPERATION": - case 5: - message.revocationState = 5; - break; - case "CERTIFICATE_HOLD": - case 6: - message.revocationState = 6; - break; - case "PRIVILEGE_WITHDRAWN": - case 7: - message.revocationState = 7; - break; - case "ATTRIBUTE_AUTHORITY_COMPROMISE": - case 8: - message.revocationState = 8; - break; - } - if (object.revocationTime != null) { - if (typeof object.revocationTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.Certificate.RevocationDetails.revocationTime: object expected"); - message.revocationTime = $root.google.protobuf.Timestamp.fromObject(object.revocationTime); - } - return message; - }; - - /** - * Creates a plain object from a RevocationDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @static - * @param {google.cloud.security.privateca.v1.Certificate.RevocationDetails} message RevocationDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevocationDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.revocationState = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; - object.revocationTime = null; - } - if (message.revocationState != null && message.hasOwnProperty("revocationState")) - object.revocationState = options.enums === String ? $root.google.cloud.security.privateca.v1.RevocationReason[message.revocationState] === undefined ? message.revocationState : $root.google.cloud.security.privateca.v1.RevocationReason[message.revocationState] : message.revocationState; - if (message.revocationTime != null && message.hasOwnProperty("revocationTime")) - object.revocationTime = $root.google.protobuf.Timestamp.toObject(message.revocationTime, options); - return object; - }; - - /** - * Converts this RevocationDetails to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @instance - * @returns {Object.} JSON object - */ - RevocationDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevocationDetails - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.Certificate.RevocationDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevocationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.Certificate.RevocationDetails"; - }; - - return RevocationDetails; - })(); - - return Certificate; - })(); - - v1.CertificateTemplate = (function() { - - /** - * Properties of a CertificateTemplate. - * @memberof google.cloud.security.privateca.v1 - * @interface ICertificateTemplate - * @property {string|null} [name] CertificateTemplate name - * @property {google.protobuf.IDuration|null} [maximumLifetime] CertificateTemplate maximumLifetime - * @property {google.cloud.security.privateca.v1.IX509Parameters|null} [predefinedValues] CertificateTemplate predefinedValues - * @property {google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null} [identityConstraints] CertificateTemplate identityConstraints - * @property {google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null} [passthroughExtensions] CertificateTemplate passthroughExtensions - * @property {string|null} [description] CertificateTemplate description - * @property {google.protobuf.ITimestamp|null} [createTime] CertificateTemplate createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateTemplate updateTime - * @property {Object.|null} [labels] CertificateTemplate labels - */ - - /** - * Constructs a new CertificateTemplate. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CertificateTemplate. - * @implements ICertificateTemplate - * @constructor - * @param {google.cloud.security.privateca.v1.ICertificateTemplate=} [properties] Properties to set - */ - function CertificateTemplate(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]]; - } - - /** - * CertificateTemplate name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @instance - */ - CertificateTemplate.prototype.name = ""; - - /** - * CertificateTemplate maximumLifetime. - * @member {google.protobuf.IDuration|null|undefined} maximumLifetime - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @instance - */ - CertificateTemplate.prototype.maximumLifetime = null; - - /** - * CertificateTemplate predefinedValues. - * @member {google.cloud.security.privateca.v1.IX509Parameters|null|undefined} predefinedValues - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @instance - */ - CertificateTemplate.prototype.predefinedValues = null; - - /** - * CertificateTemplate identityConstraints. - * @member {google.cloud.security.privateca.v1.ICertificateIdentityConstraints|null|undefined} identityConstraints - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @instance - */ - CertificateTemplate.prototype.identityConstraints = null; - - /** - * CertificateTemplate passthroughExtensions. - * @member {google.cloud.security.privateca.v1.ICertificateExtensionConstraints|null|undefined} passthroughExtensions - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @instance - */ - CertificateTemplate.prototype.passthroughExtensions = null; - - /** - * CertificateTemplate description. - * @member {string} description - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @instance - */ - CertificateTemplate.prototype.description = ""; - - /** - * CertificateTemplate createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @instance - */ - CertificateTemplate.prototype.createTime = null; - - /** - * CertificateTemplate updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @instance - */ - CertificateTemplate.prototype.updateTime = null; - - /** - * CertificateTemplate labels. - * @member {Object.} labels - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @instance - */ - CertificateTemplate.prototype.labels = $util.emptyObject; - - /** - * Creates a new CertificateTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @static - * @param {google.cloud.security.privateca.v1.ICertificateTemplate=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateTemplate} CertificateTemplate instance - */ - CertificateTemplate.create = function create(properties) { - return new CertificateTemplate(properties); - }; - - /** - * Encodes the specified CertificateTemplate message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @static - * @param {google.cloud.security.privateca.v1.ICertificateTemplate} message CertificateTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.predefinedValues != null && Object.hasOwnProperty.call(message, "predefinedValues")) - $root.google.cloud.security.privateca.v1.X509Parameters.encode(message.predefinedValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identityConstraints != null && Object.hasOwnProperty.call(message, "identityConstraints")) - $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.encode(message.identityConstraints, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.passthroughExtensions != null && Object.hasOwnProperty.call(message, "passthroughExtensions")) - $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.encode(message.passthroughExtensions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.maximumLifetime != null && Object.hasOwnProperty.call(message, "maximumLifetime")) - $root.google.protobuf.Duration.encode(message.maximumLifetime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CertificateTemplate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @static - * @param {google.cloud.security.privateca.v1.ICertificateTemplate} message CertificateTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateTemplate} CertificateTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateTemplate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateTemplate(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 9: { - message.maximumLifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.predefinedValues = $root.google.cloud.security.privateca.v1.X509Parameters.decode(reader, reader.uint32()); - break; - } - case 3: { - message.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.decode(reader, reader.uint32()); - break; - } - case 4: { - message.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.decode(reader, reader.uint32()); - break; - } - case 5: { - message.description = reader.string(); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateTemplate} CertificateTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateTemplate message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateTemplate.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.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) { - var error = $root.google.protobuf.Duration.verify(message.maximumLifetime); - if (error) - return "maximumLifetime." + error; - } - if (message.predefinedValues != null && message.hasOwnProperty("predefinedValues")) { - var error = $root.google.cloud.security.privateca.v1.X509Parameters.verify(message.predefinedValues); - if (error) - return "predefinedValues." + error; - } - if (message.identityConstraints != null && message.hasOwnProperty("identityConstraints")) { - var error = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify(message.identityConstraints); - if (error) - return "identityConstraints." + error; - } - if (message.passthroughExtensions != null && message.hasOwnProperty("passthroughExtensions")) { - var error = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify(message.passthroughExtensions); - if (error) - return "passthroughExtensions." + error; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.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 CertificateTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateTemplate} CertificateTemplate - */ - CertificateTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateTemplate) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateTemplate(); - if (object.name != null) - message.name = String(object.name); - if (object.maximumLifetime != null) { - if (typeof object.maximumLifetime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.maximumLifetime: object expected"); - message.maximumLifetime = $root.google.protobuf.Duration.fromObject(object.maximumLifetime); - } - if (object.predefinedValues != null) { - if (typeof object.predefinedValues !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.predefinedValues: object expected"); - message.predefinedValues = $root.google.cloud.security.privateca.v1.X509Parameters.fromObject(object.predefinedValues); - } - if (object.identityConstraints != null) { - if (typeof object.identityConstraints !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.identityConstraints: object expected"); - message.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.fromObject(object.identityConstraints); - } - if (object.passthroughExtensions != null) { - if (typeof object.passthroughExtensions !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.passthroughExtensions: object expected"); - message.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.fromObject(object.passthroughExtensions); - } - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateTemplate.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 CertificateTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @static - * @param {google.cloud.security.privateca.v1.CertificateTemplate} message CertificateTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.predefinedValues = null; - object.identityConstraints = null; - object.passthroughExtensions = null; - object.description = ""; - object.createTime = null; - object.updateTime = null; - object.maximumLifetime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.predefinedValues != null && message.hasOwnProperty("predefinedValues")) - object.predefinedValues = $root.google.cloud.security.privateca.v1.X509Parameters.toObject(message.predefinedValues, options); - if (message.identityConstraints != null && message.hasOwnProperty("identityConstraints")) - object.identityConstraints = $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints.toObject(message.identityConstraints, options); - if (message.passthroughExtensions != null && message.hasOwnProperty("passthroughExtensions")) - object.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.toObject(message.passthroughExtensions, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - 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.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) - object.maximumLifetime = $root.google.protobuf.Duration.toObject(message.maximumLifetime, options); - return object; - }; - - /** - * Converts this CertificateTemplate to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @instance - * @returns {Object.} JSON object - */ - CertificateTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateTemplate - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateTemplate"; - }; - - return CertificateTemplate; - })(); - - v1.X509Parameters = (function() { - - /** - * Properties of a X509Parameters. - * @memberof google.cloud.security.privateca.v1 - * @interface IX509Parameters - * @property {google.cloud.security.privateca.v1.IKeyUsage|null} [keyUsage] X509Parameters keyUsage - * @property {google.cloud.security.privateca.v1.X509Parameters.ICaOptions|null} [caOptions] X509Parameters caOptions - * @property {Array.|null} [policyIds] X509Parameters policyIds - * @property {Array.|null} [aiaOcspServers] X509Parameters aiaOcspServers - * @property {google.cloud.security.privateca.v1.X509Parameters.INameConstraints|null} [nameConstraints] X509Parameters nameConstraints - * @property {Array.|null} [additionalExtensions] X509Parameters additionalExtensions - */ - - /** - * Constructs a new X509Parameters. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a X509Parameters. - * @implements IX509Parameters - * @constructor - * @param {google.cloud.security.privateca.v1.IX509Parameters=} [properties] Properties to set - */ - function X509Parameters(properties) { - this.policyIds = []; - this.aiaOcspServers = []; - this.additionalExtensions = []; - 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]]; - } - - /** - * X509Parameters keyUsage. - * @member {google.cloud.security.privateca.v1.IKeyUsage|null|undefined} keyUsage - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @instance - */ - X509Parameters.prototype.keyUsage = null; - - /** - * X509Parameters caOptions. - * @member {google.cloud.security.privateca.v1.X509Parameters.ICaOptions|null|undefined} caOptions - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @instance - */ - X509Parameters.prototype.caOptions = null; - - /** - * X509Parameters policyIds. - * @member {Array.} policyIds - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @instance - */ - X509Parameters.prototype.policyIds = $util.emptyArray; - - /** - * X509Parameters aiaOcspServers. - * @member {Array.} aiaOcspServers - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @instance - */ - X509Parameters.prototype.aiaOcspServers = $util.emptyArray; - - /** - * X509Parameters nameConstraints. - * @member {google.cloud.security.privateca.v1.X509Parameters.INameConstraints|null|undefined} nameConstraints - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @instance - */ - X509Parameters.prototype.nameConstraints = null; - - /** - * X509Parameters additionalExtensions. - * @member {Array.} additionalExtensions - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @instance - */ - X509Parameters.prototype.additionalExtensions = $util.emptyArray; - - /** - * Creates a new X509Parameters instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @static - * @param {google.cloud.security.privateca.v1.IX509Parameters=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.X509Parameters} X509Parameters instance - */ - X509Parameters.create = function create(properties) { - return new X509Parameters(properties); - }; - - /** - * Encodes the specified X509Parameters message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @static - * @param {google.cloud.security.privateca.v1.IX509Parameters} message X509Parameters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - X509Parameters.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyUsage != null && Object.hasOwnProperty.call(message, "keyUsage")) - $root.google.cloud.security.privateca.v1.KeyUsage.encode(message.keyUsage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.caOptions != null && Object.hasOwnProperty.call(message, "caOptions")) - $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions.encode(message.caOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.policyIds != null && message.policyIds.length) - for (var i = 0; i < message.policyIds.length; ++i) - $root.google.cloud.security.privateca.v1.ObjectId.encode(message.policyIds[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.aiaOcspServers != null && message.aiaOcspServers.length) - for (var i = 0; i < message.aiaOcspServers.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.aiaOcspServers[i]); - if (message.additionalExtensions != null && message.additionalExtensions.length) - for (var i = 0; i < message.additionalExtensions.length; ++i) - $root.google.cloud.security.privateca.v1.X509Extension.encode(message.additionalExtensions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.nameConstraints != null && Object.hasOwnProperty.call(message, "nameConstraints")) - $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints.encode(message.nameConstraints, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified X509Parameters message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @static - * @param {google.cloud.security.privateca.v1.IX509Parameters} message X509Parameters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - X509Parameters.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a X509Parameters message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.X509Parameters} X509Parameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - X509Parameters.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.X509Parameters(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.keyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.decode(reader, reader.uint32()); - break; - } - case 2: { - message.caOptions = $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.policyIds && message.policyIds.length)) - message.policyIds = []; - message.policyIds.push($root.google.cloud.security.privateca.v1.ObjectId.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.aiaOcspServers && message.aiaOcspServers.length)) - message.aiaOcspServers = []; - message.aiaOcspServers.push(reader.string()); - break; - } - case 6: { - message.nameConstraints = $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.additionalExtensions && message.additionalExtensions.length)) - message.additionalExtensions = []; - message.additionalExtensions.push($root.google.cloud.security.privateca.v1.X509Extension.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a X509Parameters message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.X509Parameters} X509Parameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - X509Parameters.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a X509Parameters message. - * @function verify - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - X509Parameters.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyUsage != null && message.hasOwnProperty("keyUsage")) { - var error = $root.google.cloud.security.privateca.v1.KeyUsage.verify(message.keyUsage); - if (error) - return "keyUsage." + error; - } - if (message.caOptions != null && message.hasOwnProperty("caOptions")) { - var error = $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions.verify(message.caOptions); - if (error) - return "caOptions." + error; - } - if (message.policyIds != null && message.hasOwnProperty("policyIds")) { - if (!Array.isArray(message.policyIds)) - return "policyIds: array expected"; - for (var i = 0; i < message.policyIds.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.ObjectId.verify(message.policyIds[i]); - if (error) - return "policyIds." + error; - } - } - if (message.aiaOcspServers != null && message.hasOwnProperty("aiaOcspServers")) { - if (!Array.isArray(message.aiaOcspServers)) - return "aiaOcspServers: array expected"; - for (var i = 0; i < message.aiaOcspServers.length; ++i) - if (!$util.isString(message.aiaOcspServers[i])) - return "aiaOcspServers: string[] expected"; - } - if (message.nameConstraints != null && message.hasOwnProperty("nameConstraints")) { - var error = $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints.verify(message.nameConstraints); - if (error) - return "nameConstraints." + error; - } - if (message.additionalExtensions != null && message.hasOwnProperty("additionalExtensions")) { - if (!Array.isArray(message.additionalExtensions)) - return "additionalExtensions: array expected"; - for (var i = 0; i < message.additionalExtensions.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.X509Extension.verify(message.additionalExtensions[i]); - if (error) - return "additionalExtensions." + error; - } - } - return null; - }; - - /** - * Creates a X509Parameters message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.X509Parameters} X509Parameters - */ - X509Parameters.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.X509Parameters) - return object; - var message = new $root.google.cloud.security.privateca.v1.X509Parameters(); - if (object.keyUsage != null) { - if (typeof object.keyUsage !== "object") - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.keyUsage: object expected"); - message.keyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.fromObject(object.keyUsage); - } - if (object.caOptions != null) { - if (typeof object.caOptions !== "object") - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.caOptions: object expected"); - message.caOptions = $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions.fromObject(object.caOptions); - } - if (object.policyIds) { - if (!Array.isArray(object.policyIds)) - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.policyIds: array expected"); - message.policyIds = []; - for (var i = 0; i < object.policyIds.length; ++i) { - if (typeof object.policyIds[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.policyIds: object expected"); - message.policyIds[i] = $root.google.cloud.security.privateca.v1.ObjectId.fromObject(object.policyIds[i]); - } - } - if (object.aiaOcspServers) { - if (!Array.isArray(object.aiaOcspServers)) - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.aiaOcspServers: array expected"); - message.aiaOcspServers = []; - for (var i = 0; i < object.aiaOcspServers.length; ++i) - message.aiaOcspServers[i] = String(object.aiaOcspServers[i]); - } - if (object.nameConstraints != null) { - if (typeof object.nameConstraints !== "object") - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.nameConstraints: object expected"); - message.nameConstraints = $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints.fromObject(object.nameConstraints); - } - if (object.additionalExtensions) { - if (!Array.isArray(object.additionalExtensions)) - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.additionalExtensions: array expected"); - message.additionalExtensions = []; - for (var i = 0; i < object.additionalExtensions.length; ++i) { - if (typeof object.additionalExtensions[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.additionalExtensions: object expected"); - message.additionalExtensions[i] = $root.google.cloud.security.privateca.v1.X509Extension.fromObject(object.additionalExtensions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a X509Parameters message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @static - * @param {google.cloud.security.privateca.v1.X509Parameters} message X509Parameters - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - X509Parameters.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.policyIds = []; - object.aiaOcspServers = []; - object.additionalExtensions = []; - } - if (options.defaults) { - object.keyUsage = null; - object.caOptions = null; - object.nameConstraints = null; - } - if (message.keyUsage != null && message.hasOwnProperty("keyUsage")) - object.keyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.toObject(message.keyUsage, options); - if (message.caOptions != null && message.hasOwnProperty("caOptions")) - object.caOptions = $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions.toObject(message.caOptions, options); - if (message.policyIds && message.policyIds.length) { - object.policyIds = []; - for (var j = 0; j < message.policyIds.length; ++j) - object.policyIds[j] = $root.google.cloud.security.privateca.v1.ObjectId.toObject(message.policyIds[j], options); - } - if (message.aiaOcspServers && message.aiaOcspServers.length) { - object.aiaOcspServers = []; - for (var j = 0; j < message.aiaOcspServers.length; ++j) - object.aiaOcspServers[j] = message.aiaOcspServers[j]; - } - if (message.additionalExtensions && message.additionalExtensions.length) { - object.additionalExtensions = []; - for (var j = 0; j < message.additionalExtensions.length; ++j) - object.additionalExtensions[j] = $root.google.cloud.security.privateca.v1.X509Extension.toObject(message.additionalExtensions[j], options); - } - if (message.nameConstraints != null && message.hasOwnProperty("nameConstraints")) - object.nameConstraints = $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints.toObject(message.nameConstraints, options); - return object; - }; - - /** - * Converts this X509Parameters to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @instance - * @returns {Object.} JSON object - */ - X509Parameters.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for X509Parameters - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - X509Parameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.X509Parameters"; - }; - - X509Parameters.CaOptions = (function() { - - /** - * Properties of a CaOptions. - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @interface ICaOptions - * @property {boolean|null} [isCa] CaOptions isCa - * @property {number|null} [maxIssuerPathLength] CaOptions maxIssuerPathLength - */ - - /** - * Constructs a new CaOptions. - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @classdesc Represents a CaOptions. - * @implements ICaOptions - * @constructor - * @param {google.cloud.security.privateca.v1.X509Parameters.ICaOptions=} [properties] Properties to set - */ - function CaOptions(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]]; - } - - /** - * CaOptions isCa. - * @member {boolean|null|undefined} isCa - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @instance - */ - CaOptions.prototype.isCa = null; - - /** - * CaOptions maxIssuerPathLength. - * @member {number|null|undefined} maxIssuerPathLength - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @instance - */ - CaOptions.prototype.maxIssuerPathLength = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CaOptions.prototype, "_isCa", { - get: $util.oneOfGetter($oneOfFields = ["isCa"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CaOptions.prototype, "_maxIssuerPathLength", { - get: $util.oneOfGetter($oneOfFields = ["maxIssuerPathLength"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CaOptions instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @static - * @param {google.cloud.security.privateca.v1.X509Parameters.ICaOptions=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.X509Parameters.CaOptions} CaOptions instance - */ - CaOptions.create = function create(properties) { - return new CaOptions(properties); - }; - - /** - * Encodes the specified CaOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.CaOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @static - * @param {google.cloud.security.privateca.v1.X509Parameters.ICaOptions} message CaOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.isCa != null && Object.hasOwnProperty.call(message, "isCa")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isCa); - if (message.maxIssuerPathLength != null && Object.hasOwnProperty.call(message, "maxIssuerPathLength")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxIssuerPathLength); - return writer; - }; - - /** - * Encodes the specified CaOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.CaOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @static - * @param {google.cloud.security.privateca.v1.X509Parameters.ICaOptions} message CaOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CaOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.X509Parameters.CaOptions} CaOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.isCa = reader.bool(); - break; - } - case 2: { - message.maxIssuerPathLength = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CaOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.X509Parameters.CaOptions} CaOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CaOptions message. - * @function verify - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CaOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.isCa != null && message.hasOwnProperty("isCa")) { - properties._isCa = 1; - if (typeof message.isCa !== "boolean") - return "isCa: boolean expected"; - } - if (message.maxIssuerPathLength != null && message.hasOwnProperty("maxIssuerPathLength")) { - properties._maxIssuerPathLength = 1; - if (!$util.isInteger(message.maxIssuerPathLength)) - return "maxIssuerPathLength: integer expected"; - } - return null; - }; - - /** - * Creates a CaOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.X509Parameters.CaOptions} CaOptions - */ - CaOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions) - return object; - var message = new $root.google.cloud.security.privateca.v1.X509Parameters.CaOptions(); - if (object.isCa != null) - message.isCa = Boolean(object.isCa); - if (object.maxIssuerPathLength != null) - message.maxIssuerPathLength = object.maxIssuerPathLength | 0; - return message; - }; - - /** - * Creates a plain object from a CaOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @static - * @param {google.cloud.security.privateca.v1.X509Parameters.CaOptions} message CaOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CaOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.isCa != null && message.hasOwnProperty("isCa")) { - object.isCa = message.isCa; - if (options.oneofs) - object._isCa = "isCa"; - } - if (message.maxIssuerPathLength != null && message.hasOwnProperty("maxIssuerPathLength")) { - object.maxIssuerPathLength = message.maxIssuerPathLength; - if (options.oneofs) - object._maxIssuerPathLength = "maxIssuerPathLength"; - } - return object; - }; - - /** - * Converts this CaOptions to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @instance - * @returns {Object.} JSON object - */ - CaOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CaOptions - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.X509Parameters.CaOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CaOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.X509Parameters.CaOptions"; - }; - - return CaOptions; - })(); - - X509Parameters.NameConstraints = (function() { - - /** - * Properties of a NameConstraints. - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @interface INameConstraints - * @property {boolean|null} [critical] NameConstraints critical - * @property {Array.|null} [permittedDnsNames] NameConstraints permittedDnsNames - * @property {Array.|null} [excludedDnsNames] NameConstraints excludedDnsNames - * @property {Array.|null} [permittedIpRanges] NameConstraints permittedIpRanges - * @property {Array.|null} [excludedIpRanges] NameConstraints excludedIpRanges - * @property {Array.|null} [permittedEmailAddresses] NameConstraints permittedEmailAddresses - * @property {Array.|null} [excludedEmailAddresses] NameConstraints excludedEmailAddresses - * @property {Array.|null} [permittedUris] NameConstraints permittedUris - * @property {Array.|null} [excludedUris] NameConstraints excludedUris - */ - - /** - * Constructs a new NameConstraints. - * @memberof google.cloud.security.privateca.v1.X509Parameters - * @classdesc Represents a NameConstraints. - * @implements INameConstraints - * @constructor - * @param {google.cloud.security.privateca.v1.X509Parameters.INameConstraints=} [properties] Properties to set - */ - function NameConstraints(properties) { - this.permittedDnsNames = []; - this.excludedDnsNames = []; - this.permittedIpRanges = []; - this.excludedIpRanges = []; - this.permittedEmailAddresses = []; - this.excludedEmailAddresses = []; - this.permittedUris = []; - this.excludedUris = []; - 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]]; - } - - /** - * NameConstraints critical. - * @member {boolean} critical - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @instance - */ - NameConstraints.prototype.critical = false; - - /** - * NameConstraints permittedDnsNames. - * @member {Array.} permittedDnsNames - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @instance - */ - NameConstraints.prototype.permittedDnsNames = $util.emptyArray; - - /** - * NameConstraints excludedDnsNames. - * @member {Array.} excludedDnsNames - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @instance - */ - NameConstraints.prototype.excludedDnsNames = $util.emptyArray; - - /** - * NameConstraints permittedIpRanges. - * @member {Array.} permittedIpRanges - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @instance - */ - NameConstraints.prototype.permittedIpRanges = $util.emptyArray; - - /** - * NameConstraints excludedIpRanges. - * @member {Array.} excludedIpRanges - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @instance - */ - NameConstraints.prototype.excludedIpRanges = $util.emptyArray; - - /** - * NameConstraints permittedEmailAddresses. - * @member {Array.} permittedEmailAddresses - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @instance - */ - NameConstraints.prototype.permittedEmailAddresses = $util.emptyArray; - - /** - * NameConstraints excludedEmailAddresses. - * @member {Array.} excludedEmailAddresses - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @instance - */ - NameConstraints.prototype.excludedEmailAddresses = $util.emptyArray; - - /** - * NameConstraints permittedUris. - * @member {Array.} permittedUris - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @instance - */ - NameConstraints.prototype.permittedUris = $util.emptyArray; - - /** - * NameConstraints excludedUris. - * @member {Array.} excludedUris - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @instance - */ - NameConstraints.prototype.excludedUris = $util.emptyArray; - - /** - * Creates a new NameConstraints instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @static - * @param {google.cloud.security.privateca.v1.X509Parameters.INameConstraints=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.X509Parameters.NameConstraints} NameConstraints instance - */ - NameConstraints.create = function create(properties) { - return new NameConstraints(properties); - }; - - /** - * Encodes the specified NameConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.NameConstraints.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @static - * @param {google.cloud.security.privateca.v1.X509Parameters.INameConstraints} message NameConstraints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NameConstraints.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.critical != null && Object.hasOwnProperty.call(message, "critical")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.critical); - if (message.permittedDnsNames != null && message.permittedDnsNames.length) - for (var i = 0; i < message.permittedDnsNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.permittedDnsNames[i]); - if (message.excludedDnsNames != null && message.excludedDnsNames.length) - for (var i = 0; i < message.excludedDnsNames.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludedDnsNames[i]); - if (message.permittedIpRanges != null && message.permittedIpRanges.length) - for (var i = 0; i < message.permittedIpRanges.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.permittedIpRanges[i]); - if (message.excludedIpRanges != null && message.excludedIpRanges.length) - for (var i = 0; i < message.excludedIpRanges.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.excludedIpRanges[i]); - if (message.permittedEmailAddresses != null && message.permittedEmailAddresses.length) - for (var i = 0; i < message.permittedEmailAddresses.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.permittedEmailAddresses[i]); - if (message.excludedEmailAddresses != null && message.excludedEmailAddresses.length) - for (var i = 0; i < message.excludedEmailAddresses.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.excludedEmailAddresses[i]); - if (message.permittedUris != null && message.permittedUris.length) - for (var i = 0; i < message.permittedUris.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.permittedUris[i]); - if (message.excludedUris != null && message.excludedUris.length) - for (var i = 0; i < message.excludedUris.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.excludedUris[i]); - return writer; - }; - - /** - * Encodes the specified NameConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Parameters.NameConstraints.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @static - * @param {google.cloud.security.privateca.v1.X509Parameters.INameConstraints} message NameConstraints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NameConstraints.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NameConstraints message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.X509Parameters.NameConstraints} NameConstraints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NameConstraints.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.critical = reader.bool(); - break; - } - case 2: { - if (!(message.permittedDnsNames && message.permittedDnsNames.length)) - message.permittedDnsNames = []; - message.permittedDnsNames.push(reader.string()); - break; - } - case 3: { - if (!(message.excludedDnsNames && message.excludedDnsNames.length)) - message.excludedDnsNames = []; - message.excludedDnsNames.push(reader.string()); - break; - } - case 4: { - if (!(message.permittedIpRanges && message.permittedIpRanges.length)) - message.permittedIpRanges = []; - message.permittedIpRanges.push(reader.string()); - break; - } - case 5: { - if (!(message.excludedIpRanges && message.excludedIpRanges.length)) - message.excludedIpRanges = []; - message.excludedIpRanges.push(reader.string()); - break; - } - case 6: { - if (!(message.permittedEmailAddresses && message.permittedEmailAddresses.length)) - message.permittedEmailAddresses = []; - message.permittedEmailAddresses.push(reader.string()); - break; - } - case 7: { - if (!(message.excludedEmailAddresses && message.excludedEmailAddresses.length)) - message.excludedEmailAddresses = []; - message.excludedEmailAddresses.push(reader.string()); - break; - } - case 8: { - if (!(message.permittedUris && message.permittedUris.length)) - message.permittedUris = []; - message.permittedUris.push(reader.string()); - break; - } - case 9: { - if (!(message.excludedUris && message.excludedUris.length)) - message.excludedUris = []; - message.excludedUris.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NameConstraints message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.X509Parameters.NameConstraints} NameConstraints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NameConstraints.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NameConstraints message. - * @function verify - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NameConstraints.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.critical != null && message.hasOwnProperty("critical")) - if (typeof message.critical !== "boolean") - return "critical: boolean expected"; - if (message.permittedDnsNames != null && message.hasOwnProperty("permittedDnsNames")) { - if (!Array.isArray(message.permittedDnsNames)) - return "permittedDnsNames: array expected"; - for (var i = 0; i < message.permittedDnsNames.length; ++i) - if (!$util.isString(message.permittedDnsNames[i])) - return "permittedDnsNames: string[] expected"; - } - if (message.excludedDnsNames != null && message.hasOwnProperty("excludedDnsNames")) { - if (!Array.isArray(message.excludedDnsNames)) - return "excludedDnsNames: array expected"; - for (var i = 0; i < message.excludedDnsNames.length; ++i) - if (!$util.isString(message.excludedDnsNames[i])) - return "excludedDnsNames: string[] expected"; - } - if (message.permittedIpRanges != null && message.hasOwnProperty("permittedIpRanges")) { - if (!Array.isArray(message.permittedIpRanges)) - return "permittedIpRanges: array expected"; - for (var i = 0; i < message.permittedIpRanges.length; ++i) - if (!$util.isString(message.permittedIpRanges[i])) - return "permittedIpRanges: string[] expected"; - } - if (message.excludedIpRanges != null && message.hasOwnProperty("excludedIpRanges")) { - if (!Array.isArray(message.excludedIpRanges)) - return "excludedIpRanges: array expected"; - for (var i = 0; i < message.excludedIpRanges.length; ++i) - if (!$util.isString(message.excludedIpRanges[i])) - return "excludedIpRanges: string[] expected"; - } - if (message.permittedEmailAddresses != null && message.hasOwnProperty("permittedEmailAddresses")) { - if (!Array.isArray(message.permittedEmailAddresses)) - return "permittedEmailAddresses: array expected"; - for (var i = 0; i < message.permittedEmailAddresses.length; ++i) - if (!$util.isString(message.permittedEmailAddresses[i])) - return "permittedEmailAddresses: string[] expected"; - } - if (message.excludedEmailAddresses != null && message.hasOwnProperty("excludedEmailAddresses")) { - if (!Array.isArray(message.excludedEmailAddresses)) - return "excludedEmailAddresses: array expected"; - for (var i = 0; i < message.excludedEmailAddresses.length; ++i) - if (!$util.isString(message.excludedEmailAddresses[i])) - return "excludedEmailAddresses: string[] expected"; - } - if (message.permittedUris != null && message.hasOwnProperty("permittedUris")) { - if (!Array.isArray(message.permittedUris)) - return "permittedUris: array expected"; - for (var i = 0; i < message.permittedUris.length; ++i) - if (!$util.isString(message.permittedUris[i])) - return "permittedUris: string[] expected"; - } - if (message.excludedUris != null && message.hasOwnProperty("excludedUris")) { - if (!Array.isArray(message.excludedUris)) - return "excludedUris: array expected"; - for (var i = 0; i < message.excludedUris.length; ++i) - if (!$util.isString(message.excludedUris[i])) - return "excludedUris: string[] expected"; - } - return null; - }; - - /** - * Creates a NameConstraints message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.X509Parameters.NameConstraints} NameConstraints - */ - NameConstraints.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints) - return object; - var message = new $root.google.cloud.security.privateca.v1.X509Parameters.NameConstraints(); - if (object.critical != null) - message.critical = Boolean(object.critical); - if (object.permittedDnsNames) { - if (!Array.isArray(object.permittedDnsNames)) - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.permittedDnsNames: array expected"); - message.permittedDnsNames = []; - for (var i = 0; i < object.permittedDnsNames.length; ++i) - message.permittedDnsNames[i] = String(object.permittedDnsNames[i]); - } - if (object.excludedDnsNames) { - if (!Array.isArray(object.excludedDnsNames)) - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.excludedDnsNames: array expected"); - message.excludedDnsNames = []; - for (var i = 0; i < object.excludedDnsNames.length; ++i) - message.excludedDnsNames[i] = String(object.excludedDnsNames[i]); - } - if (object.permittedIpRanges) { - if (!Array.isArray(object.permittedIpRanges)) - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.permittedIpRanges: array expected"); - message.permittedIpRanges = []; - for (var i = 0; i < object.permittedIpRanges.length; ++i) - message.permittedIpRanges[i] = String(object.permittedIpRanges[i]); - } - if (object.excludedIpRanges) { - if (!Array.isArray(object.excludedIpRanges)) - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.excludedIpRanges: array expected"); - message.excludedIpRanges = []; - for (var i = 0; i < object.excludedIpRanges.length; ++i) - message.excludedIpRanges[i] = String(object.excludedIpRanges[i]); - } - if (object.permittedEmailAddresses) { - if (!Array.isArray(object.permittedEmailAddresses)) - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.permittedEmailAddresses: array expected"); - message.permittedEmailAddresses = []; - for (var i = 0; i < object.permittedEmailAddresses.length; ++i) - message.permittedEmailAddresses[i] = String(object.permittedEmailAddresses[i]); - } - if (object.excludedEmailAddresses) { - if (!Array.isArray(object.excludedEmailAddresses)) - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.excludedEmailAddresses: array expected"); - message.excludedEmailAddresses = []; - for (var i = 0; i < object.excludedEmailAddresses.length; ++i) - message.excludedEmailAddresses[i] = String(object.excludedEmailAddresses[i]); - } - if (object.permittedUris) { - if (!Array.isArray(object.permittedUris)) - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.permittedUris: array expected"); - message.permittedUris = []; - for (var i = 0; i < object.permittedUris.length; ++i) - message.permittedUris[i] = String(object.permittedUris[i]); - } - if (object.excludedUris) { - if (!Array.isArray(object.excludedUris)) - throw TypeError(".google.cloud.security.privateca.v1.X509Parameters.NameConstraints.excludedUris: array expected"); - message.excludedUris = []; - for (var i = 0; i < object.excludedUris.length; ++i) - message.excludedUris[i] = String(object.excludedUris[i]); - } - return message; - }; - - /** - * Creates a plain object from a NameConstraints message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @static - * @param {google.cloud.security.privateca.v1.X509Parameters.NameConstraints} message NameConstraints - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NameConstraints.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.permittedDnsNames = []; - object.excludedDnsNames = []; - object.permittedIpRanges = []; - object.excludedIpRanges = []; - object.permittedEmailAddresses = []; - object.excludedEmailAddresses = []; - object.permittedUris = []; - object.excludedUris = []; - } - if (options.defaults) - object.critical = false; - if (message.critical != null && message.hasOwnProperty("critical")) - object.critical = message.critical; - if (message.permittedDnsNames && message.permittedDnsNames.length) { - object.permittedDnsNames = []; - for (var j = 0; j < message.permittedDnsNames.length; ++j) - object.permittedDnsNames[j] = message.permittedDnsNames[j]; - } - if (message.excludedDnsNames && message.excludedDnsNames.length) { - object.excludedDnsNames = []; - for (var j = 0; j < message.excludedDnsNames.length; ++j) - object.excludedDnsNames[j] = message.excludedDnsNames[j]; - } - if (message.permittedIpRanges && message.permittedIpRanges.length) { - object.permittedIpRanges = []; - for (var j = 0; j < message.permittedIpRanges.length; ++j) - object.permittedIpRanges[j] = message.permittedIpRanges[j]; - } - if (message.excludedIpRanges && message.excludedIpRanges.length) { - object.excludedIpRanges = []; - for (var j = 0; j < message.excludedIpRanges.length; ++j) - object.excludedIpRanges[j] = message.excludedIpRanges[j]; - } - if (message.permittedEmailAddresses && message.permittedEmailAddresses.length) { - object.permittedEmailAddresses = []; - for (var j = 0; j < message.permittedEmailAddresses.length; ++j) - object.permittedEmailAddresses[j] = message.permittedEmailAddresses[j]; - } - if (message.excludedEmailAddresses && message.excludedEmailAddresses.length) { - object.excludedEmailAddresses = []; - for (var j = 0; j < message.excludedEmailAddresses.length; ++j) - object.excludedEmailAddresses[j] = message.excludedEmailAddresses[j]; - } - if (message.permittedUris && message.permittedUris.length) { - object.permittedUris = []; - for (var j = 0; j < message.permittedUris.length; ++j) - object.permittedUris[j] = message.permittedUris[j]; - } - if (message.excludedUris && message.excludedUris.length) { - object.excludedUris = []; - for (var j = 0; j < message.excludedUris.length; ++j) - object.excludedUris[j] = message.excludedUris[j]; - } - return object; - }; - - /** - * Converts this NameConstraints to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @instance - * @returns {Object.} JSON object - */ - NameConstraints.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NameConstraints - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.X509Parameters.NameConstraints - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NameConstraints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.X509Parameters.NameConstraints"; - }; - - return NameConstraints; - })(); - - return X509Parameters; - })(); - - v1.SubordinateConfig = (function() { - - /** - * Properties of a SubordinateConfig. - * @memberof google.cloud.security.privateca.v1 - * @interface ISubordinateConfig - * @property {string|null} [certificateAuthority] SubordinateConfig certificateAuthority - * @property {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain|null} [pemIssuerChain] SubordinateConfig pemIssuerChain - */ - - /** - * Constructs a new SubordinateConfig. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a SubordinateConfig. - * @implements ISubordinateConfig - * @constructor - * @param {google.cloud.security.privateca.v1.ISubordinateConfig=} [properties] Properties to set - */ - function SubordinateConfig(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]]; - } - - /** - * SubordinateConfig certificateAuthority. - * @member {string|null|undefined} certificateAuthority - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @instance - */ - SubordinateConfig.prototype.certificateAuthority = null; - - /** - * SubordinateConfig pemIssuerChain. - * @member {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain|null|undefined} pemIssuerChain - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @instance - */ - SubordinateConfig.prototype.pemIssuerChain = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SubordinateConfig subordinateConfig. - * @member {"certificateAuthority"|"pemIssuerChain"|undefined} subordinateConfig - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @instance - */ - Object.defineProperty(SubordinateConfig.prototype, "subordinateConfig", { - get: $util.oneOfGetter($oneOfFields = ["certificateAuthority", "pemIssuerChain"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SubordinateConfig instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @static - * @param {google.cloud.security.privateca.v1.ISubordinateConfig=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.SubordinateConfig} SubordinateConfig instance - */ - SubordinateConfig.create = function create(properties) { - return new SubordinateConfig(properties); - }; - - /** - * Encodes the specified SubordinateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @static - * @param {google.cloud.security.privateca.v1.ISubordinateConfig} message SubordinateConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubordinateConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificateAuthority); - if (message.pemIssuerChain != null && Object.hasOwnProperty.call(message, "pemIssuerChain")) - $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.encode(message.pemIssuerChain, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SubordinateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @static - * @param {google.cloud.security.privateca.v1.ISubordinateConfig} message SubordinateConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubordinateConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubordinateConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.SubordinateConfig} SubordinateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubordinateConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.SubordinateConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.certificateAuthority = reader.string(); - break; - } - case 2: { - message.pemIssuerChain = $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubordinateConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.SubordinateConfig} SubordinateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubordinateConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubordinateConfig message. - * @function verify - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubordinateConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { - properties.subordinateConfig = 1; - if (!$util.isString(message.certificateAuthority)) - return "certificateAuthority: string expected"; - } - if (message.pemIssuerChain != null && message.hasOwnProperty("pemIssuerChain")) { - if (properties.subordinateConfig === 1) - return "subordinateConfig: multiple values"; - properties.subordinateConfig = 1; - { - var error = $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.verify(message.pemIssuerChain); - if (error) - return "pemIssuerChain." + error; - } - } - return null; - }; - - /** - * Creates a SubordinateConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.SubordinateConfig} SubordinateConfig - */ - SubordinateConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.SubordinateConfig) - return object; - var message = new $root.google.cloud.security.privateca.v1.SubordinateConfig(); - if (object.certificateAuthority != null) - message.certificateAuthority = String(object.certificateAuthority); - if (object.pemIssuerChain != null) { - if (typeof object.pemIssuerChain !== "object") - throw TypeError(".google.cloud.security.privateca.v1.SubordinateConfig.pemIssuerChain: object expected"); - message.pemIssuerChain = $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.fromObject(object.pemIssuerChain); - } - return message; - }; - - /** - * Creates a plain object from a SubordinateConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @static - * @param {google.cloud.security.privateca.v1.SubordinateConfig} message SubordinateConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubordinateConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { - object.certificateAuthority = message.certificateAuthority; - if (options.oneofs) - object.subordinateConfig = "certificateAuthority"; - } - if (message.pemIssuerChain != null && message.hasOwnProperty("pemIssuerChain")) { - object.pemIssuerChain = $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.toObject(message.pemIssuerChain, options); - if (options.oneofs) - object.subordinateConfig = "pemIssuerChain"; - } - return object; - }; - - /** - * Converts this SubordinateConfig to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @instance - * @returns {Object.} JSON object - */ - SubordinateConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubordinateConfig - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubordinateConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.SubordinateConfig"; - }; - - SubordinateConfig.SubordinateConfigChain = (function() { - - /** - * Properties of a SubordinateConfigChain. - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @interface ISubordinateConfigChain - * @property {Array.|null} [pemCertificates] SubordinateConfigChain pemCertificates - */ - - /** - * Constructs a new SubordinateConfigChain. - * @memberof google.cloud.security.privateca.v1.SubordinateConfig - * @classdesc Represents a SubordinateConfigChain. - * @implements ISubordinateConfigChain - * @constructor - * @param {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain=} [properties] Properties to set - */ - function SubordinateConfigChain(properties) { - this.pemCertificates = []; - 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]]; - } - - /** - * SubordinateConfigChain pemCertificates. - * @member {Array.} pemCertificates - * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain - * @instance - */ - SubordinateConfigChain.prototype.pemCertificates = $util.emptyArray; - - /** - * Creates a new SubordinateConfigChain instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain instance - */ - SubordinateConfigChain.create = function create(properties) { - return new SubordinateConfigChain(properties); - }; - - /** - * Encodes the specified SubordinateConfigChain message. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain} message SubordinateConfigChain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubordinateConfigChain.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pemCertificates != null && message.pemCertificates.length) - for (var i = 0; i < message.pemCertificates.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificates[i]); - return writer; - }; - - /** - * Encodes the specified SubordinateConfigChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {google.cloud.security.privateca.v1.SubordinateConfig.ISubordinateConfigChain} message SubordinateConfigChain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubordinateConfigChain.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubordinateConfigChain message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubordinateConfigChain.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.pemCertificates && message.pemCertificates.length)) - message.pemCertificates = []; - message.pemCertificates.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubordinateConfigChain message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubordinateConfigChain.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubordinateConfigChain message. - * @function verify - * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubordinateConfigChain.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pemCertificates != null && message.hasOwnProperty("pemCertificates")) { - if (!Array.isArray(message.pemCertificates)) - return "pemCertificates: array expected"; - for (var i = 0; i < message.pemCertificates.length; ++i) - if (!$util.isString(message.pemCertificates[i])) - return "pemCertificates: string[] expected"; - } - return null; - }; - - /** - * Creates a SubordinateConfigChain message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain - */ - SubordinateConfigChain.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain) - return object; - var message = new $root.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain(); - if (object.pemCertificates) { - if (!Array.isArray(object.pemCertificates)) - throw TypeError(".google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain.pemCertificates: array expected"); - message.pemCertificates = []; - for (var i = 0; i < object.pemCertificates.length; ++i) - message.pemCertificates[i] = String(object.pemCertificates[i]); - } - return message; - }; - - /** - * Creates a plain object from a SubordinateConfigChain message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain} message SubordinateConfigChain - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubordinateConfigChain.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pemCertificates = []; - if (message.pemCertificates && message.pemCertificates.length) { - object.pemCertificates = []; - for (var j = 0; j < message.pemCertificates.length; ++j) - object.pemCertificates[j] = message.pemCertificates[j]; - } - return object; - }; - - /** - * Converts this SubordinateConfigChain to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain - * @instance - * @returns {Object.} JSON object - */ - SubordinateConfigChain.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubordinateConfigChain - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubordinateConfigChain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain"; - }; - - return SubordinateConfigChain; - })(); - - return SubordinateConfig; - })(); - - v1.PublicKey = (function() { - - /** - * Properties of a PublicKey. - * @memberof google.cloud.security.privateca.v1 - * @interface IPublicKey - * @property {Uint8Array|null} [key] PublicKey key - * @property {google.cloud.security.privateca.v1.PublicKey.KeyFormat|null} [format] PublicKey format - */ - - /** - * Constructs a new PublicKey. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a PublicKey. - * @implements IPublicKey - * @constructor - * @param {google.cloud.security.privateca.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]]; - } - - /** - * PublicKey key. - * @member {Uint8Array} key - * @memberof google.cloud.security.privateca.v1.PublicKey - * @instance - */ - PublicKey.prototype.key = $util.newBuffer([]); - - /** - * PublicKey format. - * @member {google.cloud.security.privateca.v1.PublicKey.KeyFormat} format - * @memberof google.cloud.security.privateca.v1.PublicKey - * @instance - */ - PublicKey.prototype.format = 0; - - /** - * Creates a new PublicKey instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.PublicKey - * @static - * @param {google.cloud.security.privateca.v1.IPublicKey=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.PublicKey} PublicKey instance - */ - PublicKey.create = function create(properties) { - return new PublicKey(properties); - }; - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.security.privateca.v1.PublicKey.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.PublicKey - * @static - * @param {google.cloud.security.privateca.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.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.format); - return writer; - }; - - /** - * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.PublicKey.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.PublicKey - * @static - * @param {google.cloud.security.privateca.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(); - }; - - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.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.security.privateca.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.PublicKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.key = reader.bytes(); - break; - } - case 2: { - message.format = 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.security.privateca.v1.PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.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()); - }; - - /** - * Verifies a PublicKey message. - * @function verify - * @memberof google.cloud.security.privateca.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.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.PublicKey - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.PublicKey} PublicKey - */ - PublicKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.PublicKey) - return object; - var message = new $root.google.cloud.security.privateca.v1.PublicKey(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length >= 0) - message.key = object.key; - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "KEY_FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "PEM": - case 1: - message.format = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a PublicKey message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.PublicKey - * @static - * @param {google.cloud.security.privateca.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) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - object.format = options.enums === String ? "KEY_FORMAT_UNSPECIFIED" : 0; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.cloud.security.privateca.v1.PublicKey.KeyFormat[message.format] === undefined ? message.format : $root.google.cloud.security.privateca.v1.PublicKey.KeyFormat[message.format] : message.format; - return object; - }; - - /** - * Converts this PublicKey to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.PublicKey - * @instance - * @returns {Object.} JSON object - */ - PublicKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PublicKey - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.PublicKey - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PublicKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.PublicKey"; - }; - - /** - * KeyFormat enum. - * @name google.cloud.security.privateca.v1.PublicKey.KeyFormat - * @enum {number} - * @property {number} KEY_FORMAT_UNSPECIFIED=0 KEY_FORMAT_UNSPECIFIED value - * @property {number} PEM=1 PEM value - */ - PublicKey.KeyFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KEY_FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "PEM"] = 1; - return values; - })(); - - return PublicKey; - })(); - - v1.CertificateConfig = (function() { - - /** - * Properties of a CertificateConfig. - * @memberof google.cloud.security.privateca.v1 - * @interface ICertificateConfig - * @property {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig|null} [subjectConfig] CertificateConfig subjectConfig - * @property {google.cloud.security.privateca.v1.IX509Parameters|null} [x509Config] CertificateConfig x509Config - * @property {google.cloud.security.privateca.v1.IPublicKey|null} [publicKey] CertificateConfig publicKey - * @property {google.cloud.security.privateca.v1.CertificateConfig.IKeyId|null} [subjectKeyId] CertificateConfig subjectKeyId - */ - - /** - * Constructs a new CertificateConfig. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CertificateConfig. - * @implements ICertificateConfig - * @constructor - * @param {google.cloud.security.privateca.v1.ICertificateConfig=} [properties] Properties to set - */ - function CertificateConfig(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]]; - } - - /** - * CertificateConfig subjectConfig. - * @member {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig|null|undefined} subjectConfig - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @instance - */ - CertificateConfig.prototype.subjectConfig = null; - - /** - * CertificateConfig x509Config. - * @member {google.cloud.security.privateca.v1.IX509Parameters|null|undefined} x509Config - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @instance - */ - CertificateConfig.prototype.x509Config = null; - - /** - * CertificateConfig publicKey. - * @member {google.cloud.security.privateca.v1.IPublicKey|null|undefined} publicKey - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @instance - */ - CertificateConfig.prototype.publicKey = null; - - /** - * CertificateConfig subjectKeyId. - * @member {google.cloud.security.privateca.v1.CertificateConfig.IKeyId|null|undefined} subjectKeyId - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @instance - */ - CertificateConfig.prototype.subjectKeyId = null; - - /** - * Creates a new CertificateConfig instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @static - * @param {google.cloud.security.privateca.v1.ICertificateConfig=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateConfig} CertificateConfig instance - */ - CertificateConfig.create = function create(properties) { - return new CertificateConfig(properties); - }; - - /** - * Encodes the specified CertificateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @static - * @param {google.cloud.security.privateca.v1.ICertificateConfig} message CertificateConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subjectConfig != null && Object.hasOwnProperty.call(message, "subjectConfig")) - $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.encode(message.subjectConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.x509Config != null && Object.hasOwnProperty.call(message, "x509Config")) - $root.google.cloud.security.privateca.v1.X509Parameters.encode(message.x509Config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) - $root.google.cloud.security.privateca.v1.PublicKey.encode(message.publicKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.subjectKeyId != null && Object.hasOwnProperty.call(message, "subjectKeyId")) - $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId.encode(message.subjectKeyId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CertificateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @static - * @param {google.cloud.security.privateca.v1.ICertificateConfig} message CertificateConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateConfig} CertificateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.subjectConfig = $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.x509Config = $root.google.cloud.security.privateca.v1.X509Parameters.decode(reader, reader.uint32()); - break; - } - case 3: { - message.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.decode(reader, reader.uint32()); - break; - } - case 4: { - message.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateConfig} CertificateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateConfig message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subjectConfig != null && message.hasOwnProperty("subjectConfig")) { - var error = $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.verify(message.subjectConfig); - if (error) - return "subjectConfig." + error; - } - if (message.x509Config != null && message.hasOwnProperty("x509Config")) { - var error = $root.google.cloud.security.privateca.v1.X509Parameters.verify(message.x509Config); - if (error) - return "x509Config." + error; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) { - var error = $root.google.cloud.security.privateca.v1.PublicKey.verify(message.publicKey); - if (error) - return "publicKey." + error; - } - if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) { - var error = $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId.verify(message.subjectKeyId); - if (error) - return "subjectKeyId." + error; - } - return null; - }; - - /** - * Creates a CertificateConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateConfig} CertificateConfig - */ - CertificateConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateConfig) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateConfig(); - if (object.subjectConfig != null) { - if (typeof object.subjectConfig !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.subjectConfig: object expected"); - message.subjectConfig = $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.fromObject(object.subjectConfig); - } - if (object.x509Config != null) { - if (typeof object.x509Config !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.x509Config: object expected"); - message.x509Config = $root.google.cloud.security.privateca.v1.X509Parameters.fromObject(object.x509Config); - } - if (object.publicKey != null) { - if (typeof object.publicKey !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.publicKey: object expected"); - message.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.fromObject(object.publicKey); - } - if (object.subjectKeyId != null) { - if (typeof object.subjectKeyId !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.subjectKeyId: object expected"); - message.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId.fromObject(object.subjectKeyId); - } - return message; - }; - - /** - * Creates a plain object from a CertificateConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @static - * @param {google.cloud.security.privateca.v1.CertificateConfig} message CertificateConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subjectConfig = null; - object.x509Config = null; - object.publicKey = null; - object.subjectKeyId = null; - } - if (message.subjectConfig != null && message.hasOwnProperty("subjectConfig")) - object.subjectConfig = $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.toObject(message.subjectConfig, options); - if (message.x509Config != null && message.hasOwnProperty("x509Config")) - object.x509Config = $root.google.cloud.security.privateca.v1.X509Parameters.toObject(message.x509Config, options); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.toObject(message.publicKey, options); - if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) - object.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId.toObject(message.subjectKeyId, options); - return object; - }; - - /** - * Converts this CertificateConfig to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @instance - * @returns {Object.} JSON object - */ - CertificateConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateConfig - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateConfig"; - }; - - CertificateConfig.SubjectConfig = (function() { - - /** - * Properties of a SubjectConfig. - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @interface ISubjectConfig - * @property {google.cloud.security.privateca.v1.ISubject|null} [subject] SubjectConfig subject - * @property {google.cloud.security.privateca.v1.ISubjectAltNames|null} [subjectAltName] SubjectConfig subjectAltName - */ - - /** - * Constructs a new SubjectConfig. - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @classdesc Represents a SubjectConfig. - * @implements ISubjectConfig - * @constructor - * @param {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig=} [properties] Properties to set - */ - function SubjectConfig(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]]; - } - - /** - * SubjectConfig subject. - * @member {google.cloud.security.privateca.v1.ISubject|null|undefined} subject - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @instance - */ - SubjectConfig.prototype.subject = null; - - /** - * SubjectConfig subjectAltName. - * @member {google.cloud.security.privateca.v1.ISubjectAltNames|null|undefined} subjectAltName - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @instance - */ - SubjectConfig.prototype.subjectAltName = null; - - /** - * Creates a new SubjectConfig instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @static - * @param {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig} SubjectConfig instance - */ - SubjectConfig.create = function create(properties) { - return new SubjectConfig(properties); - }; - - /** - * Encodes the specified SubjectConfig message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @static - * @param {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig} message SubjectConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) - $root.google.cloud.security.privateca.v1.Subject.encode(message.subject, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.subjectAltName != null && Object.hasOwnProperty.call(message, "subjectAltName")) - $root.google.cloud.security.privateca.v1.SubjectAltNames.encode(message.subjectAltName, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SubjectConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @static - * @param {google.cloud.security.privateca.v1.CertificateConfig.ISubjectConfig} message SubjectConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubjectConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig} SubjectConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.subject = $root.google.cloud.security.privateca.v1.Subject.decode(reader, reader.uint32()); - break; - } - case 2: { - message.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubjectConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig} SubjectConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubjectConfig message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubjectConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subject != null && message.hasOwnProperty("subject")) { - var error = $root.google.cloud.security.privateca.v1.Subject.verify(message.subject); - if (error) - return "subject." + error; - } - if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) { - var error = $root.google.cloud.security.privateca.v1.SubjectAltNames.verify(message.subjectAltName); - if (error) - return "subjectAltName." + error; - } - return null; - }; - - /** - * Creates a SubjectConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig} SubjectConfig - */ - SubjectConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig(); - if (object.subject != null) { - if (typeof object.subject !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.subject: object expected"); - message.subject = $root.google.cloud.security.privateca.v1.Subject.fromObject(object.subject); - } - if (object.subjectAltName != null) { - if (typeof object.subjectAltName !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig.subjectAltName: object expected"); - message.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.fromObject(object.subjectAltName); - } - return message; - }; - - /** - * Creates a plain object from a SubjectConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @static - * @param {google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig} message SubjectConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubjectConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subject = null; - object.subjectAltName = null; - } - if (message.subject != null && message.hasOwnProperty("subject")) - object.subject = $root.google.cloud.security.privateca.v1.Subject.toObject(message.subject, options); - if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) - object.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.toObject(message.subjectAltName, options); - return object; - }; - - /** - * Converts this SubjectConfig to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @instance - * @returns {Object.} JSON object - */ - SubjectConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubjectConfig - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubjectConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig"; - }; - - return SubjectConfig; - })(); - - CertificateConfig.KeyId = (function() { - - /** - * Properties of a KeyId. - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @interface IKeyId - * @property {string|null} [keyId] KeyId keyId - */ - - /** - * Constructs a new KeyId. - * @memberof google.cloud.security.privateca.v1.CertificateConfig - * @classdesc Represents a KeyId. - * @implements IKeyId - * @constructor - * @param {google.cloud.security.privateca.v1.CertificateConfig.IKeyId=} [properties] Properties to set - */ - function KeyId(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]]; - } - - /** - * KeyId keyId. - * @member {string} keyId - * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId - * @instance - */ - KeyId.prototype.keyId = ""; - - /** - * Creates a new KeyId instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId - * @static - * @param {google.cloud.security.privateca.v1.CertificateConfig.IKeyId=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateConfig.KeyId} KeyId instance - */ - KeyId.create = function create(properties) { - return new KeyId(properties); - }; - - /** - * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.KeyId.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId - * @static - * @param {google.cloud.security.privateca.v1.CertificateConfig.IKeyId} message KeyId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyId); - return writer; - }; - - /** - * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateConfig.KeyId.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId - * @static - * @param {google.cloud.security.privateca.v1.CertificateConfig.IKeyId} message KeyId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyId message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateConfig.KeyId} KeyId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyId.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.keyId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateConfig.KeyId} KeyId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyId message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyId != null && message.hasOwnProperty("keyId")) - if (!$util.isString(message.keyId)) - return "keyId: string expected"; - return null; - }; - - /** - * Creates a KeyId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateConfig.KeyId} KeyId - */ - KeyId.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateConfig.KeyId(); - if (object.keyId != null) - message.keyId = String(object.keyId); - return message; - }; - - /** - * Creates a plain object from a KeyId message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId - * @static - * @param {google.cloud.security.privateca.v1.CertificateConfig.KeyId} message KeyId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyId.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.keyId = ""; - if (message.keyId != null && message.hasOwnProperty("keyId")) - object.keyId = message.keyId; - return object; - }; - - /** - * Converts this KeyId to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId - * @instance - * @returns {Object.} JSON object - */ - KeyId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyId - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateConfig.KeyId - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateConfig.KeyId"; - }; - - return KeyId; - })(); - - return CertificateConfig; - })(); - - v1.CertificateDescription = (function() { - - /** - * Properties of a CertificateDescription. - * @memberof google.cloud.security.privateca.v1 - * @interface ICertificateDescription - * @property {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription|null} [subjectDescription] CertificateDescription subjectDescription - * @property {google.cloud.security.privateca.v1.IX509Parameters|null} [x509Description] CertificateDescription x509Description - * @property {google.cloud.security.privateca.v1.IPublicKey|null} [publicKey] CertificateDescription publicKey - * @property {google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null} [subjectKeyId] CertificateDescription subjectKeyId - * @property {google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null} [authorityKeyId] CertificateDescription authorityKeyId - * @property {Array.|null} [crlDistributionPoints] CertificateDescription crlDistributionPoints - * @property {Array.|null} [aiaIssuingCertificateUrls] CertificateDescription aiaIssuingCertificateUrls - * @property {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint|null} [certFingerprint] CertificateDescription certFingerprint - * @property {string|null} [tbsCertificateDigest] CertificateDescription tbsCertificateDigest - */ - - /** - * Constructs a new CertificateDescription. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CertificateDescription. - * @implements ICertificateDescription - * @constructor - * @param {google.cloud.security.privateca.v1.ICertificateDescription=} [properties] Properties to set - */ - function CertificateDescription(properties) { - this.crlDistributionPoints = []; - this.aiaIssuingCertificateUrls = []; - 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]]; - } - - /** - * CertificateDescription subjectDescription. - * @member {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription|null|undefined} subjectDescription - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.subjectDescription = null; - - /** - * CertificateDescription x509Description. - * @member {google.cloud.security.privateca.v1.IX509Parameters|null|undefined} x509Description - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.x509Description = null; - - /** - * CertificateDescription publicKey. - * @member {google.cloud.security.privateca.v1.IPublicKey|null|undefined} publicKey - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.publicKey = null; - - /** - * CertificateDescription subjectKeyId. - * @member {google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null|undefined} subjectKeyId - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.subjectKeyId = null; - - /** - * CertificateDescription authorityKeyId. - * @member {google.cloud.security.privateca.v1.CertificateDescription.IKeyId|null|undefined} authorityKeyId - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.authorityKeyId = null; - - /** - * CertificateDescription crlDistributionPoints. - * @member {Array.} crlDistributionPoints - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.crlDistributionPoints = $util.emptyArray; - - /** - * CertificateDescription aiaIssuingCertificateUrls. - * @member {Array.} aiaIssuingCertificateUrls - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.aiaIssuingCertificateUrls = $util.emptyArray; - - /** - * CertificateDescription certFingerprint. - * @member {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint|null|undefined} certFingerprint - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.certFingerprint = null; - - /** - * CertificateDescription tbsCertificateDigest. - * @member {string} tbsCertificateDigest - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.tbsCertificateDigest = ""; - - /** - * Creates a new CertificateDescription instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @static - * @param {google.cloud.security.privateca.v1.ICertificateDescription=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateDescription} CertificateDescription instance - */ - CertificateDescription.create = function create(properties) { - return new CertificateDescription(properties); - }; - - /** - * Encodes the specified CertificateDescription message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @static - * @param {google.cloud.security.privateca.v1.ICertificateDescription} message CertificateDescription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateDescription.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subjectDescription != null && Object.hasOwnProperty.call(message, "subjectDescription")) - $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.encode(message.subjectDescription, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.x509Description != null && Object.hasOwnProperty.call(message, "x509Description")) - $root.google.cloud.security.privateca.v1.X509Parameters.encode(message.x509Description, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) - $root.google.cloud.security.privateca.v1.PublicKey.encode(message.publicKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.subjectKeyId != null && Object.hasOwnProperty.call(message, "subjectKeyId")) - $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.encode(message.subjectKeyId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.authorityKeyId != null && Object.hasOwnProperty.call(message, "authorityKeyId")) - $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.encode(message.authorityKeyId, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.crlDistributionPoints != null && message.crlDistributionPoints.length) - for (var i = 0; i < message.crlDistributionPoints.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.crlDistributionPoints[i]); - if (message.aiaIssuingCertificateUrls != null && message.aiaIssuingCertificateUrls.length) - for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.aiaIssuingCertificateUrls[i]); - if (message.certFingerprint != null && Object.hasOwnProperty.call(message, "certFingerprint")) - $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.encode(message.certFingerprint, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.tbsCertificateDigest != null && Object.hasOwnProperty.call(message, "tbsCertificateDigest")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.tbsCertificateDigest); - return writer; - }; - - /** - * Encodes the specified CertificateDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @static - * @param {google.cloud.security.privateca.v1.ICertificateDescription} message CertificateDescription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateDescription.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateDescription message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateDescription} CertificateDescription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateDescription.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateDescription(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.subjectDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.decode(reader, reader.uint32()); - break; - } - case 2: { - message.x509Description = $root.google.cloud.security.privateca.v1.X509Parameters.decode(reader, reader.uint32()); - break; - } - case 3: { - message.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.decode(reader, reader.uint32()); - break; - } - case 4: { - message.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.decode(reader, reader.uint32()); - break; - } - case 5: { - message.authorityKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.crlDistributionPoints && message.crlDistributionPoints.length)) - message.crlDistributionPoints = []; - message.crlDistributionPoints.push(reader.string()); - break; - } - case 7: { - if (!(message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length)) - message.aiaIssuingCertificateUrls = []; - message.aiaIssuingCertificateUrls.push(reader.string()); - break; - } - case 8: { - message.certFingerprint = $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.decode(reader, reader.uint32()); - break; - } - case 9: { - message.tbsCertificateDigest = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateDescription message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateDescription} CertificateDescription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateDescription.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateDescription message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateDescription.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subjectDescription != null && message.hasOwnProperty("subjectDescription")) { - var error = $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.verify(message.subjectDescription); - if (error) - return "subjectDescription." + error; - } - if (message.x509Description != null && message.hasOwnProperty("x509Description")) { - var error = $root.google.cloud.security.privateca.v1.X509Parameters.verify(message.x509Description); - if (error) - return "x509Description." + error; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) { - var error = $root.google.cloud.security.privateca.v1.PublicKey.verify(message.publicKey); - if (error) - return "publicKey." + error; - } - if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) { - var error = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify(message.subjectKeyId); - if (error) - return "subjectKeyId." + error; - } - if (message.authorityKeyId != null && message.hasOwnProperty("authorityKeyId")) { - var error = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify(message.authorityKeyId); - if (error) - return "authorityKeyId." + error; - } - if (message.crlDistributionPoints != null && message.hasOwnProperty("crlDistributionPoints")) { - if (!Array.isArray(message.crlDistributionPoints)) - return "crlDistributionPoints: array expected"; - for (var i = 0; i < message.crlDistributionPoints.length; ++i) - if (!$util.isString(message.crlDistributionPoints[i])) - return "crlDistributionPoints: string[] expected"; - } - if (message.aiaIssuingCertificateUrls != null && message.hasOwnProperty("aiaIssuingCertificateUrls")) { - if (!Array.isArray(message.aiaIssuingCertificateUrls)) - return "aiaIssuingCertificateUrls: array expected"; - for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) - if (!$util.isString(message.aiaIssuingCertificateUrls[i])) - return "aiaIssuingCertificateUrls: string[] expected"; - } - if (message.certFingerprint != null && message.hasOwnProperty("certFingerprint")) { - var error = $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.verify(message.certFingerprint); - if (error) - return "certFingerprint." + error; - } - if (message.tbsCertificateDigest != null && message.hasOwnProperty("tbsCertificateDigest")) - if (!$util.isString(message.tbsCertificateDigest)) - return "tbsCertificateDigest: string expected"; - return null; - }; - - /** - * Creates a CertificateDescription message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateDescription} CertificateDescription - */ - CertificateDescription.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateDescription) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateDescription(); - if (object.subjectDescription != null) { - if (typeof object.subjectDescription !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.subjectDescription: object expected"); - message.subjectDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.fromObject(object.subjectDescription); - } - if (object.x509Description != null) { - if (typeof object.x509Description !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.x509Description: object expected"); - message.x509Description = $root.google.cloud.security.privateca.v1.X509Parameters.fromObject(object.x509Description); - } - if (object.publicKey != null) { - if (typeof object.publicKey !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.publicKey: object expected"); - message.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.fromObject(object.publicKey); - } - if (object.subjectKeyId != null) { - if (typeof object.subjectKeyId !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.subjectKeyId: object expected"); - message.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.fromObject(object.subjectKeyId); - } - if (object.authorityKeyId != null) { - if (typeof object.authorityKeyId !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.authorityKeyId: object expected"); - message.authorityKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.fromObject(object.authorityKeyId); - } - if (object.crlDistributionPoints) { - if (!Array.isArray(object.crlDistributionPoints)) - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.crlDistributionPoints: array expected"); - message.crlDistributionPoints = []; - for (var i = 0; i < object.crlDistributionPoints.length; ++i) - message.crlDistributionPoints[i] = String(object.crlDistributionPoints[i]); - } - if (object.aiaIssuingCertificateUrls) { - if (!Array.isArray(object.aiaIssuingCertificateUrls)) - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.aiaIssuingCertificateUrls: array expected"); - message.aiaIssuingCertificateUrls = []; - for (var i = 0; i < object.aiaIssuingCertificateUrls.length; ++i) - message.aiaIssuingCertificateUrls[i] = String(object.aiaIssuingCertificateUrls[i]); - } - if (object.certFingerprint != null) { - if (typeof object.certFingerprint !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.certFingerprint: object expected"); - message.certFingerprint = $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.fromObject(object.certFingerprint); - } - if (object.tbsCertificateDigest != null) - message.tbsCertificateDigest = String(object.tbsCertificateDigest); - return message; - }; - - /** - * Creates a plain object from a CertificateDescription message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription} message CertificateDescription - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateDescription.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.crlDistributionPoints = []; - object.aiaIssuingCertificateUrls = []; - } - if (options.defaults) { - object.subjectDescription = null; - object.x509Description = null; - object.publicKey = null; - object.subjectKeyId = null; - object.authorityKeyId = null; - object.certFingerprint = null; - object.tbsCertificateDigest = ""; - } - if (message.subjectDescription != null && message.hasOwnProperty("subjectDescription")) - object.subjectDescription = $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.toObject(message.subjectDescription, options); - if (message.x509Description != null && message.hasOwnProperty("x509Description")) - object.x509Description = $root.google.cloud.security.privateca.v1.X509Parameters.toObject(message.x509Description, options); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = $root.google.cloud.security.privateca.v1.PublicKey.toObject(message.publicKey, options); - if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) - object.subjectKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.toObject(message.subjectKeyId, options); - if (message.authorityKeyId != null && message.hasOwnProperty("authorityKeyId")) - object.authorityKeyId = $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId.toObject(message.authorityKeyId, options); - if (message.crlDistributionPoints && message.crlDistributionPoints.length) { - object.crlDistributionPoints = []; - for (var j = 0; j < message.crlDistributionPoints.length; ++j) - object.crlDistributionPoints[j] = message.crlDistributionPoints[j]; - } - if (message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length) { - object.aiaIssuingCertificateUrls = []; - for (var j = 0; j < message.aiaIssuingCertificateUrls.length; ++j) - object.aiaIssuingCertificateUrls[j] = message.aiaIssuingCertificateUrls[j]; - } - if (message.certFingerprint != null && message.hasOwnProperty("certFingerprint")) - object.certFingerprint = $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.toObject(message.certFingerprint, options); - if (message.tbsCertificateDigest != null && message.hasOwnProperty("tbsCertificateDigest")) - object.tbsCertificateDigest = message.tbsCertificateDigest; - return object; - }; - - /** - * Converts this CertificateDescription to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @instance - * @returns {Object.} JSON object - */ - CertificateDescription.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateDescription - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateDescription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateDescription"; - }; - - CertificateDescription.SubjectDescription = (function() { - - /** - * Properties of a SubjectDescription. - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @interface ISubjectDescription - * @property {google.cloud.security.privateca.v1.ISubject|null} [subject] SubjectDescription subject - * @property {google.cloud.security.privateca.v1.ISubjectAltNames|null} [subjectAltName] SubjectDescription subjectAltName - * @property {string|null} [hexSerialNumber] SubjectDescription hexSerialNumber - * @property {google.protobuf.IDuration|null} [lifetime] SubjectDescription lifetime - * @property {google.protobuf.ITimestamp|null} [notBeforeTime] SubjectDescription notBeforeTime - * @property {google.protobuf.ITimestamp|null} [notAfterTime] SubjectDescription notAfterTime - */ - - /** - * Constructs a new SubjectDescription. - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @classdesc Represents a SubjectDescription. - * @implements ISubjectDescription - * @constructor - * @param {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription=} [properties] Properties to set - */ - function SubjectDescription(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]]; - } - - /** - * SubjectDescription subject. - * @member {google.cloud.security.privateca.v1.ISubject|null|undefined} subject - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.subject = null; - - /** - * SubjectDescription subjectAltName. - * @member {google.cloud.security.privateca.v1.ISubjectAltNames|null|undefined} subjectAltName - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.subjectAltName = null; - - /** - * SubjectDescription hexSerialNumber. - * @member {string} hexSerialNumber - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.hexSerialNumber = ""; - - /** - * SubjectDescription lifetime. - * @member {google.protobuf.IDuration|null|undefined} lifetime - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.lifetime = null; - - /** - * SubjectDescription notBeforeTime. - * @member {google.protobuf.ITimestamp|null|undefined} notBeforeTime - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.notBeforeTime = null; - - /** - * SubjectDescription notAfterTime. - * @member {google.protobuf.ITimestamp|null|undefined} notAfterTime - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.notAfterTime = null; - - /** - * Creates a new SubjectDescription instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription} SubjectDescription instance - */ - SubjectDescription.create = function create(properties) { - return new SubjectDescription(properties); - }; - - /** - * Encodes the specified SubjectDescription message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription} message SubjectDescription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectDescription.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) - $root.google.cloud.security.privateca.v1.Subject.encode(message.subject, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.subjectAltName != null && Object.hasOwnProperty.call(message, "subjectAltName")) - $root.google.cloud.security.privateca.v1.SubjectAltNames.encode(message.subjectAltName, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.hexSerialNumber != null && Object.hasOwnProperty.call(message, "hexSerialNumber")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.hexSerialNumber); - if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) - $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.notBeforeTime != null && Object.hasOwnProperty.call(message, "notBeforeTime")) - $root.google.protobuf.Timestamp.encode(message.notBeforeTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.notAfterTime != null && Object.hasOwnProperty.call(message, "notAfterTime")) - $root.google.protobuf.Timestamp.encode(message.notAfterTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SubjectDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.ISubjectDescription} message SubjectDescription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectDescription.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubjectDescription message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription} SubjectDescription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectDescription.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.subject = $root.google.cloud.security.privateca.v1.Subject.decode(reader, reader.uint32()); - break; - } - case 2: { - message.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.decode(reader, reader.uint32()); - break; - } - case 3: { - message.hexSerialNumber = reader.string(); - break; - } - case 4: { - message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.notBeforeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.notAfterTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubjectDescription message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription} SubjectDescription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectDescription.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubjectDescription message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubjectDescription.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subject != null && message.hasOwnProperty("subject")) { - var error = $root.google.cloud.security.privateca.v1.Subject.verify(message.subject); - if (error) - return "subject." + error; - } - if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) { - var error = $root.google.cloud.security.privateca.v1.SubjectAltNames.verify(message.subjectAltName); - if (error) - return "subjectAltName." + error; - } - if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) - if (!$util.isString(message.hexSerialNumber)) - return "hexSerialNumber: string expected"; - if (message.lifetime != null && message.hasOwnProperty("lifetime")) { - var error = $root.google.protobuf.Duration.verify(message.lifetime); - if (error) - return "lifetime." + error; - } - if (message.notBeforeTime != null && message.hasOwnProperty("notBeforeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.notBeforeTime); - if (error) - return "notBeforeTime." + error; - } - if (message.notAfterTime != null && message.hasOwnProperty("notAfterTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.notAfterTime); - if (error) - return "notAfterTime." + error; - } - return null; - }; - - /** - * Creates a SubjectDescription message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription} SubjectDescription - */ - SubjectDescription.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription(); - if (object.subject != null) { - if (typeof object.subject !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.subject: object expected"); - message.subject = $root.google.cloud.security.privateca.v1.Subject.fromObject(object.subject); - } - if (object.subjectAltName != null) { - if (typeof object.subjectAltName !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.subjectAltName: object expected"); - message.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.fromObject(object.subjectAltName); - } - if (object.hexSerialNumber != null) - message.hexSerialNumber = String(object.hexSerialNumber); - if (object.lifetime != null) { - if (typeof object.lifetime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.lifetime: object expected"); - message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); - } - if (object.notBeforeTime != null) { - if (typeof object.notBeforeTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.notBeforeTime: object expected"); - message.notBeforeTime = $root.google.protobuf.Timestamp.fromObject(object.notBeforeTime); - } - if (object.notAfterTime != null) { - if (typeof object.notAfterTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.notAfterTime: object expected"); - message.notAfterTime = $root.google.protobuf.Timestamp.fromObject(object.notAfterTime); - } - return message; - }; - - /** - * Creates a plain object from a SubjectDescription message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription} message SubjectDescription - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubjectDescription.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subject = null; - object.subjectAltName = null; - object.hexSerialNumber = ""; - object.lifetime = null; - object.notBeforeTime = null; - object.notAfterTime = null; - } - if (message.subject != null && message.hasOwnProperty("subject")) - object.subject = $root.google.cloud.security.privateca.v1.Subject.toObject(message.subject, options); - if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) - object.subjectAltName = $root.google.cloud.security.privateca.v1.SubjectAltNames.toObject(message.subjectAltName, options); - if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) - object.hexSerialNumber = message.hexSerialNumber; - if (message.lifetime != null && message.hasOwnProperty("lifetime")) - object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); - if (message.notBeforeTime != null && message.hasOwnProperty("notBeforeTime")) - object.notBeforeTime = $root.google.protobuf.Timestamp.toObject(message.notBeforeTime, options); - if (message.notAfterTime != null && message.hasOwnProperty("notAfterTime")) - object.notAfterTime = $root.google.protobuf.Timestamp.toObject(message.notAfterTime, options); - return object; - }; - - /** - * Converts this SubjectDescription to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @instance - * @returns {Object.} JSON object - */ - SubjectDescription.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubjectDescription - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubjectDescription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription"; - }; - - return SubjectDescription; - })(); - - CertificateDescription.KeyId = (function() { - - /** - * Properties of a KeyId. - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @interface IKeyId - * @property {string|null} [keyId] KeyId keyId - */ - - /** - * Constructs a new KeyId. - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @classdesc Represents a KeyId. - * @implements IKeyId - * @constructor - * @param {google.cloud.security.privateca.v1.CertificateDescription.IKeyId=} [properties] Properties to set - */ - function KeyId(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]]; - } - - /** - * KeyId keyId. - * @member {string} keyId - * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId - * @instance - */ - KeyId.prototype.keyId = ""; - - /** - * Creates a new KeyId instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.IKeyId=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateDescription.KeyId} KeyId instance - */ - KeyId.create = function create(properties) { - return new KeyId(properties); - }; - - /** - * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.IKeyId} message KeyId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyId); - return writer; - }; - - /** - * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.KeyId.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.IKeyId} message KeyId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyId message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateDescription.KeyId} KeyId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyId.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.keyId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateDescription.KeyId} KeyId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyId message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyId != null && message.hasOwnProperty("keyId")) - if (!$util.isString(message.keyId)) - return "keyId: string expected"; - return null; - }; - - /** - * Creates a KeyId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateDescription.KeyId} KeyId - */ - KeyId.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateDescription.KeyId(); - if (object.keyId != null) - message.keyId = String(object.keyId); - return message; - }; - - /** - * Creates a plain object from a KeyId message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.KeyId} message KeyId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyId.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.keyId = ""; - if (message.keyId != null && message.hasOwnProperty("keyId")) - object.keyId = message.keyId; - return object; - }; - - /** - * Converts this KeyId to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId - * @instance - * @returns {Object.} JSON object - */ - KeyId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyId - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateDescription.KeyId - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateDescription.KeyId"; - }; - - return KeyId; - })(); - - CertificateDescription.CertificateFingerprint = (function() { - - /** - * Properties of a CertificateFingerprint. - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @interface ICertificateFingerprint - * @property {string|null} [sha256Hash] CertificateFingerprint sha256Hash - */ - - /** - * Constructs a new CertificateFingerprint. - * @memberof google.cloud.security.privateca.v1.CertificateDescription - * @classdesc Represents a CertificateFingerprint. - * @implements ICertificateFingerprint - * @constructor - * @param {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint=} [properties] Properties to set - */ - function CertificateFingerprint(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]]; - } - - /** - * CertificateFingerprint sha256Hash. - * @member {string} sha256Hash - * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint - * @instance - */ - CertificateFingerprint.prototype.sha256Hash = ""; - - /** - * Creates a new CertificateFingerprint instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint} CertificateFingerprint instance - */ - CertificateFingerprint.create = function create(properties) { - return new CertificateFingerprint(properties); - }; - - /** - * Encodes the specified CertificateFingerprint message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint} message CertificateFingerprint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateFingerprint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sha256Hash != null && Object.hasOwnProperty.call(message, "sha256Hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sha256Hash); - return writer; - }; - - /** - * Encodes the specified CertificateFingerprint message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.ICertificateFingerprint} message CertificateFingerprint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateFingerprint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateFingerprint message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint} CertificateFingerprint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateFingerprint.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sha256Hash = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateFingerprint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint} CertificateFingerprint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateFingerprint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateFingerprint message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateFingerprint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash")) - if (!$util.isString(message.sha256Hash)) - return "sha256Hash: string expected"; - return null; - }; - - /** - * Creates a CertificateFingerprint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint} CertificateFingerprint - */ - CertificateFingerprint.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint(); - if (object.sha256Hash != null) - message.sha256Hash = String(object.sha256Hash); - return message; - }; - - /** - * Creates a plain object from a CertificateFingerprint message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint - * @static - * @param {google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint} message CertificateFingerprint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateFingerprint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.sha256Hash = ""; - if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash")) - object.sha256Hash = message.sha256Hash; - return object; - }; - - /** - * Converts this CertificateFingerprint to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint - * @instance - * @returns {Object.} JSON object - */ - CertificateFingerprint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateFingerprint - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateFingerprint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint"; - }; - - return CertificateFingerprint; - })(); - - return CertificateDescription; - })(); - - v1.ObjectId = (function() { - - /** - * Properties of an ObjectId. - * @memberof google.cloud.security.privateca.v1 - * @interface IObjectId - * @property {Array.|null} [objectIdPath] ObjectId objectIdPath - */ - - /** - * Constructs a new ObjectId. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an ObjectId. - * @implements IObjectId - * @constructor - * @param {google.cloud.security.privateca.v1.IObjectId=} [properties] Properties to set - */ - function ObjectId(properties) { - this.objectIdPath = []; - 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]]; - } - - /** - * ObjectId objectIdPath. - * @member {Array.} objectIdPath - * @memberof google.cloud.security.privateca.v1.ObjectId - * @instance - */ - ObjectId.prototype.objectIdPath = $util.emptyArray; - - /** - * Creates a new ObjectId instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ObjectId - * @static - * @param {google.cloud.security.privateca.v1.IObjectId=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ObjectId} ObjectId instance - */ - ObjectId.create = function create(properties) { - return new ObjectId(properties); - }; - - /** - * Encodes the specified ObjectId message. Does not implicitly {@link google.cloud.security.privateca.v1.ObjectId.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ObjectId - * @static - * @param {google.cloud.security.privateca.v1.IObjectId} message ObjectId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObjectId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.objectIdPath != null && message.objectIdPath.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.objectIdPath.length; ++i) - writer.int32(message.objectIdPath[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ObjectId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ObjectId.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ObjectId - * @static - * @param {google.cloud.security.privateca.v1.IObjectId} message ObjectId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObjectId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ObjectId message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ObjectId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ObjectId} ObjectId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObjectId.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ObjectId(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.objectIdPath && message.objectIdPath.length)) - message.objectIdPath = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.objectIdPath.push(reader.int32()); - } else - message.objectIdPath.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ObjectId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ObjectId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ObjectId} ObjectId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObjectId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ObjectId message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ObjectId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ObjectId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.objectIdPath != null && message.hasOwnProperty("objectIdPath")) { - if (!Array.isArray(message.objectIdPath)) - return "objectIdPath: array expected"; - for (var i = 0; i < message.objectIdPath.length; ++i) - if (!$util.isInteger(message.objectIdPath[i])) - return "objectIdPath: integer[] expected"; - } - return null; - }; - - /** - * Creates an ObjectId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ObjectId - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ObjectId} ObjectId - */ - ObjectId.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ObjectId) - return object; - var message = new $root.google.cloud.security.privateca.v1.ObjectId(); - if (object.objectIdPath) { - if (!Array.isArray(object.objectIdPath)) - throw TypeError(".google.cloud.security.privateca.v1.ObjectId.objectIdPath: array expected"); - message.objectIdPath = []; - for (var i = 0; i < object.objectIdPath.length; ++i) - message.objectIdPath[i] = object.objectIdPath[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from an ObjectId message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ObjectId - * @static - * @param {google.cloud.security.privateca.v1.ObjectId} message ObjectId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ObjectId.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.objectIdPath = []; - if (message.objectIdPath && message.objectIdPath.length) { - object.objectIdPath = []; - for (var j = 0; j < message.objectIdPath.length; ++j) - object.objectIdPath[j] = message.objectIdPath[j]; - } - return object; - }; - - /** - * Converts this ObjectId to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ObjectId - * @instance - * @returns {Object.} JSON object - */ - ObjectId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ObjectId - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ObjectId - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ObjectId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ObjectId"; - }; - - return ObjectId; - })(); - - v1.X509Extension = (function() { - - /** - * Properties of a X509Extension. - * @memberof google.cloud.security.privateca.v1 - * @interface IX509Extension - * @property {google.cloud.security.privateca.v1.IObjectId|null} [objectId] X509Extension objectId - * @property {boolean|null} [critical] X509Extension critical - * @property {Uint8Array|null} [value] X509Extension value - */ - - /** - * Constructs a new X509Extension. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a X509Extension. - * @implements IX509Extension - * @constructor - * @param {google.cloud.security.privateca.v1.IX509Extension=} [properties] Properties to set - */ - function X509Extension(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]]; - } - - /** - * X509Extension objectId. - * @member {google.cloud.security.privateca.v1.IObjectId|null|undefined} objectId - * @memberof google.cloud.security.privateca.v1.X509Extension - * @instance - */ - X509Extension.prototype.objectId = null; - - /** - * X509Extension critical. - * @member {boolean} critical - * @memberof google.cloud.security.privateca.v1.X509Extension - * @instance - */ - X509Extension.prototype.critical = false; - - /** - * X509Extension value. - * @member {Uint8Array} value - * @memberof google.cloud.security.privateca.v1.X509Extension - * @instance - */ - X509Extension.prototype.value = $util.newBuffer([]); - - /** - * Creates a new X509Extension instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.X509Extension - * @static - * @param {google.cloud.security.privateca.v1.IX509Extension=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.X509Extension} X509Extension instance - */ - X509Extension.create = function create(properties) { - return new X509Extension(properties); - }; - - /** - * Encodes the specified X509Extension message. Does not implicitly {@link google.cloud.security.privateca.v1.X509Extension.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.X509Extension - * @static - * @param {google.cloud.security.privateca.v1.IX509Extension} message X509Extension message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - X509Extension.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.objectId != null && Object.hasOwnProperty.call(message, "objectId")) - $root.google.cloud.security.privateca.v1.ObjectId.encode(message.objectId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.critical != null && Object.hasOwnProperty.call(message, "critical")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.critical); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified X509Extension message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.X509Extension.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.X509Extension - * @static - * @param {google.cloud.security.privateca.v1.IX509Extension} message X509Extension message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - X509Extension.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a X509Extension message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.X509Extension - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.X509Extension} X509Extension - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - X509Extension.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.X509Extension(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.objectId = $root.google.cloud.security.privateca.v1.ObjectId.decode(reader, reader.uint32()); - break; - } - case 2: { - message.critical = reader.bool(); - break; - } - case 3: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a X509Extension message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.X509Extension - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.X509Extension} X509Extension - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - X509Extension.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a X509Extension message. - * @function verify - * @memberof google.cloud.security.privateca.v1.X509Extension - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - X509Extension.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.objectId != null && message.hasOwnProperty("objectId")) { - var error = $root.google.cloud.security.privateca.v1.ObjectId.verify(message.objectId); - if (error) - return "objectId." + error; - } - if (message.critical != null && message.hasOwnProperty("critical")) - if (typeof message.critical !== "boolean") - return "critical: boolean expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a X509Extension message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.X509Extension - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.X509Extension} X509Extension - */ - X509Extension.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.X509Extension) - return object; - var message = new $root.google.cloud.security.privateca.v1.X509Extension(); - if (object.objectId != null) { - if (typeof object.objectId !== "object") - throw TypeError(".google.cloud.security.privateca.v1.X509Extension.objectId: object expected"); - message.objectId = $root.google.cloud.security.privateca.v1.ObjectId.fromObject(object.objectId); - } - if (object.critical != null) - message.critical = Boolean(object.critical); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a X509Extension message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.X509Extension - * @static - * @param {google.cloud.security.privateca.v1.X509Extension} message X509Extension - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - X509Extension.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.objectId = null; - object.critical = false; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.objectId != null && message.hasOwnProperty("objectId")) - object.objectId = $root.google.cloud.security.privateca.v1.ObjectId.toObject(message.objectId, options); - if (message.critical != null && message.hasOwnProperty("critical")) - object.critical = message.critical; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this X509Extension to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.X509Extension - * @instance - * @returns {Object.} JSON object - */ - X509Extension.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for X509Extension - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.X509Extension - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - X509Extension.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.X509Extension"; - }; - - return X509Extension; - })(); - - v1.KeyUsage = (function() { - - /** - * Properties of a KeyUsage. - * @memberof google.cloud.security.privateca.v1 - * @interface IKeyUsage - * @property {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions|null} [baseKeyUsage] KeyUsage baseKeyUsage - * @property {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions|null} [extendedKeyUsage] KeyUsage extendedKeyUsage - * @property {Array.|null} [unknownExtendedKeyUsages] KeyUsage unknownExtendedKeyUsages - */ - - /** - * Constructs a new KeyUsage. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a KeyUsage. - * @implements IKeyUsage - * @constructor - * @param {google.cloud.security.privateca.v1.IKeyUsage=} [properties] Properties to set - */ - function KeyUsage(properties) { - this.unknownExtendedKeyUsages = []; - 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]]; - } - - /** - * KeyUsage baseKeyUsage. - * @member {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions|null|undefined} baseKeyUsage - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @instance - */ - KeyUsage.prototype.baseKeyUsage = null; - - /** - * KeyUsage extendedKeyUsage. - * @member {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions|null|undefined} extendedKeyUsage - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @instance - */ - KeyUsage.prototype.extendedKeyUsage = null; - - /** - * KeyUsage unknownExtendedKeyUsages. - * @member {Array.} unknownExtendedKeyUsages - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @instance - */ - KeyUsage.prototype.unknownExtendedKeyUsages = $util.emptyArray; - - /** - * Creates a new KeyUsage instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @static - * @param {google.cloud.security.privateca.v1.IKeyUsage=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.KeyUsage} KeyUsage instance - */ - KeyUsage.create = function create(properties) { - return new KeyUsage(properties); - }; - - /** - * Encodes the specified KeyUsage message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @static - * @param {google.cloud.security.privateca.v1.IKeyUsage} message KeyUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyUsage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.baseKeyUsage != null && Object.hasOwnProperty.call(message, "baseKeyUsage")) - $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.encode(message.baseKeyUsage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.extendedKeyUsage != null && Object.hasOwnProperty.call(message, "extendedKeyUsage")) - $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.encode(message.extendedKeyUsage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.unknownExtendedKeyUsages != null && message.unknownExtendedKeyUsages.length) - for (var i = 0; i < message.unknownExtendedKeyUsages.length; ++i) - $root.google.cloud.security.privateca.v1.ObjectId.encode(message.unknownExtendedKeyUsages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified KeyUsage message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @static - * @param {google.cloud.security.privateca.v1.IKeyUsage} message KeyUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyUsage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyUsage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.KeyUsage} KeyUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyUsage.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.KeyUsage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.baseKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.decode(reader, reader.uint32()); - break; - } - case 2: { - message.extendedKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.unknownExtendedKeyUsages && message.unknownExtendedKeyUsages.length)) - message.unknownExtendedKeyUsages = []; - message.unknownExtendedKeyUsages.push($root.google.cloud.security.privateca.v1.ObjectId.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyUsage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.KeyUsage} KeyUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyUsage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyUsage message. - * @function verify - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyUsage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.baseKeyUsage != null && message.hasOwnProperty("baseKeyUsage")) { - var error = $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.verify(message.baseKeyUsage); - if (error) - return "baseKeyUsage." + error; - } - if (message.extendedKeyUsage != null && message.hasOwnProperty("extendedKeyUsage")) { - var error = $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.verify(message.extendedKeyUsage); - if (error) - return "extendedKeyUsage." + error; - } - if (message.unknownExtendedKeyUsages != null && message.hasOwnProperty("unknownExtendedKeyUsages")) { - if (!Array.isArray(message.unknownExtendedKeyUsages)) - return "unknownExtendedKeyUsages: array expected"; - for (var i = 0; i < message.unknownExtendedKeyUsages.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.ObjectId.verify(message.unknownExtendedKeyUsages[i]); - if (error) - return "unknownExtendedKeyUsages." + error; - } - } - return null; - }; - - /** - * Creates a KeyUsage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.KeyUsage} KeyUsage - */ - KeyUsage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.KeyUsage) - return object; - var message = new $root.google.cloud.security.privateca.v1.KeyUsage(); - if (object.baseKeyUsage != null) { - if (typeof object.baseKeyUsage !== "object") - throw TypeError(".google.cloud.security.privateca.v1.KeyUsage.baseKeyUsage: object expected"); - message.baseKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.fromObject(object.baseKeyUsage); - } - if (object.extendedKeyUsage != null) { - if (typeof object.extendedKeyUsage !== "object") - throw TypeError(".google.cloud.security.privateca.v1.KeyUsage.extendedKeyUsage: object expected"); - message.extendedKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.fromObject(object.extendedKeyUsage); - } - if (object.unknownExtendedKeyUsages) { - if (!Array.isArray(object.unknownExtendedKeyUsages)) - throw TypeError(".google.cloud.security.privateca.v1.KeyUsage.unknownExtendedKeyUsages: array expected"); - message.unknownExtendedKeyUsages = []; - for (var i = 0; i < object.unknownExtendedKeyUsages.length; ++i) { - if (typeof object.unknownExtendedKeyUsages[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.KeyUsage.unknownExtendedKeyUsages: object expected"); - message.unknownExtendedKeyUsages[i] = $root.google.cloud.security.privateca.v1.ObjectId.fromObject(object.unknownExtendedKeyUsages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a KeyUsage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @static - * @param {google.cloud.security.privateca.v1.KeyUsage} message KeyUsage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyUsage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.unknownExtendedKeyUsages = []; - if (options.defaults) { - object.baseKeyUsage = null; - object.extendedKeyUsage = null; - } - if (message.baseKeyUsage != null && message.hasOwnProperty("baseKeyUsage")) - object.baseKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.toObject(message.baseKeyUsage, options); - if (message.extendedKeyUsage != null && message.hasOwnProperty("extendedKeyUsage")) - object.extendedKeyUsage = $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.toObject(message.extendedKeyUsage, options); - if (message.unknownExtendedKeyUsages && message.unknownExtendedKeyUsages.length) { - object.unknownExtendedKeyUsages = []; - for (var j = 0; j < message.unknownExtendedKeyUsages.length; ++j) - object.unknownExtendedKeyUsages[j] = $root.google.cloud.security.privateca.v1.ObjectId.toObject(message.unknownExtendedKeyUsages[j], options); - } - return object; - }; - - /** - * Converts this KeyUsage to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @instance - * @returns {Object.} JSON object - */ - KeyUsage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyUsage - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.KeyUsage"; - }; - - KeyUsage.KeyUsageOptions = (function() { - - /** - * Properties of a KeyUsageOptions. - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @interface IKeyUsageOptions - * @property {boolean|null} [digitalSignature] KeyUsageOptions digitalSignature - * @property {boolean|null} [contentCommitment] KeyUsageOptions contentCommitment - * @property {boolean|null} [keyEncipherment] KeyUsageOptions keyEncipherment - * @property {boolean|null} [dataEncipherment] KeyUsageOptions dataEncipherment - * @property {boolean|null} [keyAgreement] KeyUsageOptions keyAgreement - * @property {boolean|null} [certSign] KeyUsageOptions certSign - * @property {boolean|null} [crlSign] KeyUsageOptions crlSign - * @property {boolean|null} [encipherOnly] KeyUsageOptions encipherOnly - * @property {boolean|null} [decipherOnly] KeyUsageOptions decipherOnly - */ - - /** - * Constructs a new KeyUsageOptions. - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @classdesc Represents a KeyUsageOptions. - * @implements IKeyUsageOptions - * @constructor - * @param {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions=} [properties] Properties to set - */ - function KeyUsageOptions(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]]; - } - - /** - * KeyUsageOptions digitalSignature. - * @member {boolean} digitalSignature - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.digitalSignature = false; - - /** - * KeyUsageOptions contentCommitment. - * @member {boolean} contentCommitment - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.contentCommitment = false; - - /** - * KeyUsageOptions keyEncipherment. - * @member {boolean} keyEncipherment - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.keyEncipherment = false; - - /** - * KeyUsageOptions dataEncipherment. - * @member {boolean} dataEncipherment - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.dataEncipherment = false; - - /** - * KeyUsageOptions keyAgreement. - * @member {boolean} keyAgreement - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.keyAgreement = false; - - /** - * KeyUsageOptions certSign. - * @member {boolean} certSign - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.certSign = false; - - /** - * KeyUsageOptions crlSign. - * @member {boolean} crlSign - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.crlSign = false; - - /** - * KeyUsageOptions encipherOnly. - * @member {boolean} encipherOnly - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.encipherOnly = false; - - /** - * KeyUsageOptions decipherOnly. - * @member {boolean} decipherOnly - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.decipherOnly = false; - - /** - * Creates a new KeyUsageOptions instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions} KeyUsageOptions instance - */ - KeyUsageOptions.create = function create(properties) { - return new KeyUsageOptions(properties); - }; - - /** - * Encodes the specified KeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions} message KeyUsageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyUsageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.digitalSignature != null && Object.hasOwnProperty.call(message, "digitalSignature")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.digitalSignature); - if (message.contentCommitment != null && Object.hasOwnProperty.call(message, "contentCommitment")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.contentCommitment); - if (message.keyEncipherment != null && Object.hasOwnProperty.call(message, "keyEncipherment")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.keyEncipherment); - if (message.dataEncipherment != null && Object.hasOwnProperty.call(message, "dataEncipherment")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.dataEncipherment); - if (message.keyAgreement != null && Object.hasOwnProperty.call(message, "keyAgreement")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.keyAgreement); - if (message.certSign != null && Object.hasOwnProperty.call(message, "certSign")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.certSign); - if (message.crlSign != null && Object.hasOwnProperty.call(message, "crlSign")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.crlSign); - if (message.encipherOnly != null && Object.hasOwnProperty.call(message, "encipherOnly")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.encipherOnly); - if (message.decipherOnly != null && Object.hasOwnProperty.call(message, "decipherOnly")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.decipherOnly); - return writer; - }; - - /** - * Encodes the specified KeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1.KeyUsage.IKeyUsageOptions} message KeyUsageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyUsageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyUsageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions} KeyUsageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyUsageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.digitalSignature = reader.bool(); - break; - } - case 2: { - message.contentCommitment = reader.bool(); - break; - } - case 3: { - message.keyEncipherment = reader.bool(); - break; - } - case 4: { - message.dataEncipherment = reader.bool(); - break; - } - case 5: { - message.keyAgreement = reader.bool(); - break; - } - case 6: { - message.certSign = reader.bool(); - break; - } - case 7: { - message.crlSign = reader.bool(); - break; - } - case 8: { - message.encipherOnly = reader.bool(); - break; - } - case 9: { - message.decipherOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyUsageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions} KeyUsageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyUsageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyUsageOptions message. - * @function verify - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyUsageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.digitalSignature != null && message.hasOwnProperty("digitalSignature")) - if (typeof message.digitalSignature !== "boolean") - return "digitalSignature: boolean expected"; - if (message.contentCommitment != null && message.hasOwnProperty("contentCommitment")) - if (typeof message.contentCommitment !== "boolean") - return "contentCommitment: boolean expected"; - if (message.keyEncipherment != null && message.hasOwnProperty("keyEncipherment")) - if (typeof message.keyEncipherment !== "boolean") - return "keyEncipherment: boolean expected"; - if (message.dataEncipherment != null && message.hasOwnProperty("dataEncipherment")) - if (typeof message.dataEncipherment !== "boolean") - return "dataEncipherment: boolean expected"; - if (message.keyAgreement != null && message.hasOwnProperty("keyAgreement")) - if (typeof message.keyAgreement !== "boolean") - return "keyAgreement: boolean expected"; - if (message.certSign != null && message.hasOwnProperty("certSign")) - if (typeof message.certSign !== "boolean") - return "certSign: boolean expected"; - if (message.crlSign != null && message.hasOwnProperty("crlSign")) - if (typeof message.crlSign !== "boolean") - return "crlSign: boolean expected"; - if (message.encipherOnly != null && message.hasOwnProperty("encipherOnly")) - if (typeof message.encipherOnly !== "boolean") - return "encipherOnly: boolean expected"; - if (message.decipherOnly != null && message.hasOwnProperty("decipherOnly")) - if (typeof message.decipherOnly !== "boolean") - return "decipherOnly: boolean expected"; - return null; - }; - - /** - * Creates a KeyUsageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions} KeyUsageOptions - */ - KeyUsageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions) - return object; - var message = new $root.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions(); - if (object.digitalSignature != null) - message.digitalSignature = Boolean(object.digitalSignature); - if (object.contentCommitment != null) - message.contentCommitment = Boolean(object.contentCommitment); - if (object.keyEncipherment != null) - message.keyEncipherment = Boolean(object.keyEncipherment); - if (object.dataEncipherment != null) - message.dataEncipherment = Boolean(object.dataEncipherment); - if (object.keyAgreement != null) - message.keyAgreement = Boolean(object.keyAgreement); - if (object.certSign != null) - message.certSign = Boolean(object.certSign); - if (object.crlSign != null) - message.crlSign = Boolean(object.crlSign); - if (object.encipherOnly != null) - message.encipherOnly = Boolean(object.encipherOnly); - if (object.decipherOnly != null) - message.decipherOnly = Boolean(object.decipherOnly); - return message; - }; - - /** - * Creates a plain object from a KeyUsageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions} message KeyUsageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyUsageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.digitalSignature = false; - object.contentCommitment = false; - object.keyEncipherment = false; - object.dataEncipherment = false; - object.keyAgreement = false; - object.certSign = false; - object.crlSign = false; - object.encipherOnly = false; - object.decipherOnly = false; - } - if (message.digitalSignature != null && message.hasOwnProperty("digitalSignature")) - object.digitalSignature = message.digitalSignature; - if (message.contentCommitment != null && message.hasOwnProperty("contentCommitment")) - object.contentCommitment = message.contentCommitment; - if (message.keyEncipherment != null && message.hasOwnProperty("keyEncipherment")) - object.keyEncipherment = message.keyEncipherment; - if (message.dataEncipherment != null && message.hasOwnProperty("dataEncipherment")) - object.dataEncipherment = message.dataEncipherment; - if (message.keyAgreement != null && message.hasOwnProperty("keyAgreement")) - object.keyAgreement = message.keyAgreement; - if (message.certSign != null && message.hasOwnProperty("certSign")) - object.certSign = message.certSign; - if (message.crlSign != null && message.hasOwnProperty("crlSign")) - object.crlSign = message.crlSign; - if (message.encipherOnly != null && message.hasOwnProperty("encipherOnly")) - object.encipherOnly = message.encipherOnly; - if (message.decipherOnly != null && message.hasOwnProperty("decipherOnly")) - object.decipherOnly = message.decipherOnly; - return object; - }; - - /** - * Converts this KeyUsageOptions to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @instance - * @returns {Object.} JSON object - */ - KeyUsageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyUsageOptions - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyUsageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions"; - }; - - return KeyUsageOptions; - })(); - - KeyUsage.ExtendedKeyUsageOptions = (function() { - - /** - * Properties of an ExtendedKeyUsageOptions. - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @interface IExtendedKeyUsageOptions - * @property {boolean|null} [serverAuth] ExtendedKeyUsageOptions serverAuth - * @property {boolean|null} [clientAuth] ExtendedKeyUsageOptions clientAuth - * @property {boolean|null} [codeSigning] ExtendedKeyUsageOptions codeSigning - * @property {boolean|null} [emailProtection] ExtendedKeyUsageOptions emailProtection - * @property {boolean|null} [timeStamping] ExtendedKeyUsageOptions timeStamping - * @property {boolean|null} [ocspSigning] ExtendedKeyUsageOptions ocspSigning - */ - - /** - * Constructs a new ExtendedKeyUsageOptions. - * @memberof google.cloud.security.privateca.v1.KeyUsage - * @classdesc Represents an ExtendedKeyUsageOptions. - * @implements IExtendedKeyUsageOptions - * @constructor - * @param {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions=} [properties] Properties to set - */ - function ExtendedKeyUsageOptions(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]]; - } - - /** - * ExtendedKeyUsageOptions serverAuth. - * @member {boolean} serverAuth - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.serverAuth = false; - - /** - * ExtendedKeyUsageOptions clientAuth. - * @member {boolean} clientAuth - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.clientAuth = false; - - /** - * ExtendedKeyUsageOptions codeSigning. - * @member {boolean} codeSigning - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.codeSigning = false; - - /** - * ExtendedKeyUsageOptions emailProtection. - * @member {boolean} emailProtection - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.emailProtection = false; - - /** - * ExtendedKeyUsageOptions timeStamping. - * @member {boolean} timeStamping - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.timeStamping = false; - - /** - * ExtendedKeyUsageOptions ocspSigning. - * @member {boolean} ocspSigning - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.ocspSigning = false; - - /** - * Creates a new ExtendedKeyUsageOptions instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions instance - */ - ExtendedKeyUsageOptions.create = function create(properties) { - return new ExtendedKeyUsageOptions(properties); - }; - - /** - * Encodes the specified ExtendedKeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions} message ExtendedKeyUsageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtendedKeyUsageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serverAuth != null && Object.hasOwnProperty.call(message, "serverAuth")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.serverAuth); - if (message.clientAuth != null && Object.hasOwnProperty.call(message, "clientAuth")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.clientAuth); - if (message.codeSigning != null && Object.hasOwnProperty.call(message, "codeSigning")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.codeSigning); - if (message.emailProtection != null && Object.hasOwnProperty.call(message, "emailProtection")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.emailProtection); - if (message.timeStamping != null && Object.hasOwnProperty.call(message, "timeStamping")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.timeStamping); - if (message.ocspSigning != null && Object.hasOwnProperty.call(message, "ocspSigning")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.ocspSigning); - return writer; - }; - - /** - * Encodes the specified ExtendedKeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1.KeyUsage.IExtendedKeyUsageOptions} message ExtendedKeyUsageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtendedKeyUsageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtendedKeyUsageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.serverAuth = reader.bool(); - break; - } - case 2: { - message.clientAuth = reader.bool(); - break; - } - case 3: { - message.codeSigning = reader.bool(); - break; - } - case 4: { - message.emailProtection = reader.bool(); - break; - } - case 5: { - message.timeStamping = reader.bool(); - break; - } - case 6: { - message.ocspSigning = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtendedKeyUsageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtendedKeyUsageOptions message. - * @function verify - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtendedKeyUsageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serverAuth != null && message.hasOwnProperty("serverAuth")) - if (typeof message.serverAuth !== "boolean") - return "serverAuth: boolean expected"; - if (message.clientAuth != null && message.hasOwnProperty("clientAuth")) - if (typeof message.clientAuth !== "boolean") - return "clientAuth: boolean expected"; - if (message.codeSigning != null && message.hasOwnProperty("codeSigning")) - if (typeof message.codeSigning !== "boolean") - return "codeSigning: boolean expected"; - if (message.emailProtection != null && message.hasOwnProperty("emailProtection")) - if (typeof message.emailProtection !== "boolean") - return "emailProtection: boolean expected"; - if (message.timeStamping != null && message.hasOwnProperty("timeStamping")) - if (typeof message.timeStamping !== "boolean") - return "timeStamping: boolean expected"; - if (message.ocspSigning != null && message.hasOwnProperty("ocspSigning")) - if (typeof message.ocspSigning !== "boolean") - return "ocspSigning: boolean expected"; - return null; - }; - - /** - * Creates an ExtendedKeyUsageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions - */ - ExtendedKeyUsageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions) - return object; - var message = new $root.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions(); - if (object.serverAuth != null) - message.serverAuth = Boolean(object.serverAuth); - if (object.clientAuth != null) - message.clientAuth = Boolean(object.clientAuth); - if (object.codeSigning != null) - message.codeSigning = Boolean(object.codeSigning); - if (object.emailProtection != null) - message.emailProtection = Boolean(object.emailProtection); - if (object.timeStamping != null) - message.timeStamping = Boolean(object.timeStamping); - if (object.ocspSigning != null) - message.ocspSigning = Boolean(object.ocspSigning); - return message; - }; - - /** - * Creates a plain object from an ExtendedKeyUsageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions} message ExtendedKeyUsageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtendedKeyUsageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serverAuth = false; - object.clientAuth = false; - object.codeSigning = false; - object.emailProtection = false; - object.timeStamping = false; - object.ocspSigning = false; - } - if (message.serverAuth != null && message.hasOwnProperty("serverAuth")) - object.serverAuth = message.serverAuth; - if (message.clientAuth != null && message.hasOwnProperty("clientAuth")) - object.clientAuth = message.clientAuth; - if (message.codeSigning != null && message.hasOwnProperty("codeSigning")) - object.codeSigning = message.codeSigning; - if (message.emailProtection != null && message.hasOwnProperty("emailProtection")) - object.emailProtection = message.emailProtection; - if (message.timeStamping != null && message.hasOwnProperty("timeStamping")) - object.timeStamping = message.timeStamping; - if (message.ocspSigning != null && message.hasOwnProperty("ocspSigning")) - object.ocspSigning = message.ocspSigning; - return object; - }; - - /** - * Converts this ExtendedKeyUsageOptions to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @instance - * @returns {Object.} JSON object - */ - ExtendedKeyUsageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtendedKeyUsageOptions - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtendedKeyUsageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions"; - }; - - return ExtendedKeyUsageOptions; - })(); - - return KeyUsage; - })(); - - v1.AttributeTypeAndValue = (function() { - - /** - * Properties of an AttributeTypeAndValue. - * @memberof google.cloud.security.privateca.v1 - * @interface IAttributeTypeAndValue - * @property {google.cloud.security.privateca.v1.AttributeType|null} [type] AttributeTypeAndValue type - * @property {google.cloud.security.privateca.v1.IObjectId|null} [objectId] AttributeTypeAndValue objectId - * @property {string|null} [value] AttributeTypeAndValue value - */ - - /** - * Constructs a new AttributeTypeAndValue. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an AttributeTypeAndValue. - * @implements IAttributeTypeAndValue - * @constructor - * @param {google.cloud.security.privateca.v1.IAttributeTypeAndValue=} [properties] Properties to set - */ - function AttributeTypeAndValue(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]]; - } - - /** - * AttributeTypeAndValue type. - * @member {google.cloud.security.privateca.v1.AttributeType|null|undefined} type - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @instance - */ - AttributeTypeAndValue.prototype.type = null; - - /** - * AttributeTypeAndValue objectId. - * @member {google.cloud.security.privateca.v1.IObjectId|null|undefined} objectId - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @instance - */ - AttributeTypeAndValue.prototype.objectId = null; - - /** - * AttributeTypeAndValue value. - * @member {string} value - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @instance - */ - AttributeTypeAndValue.prototype.value = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AttributeTypeAndValue attributeType. - * @member {"type"|"objectId"|undefined} attributeType - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @instance - */ - Object.defineProperty(AttributeTypeAndValue.prototype, "attributeType", { - get: $util.oneOfGetter($oneOfFields = ["type", "objectId"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AttributeTypeAndValue instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @static - * @param {google.cloud.security.privateca.v1.IAttributeTypeAndValue=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.AttributeTypeAndValue} AttributeTypeAndValue instance - */ - AttributeTypeAndValue.create = function create(properties) { - return new AttributeTypeAndValue(properties); - }; - - /** - * Encodes the specified AttributeTypeAndValue message. Does not implicitly {@link google.cloud.security.privateca.v1.AttributeTypeAndValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @static - * @param {google.cloud.security.privateca.v1.IAttributeTypeAndValue} message AttributeTypeAndValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttributeTypeAndValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.objectId != null && Object.hasOwnProperty.call(message, "objectId")) - $root.google.cloud.security.privateca.v1.ObjectId.encode(message.objectId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.value); - return writer; - }; - - /** - * Encodes the specified AttributeTypeAndValue message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.AttributeTypeAndValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @static - * @param {google.cloud.security.privateca.v1.IAttributeTypeAndValue} message AttributeTypeAndValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttributeTypeAndValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttributeTypeAndValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.AttributeTypeAndValue} AttributeTypeAndValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttributeTypeAndValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.AttributeTypeAndValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.objectId = $root.google.cloud.security.privateca.v1.ObjectId.decode(reader, reader.uint32()); - break; - } - case 3: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttributeTypeAndValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.AttributeTypeAndValue} AttributeTypeAndValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttributeTypeAndValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttributeTypeAndValue message. - * @function verify - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttributeTypeAndValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.type != null && message.hasOwnProperty("type")) { - properties.attributeType = 1; - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message.objectId != null && message.hasOwnProperty("objectId")) { - if (properties.attributeType === 1) - return "attributeType: multiple values"; - properties.attributeType = 1; - { - var error = $root.google.cloud.security.privateca.v1.ObjectId.verify(message.objectId); - if (error) - return "objectId." + error; - } - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an AttributeTypeAndValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.AttributeTypeAndValue} AttributeTypeAndValue - */ - AttributeTypeAndValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.AttributeTypeAndValue) - return object; - var message = new $root.google.cloud.security.privateca.v1.AttributeTypeAndValue(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "ATTRIBUTE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "COMMON_NAME": - case 1: - message.type = 1; - break; - case "COUNTRY_CODE": - case 2: - message.type = 2; - break; - case "ORGANIZATION": - case 3: - message.type = 3; - break; - case "ORGANIZATIONAL_UNIT": - case 4: - message.type = 4; - break; - case "LOCALITY": - case 5: - message.type = 5; - break; - case "PROVINCE": - case 6: - message.type = 6; - break; - case "STREET_ADDRESS": - case 7: - message.type = 7; - break; - case "POSTAL_CODE": - case 8: - message.type = 8; - break; - } - if (object.objectId != null) { - if (typeof object.objectId !== "object") - throw TypeError(".google.cloud.security.privateca.v1.AttributeTypeAndValue.objectId: object expected"); - message.objectId = $root.google.cloud.security.privateca.v1.ObjectId.fromObject(object.objectId); - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an AttributeTypeAndValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @static - * @param {google.cloud.security.privateca.v1.AttributeTypeAndValue} message AttributeTypeAndValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttributeTypeAndValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.type != null && message.hasOwnProperty("type")) { - object.type = options.enums === String ? $root.google.cloud.security.privateca.v1.AttributeType[message.type] === undefined ? message.type : $root.google.cloud.security.privateca.v1.AttributeType[message.type] : message.type; - if (options.oneofs) - object.attributeType = "type"; - } - if (message.objectId != null && message.hasOwnProperty("objectId")) { - object.objectId = $root.google.cloud.security.privateca.v1.ObjectId.toObject(message.objectId, options); - if (options.oneofs) - object.attributeType = "objectId"; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this AttributeTypeAndValue to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @instance - * @returns {Object.} JSON object - */ - AttributeTypeAndValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttributeTypeAndValue - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.AttributeTypeAndValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttributeTypeAndValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.AttributeTypeAndValue"; - }; - - return AttributeTypeAndValue; - })(); - - v1.RelativeDistinguishedName = (function() { - - /** - * Properties of a RelativeDistinguishedName. - * @memberof google.cloud.security.privateca.v1 - * @interface IRelativeDistinguishedName - * @property {Array.|null} [attributes] RelativeDistinguishedName attributes - */ - - /** - * Constructs a new RelativeDistinguishedName. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a RelativeDistinguishedName. - * @implements IRelativeDistinguishedName - * @constructor - * @param {google.cloud.security.privateca.v1.IRelativeDistinguishedName=} [properties] Properties to set - */ - function RelativeDistinguishedName(properties) { - this.attributes = []; - 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]]; - } - - /** - * RelativeDistinguishedName attributes. - * @member {Array.} attributes - * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName - * @instance - */ - RelativeDistinguishedName.prototype.attributes = $util.emptyArray; - - /** - * Creates a new RelativeDistinguishedName instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName - * @static - * @param {google.cloud.security.privateca.v1.IRelativeDistinguishedName=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.RelativeDistinguishedName} RelativeDistinguishedName instance - */ - RelativeDistinguishedName.create = function create(properties) { - return new RelativeDistinguishedName(properties); - }; - - /** - * Encodes the specified RelativeDistinguishedName message. Does not implicitly {@link google.cloud.security.privateca.v1.RelativeDistinguishedName.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName - * @static - * @param {google.cloud.security.privateca.v1.IRelativeDistinguishedName} message RelativeDistinguishedName message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RelativeDistinguishedName.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attributes != null && message.attributes.length) - for (var i = 0; i < message.attributes.length; ++i) - $root.google.cloud.security.privateca.v1.AttributeTypeAndValue.encode(message.attributes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RelativeDistinguishedName message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.RelativeDistinguishedName.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName - * @static - * @param {google.cloud.security.privateca.v1.IRelativeDistinguishedName} message RelativeDistinguishedName message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RelativeDistinguishedName.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RelativeDistinguishedName message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.RelativeDistinguishedName} RelativeDistinguishedName - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RelativeDistinguishedName.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.RelativeDistinguishedName(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.attributes && message.attributes.length)) - message.attributes = []; - message.attributes.push($root.google.cloud.security.privateca.v1.AttributeTypeAndValue.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RelativeDistinguishedName message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.RelativeDistinguishedName} RelativeDistinguishedName - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RelativeDistinguishedName.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RelativeDistinguishedName message. - * @function verify - * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RelativeDistinguishedName.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) - return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.AttributeTypeAndValue.verify(message.attributes[i]); - if (error) - return "attributes." + error; - } - } - return null; - }; - - /** - * Creates a RelativeDistinguishedName message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.RelativeDistinguishedName} RelativeDistinguishedName - */ - RelativeDistinguishedName.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.RelativeDistinguishedName) - return object; - var message = new $root.google.cloud.security.privateca.v1.RelativeDistinguishedName(); - if (object.attributes) { - if (!Array.isArray(object.attributes)) - throw TypeError(".google.cloud.security.privateca.v1.RelativeDistinguishedName.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object.attributes.length; ++i) { - if (typeof object.attributes[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.RelativeDistinguishedName.attributes: object expected"); - message.attributes[i] = $root.google.cloud.security.privateca.v1.AttributeTypeAndValue.fromObject(object.attributes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RelativeDistinguishedName message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName - * @static - * @param {google.cloud.security.privateca.v1.RelativeDistinguishedName} message RelativeDistinguishedName - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RelativeDistinguishedName.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attributes = []; - if (message.attributes && message.attributes.length) { - object.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) - object.attributes[j] = $root.google.cloud.security.privateca.v1.AttributeTypeAndValue.toObject(message.attributes[j], options); - } - return object; - }; - - /** - * Converts this RelativeDistinguishedName to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName - * @instance - * @returns {Object.} JSON object - */ - RelativeDistinguishedName.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RelativeDistinguishedName - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.RelativeDistinguishedName - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RelativeDistinguishedName.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.RelativeDistinguishedName"; - }; - - return RelativeDistinguishedName; - })(); - - v1.Subject = (function() { - - /** - * Properties of a Subject. - * @memberof google.cloud.security.privateca.v1 - * @interface ISubject - * @property {string|null} [commonName] Subject commonName - * @property {string|null} [countryCode] Subject countryCode - * @property {string|null} [organization] Subject organization - * @property {string|null} [organizationalUnit] Subject organizationalUnit - * @property {string|null} [locality] Subject locality - * @property {string|null} [province] Subject province - * @property {string|null} [streetAddress] Subject streetAddress - * @property {string|null} [postalCode] Subject postalCode - * @property {Array.|null} [rdnSequence] Subject rdnSequence - */ - - /** - * Constructs a new Subject. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a Subject. - * @implements ISubject - * @constructor - * @param {google.cloud.security.privateca.v1.ISubject=} [properties] Properties to set - */ - function Subject(properties) { - this.rdnSequence = []; - 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]]; - } - - /** - * Subject commonName. - * @member {string} commonName - * @memberof google.cloud.security.privateca.v1.Subject - * @instance - */ - Subject.prototype.commonName = ""; - - /** - * Subject countryCode. - * @member {string} countryCode - * @memberof google.cloud.security.privateca.v1.Subject - * @instance - */ - Subject.prototype.countryCode = ""; - - /** - * Subject organization. - * @member {string} organization - * @memberof google.cloud.security.privateca.v1.Subject - * @instance - */ - Subject.prototype.organization = ""; - - /** - * Subject organizationalUnit. - * @member {string} organizationalUnit - * @memberof google.cloud.security.privateca.v1.Subject - * @instance - */ - Subject.prototype.organizationalUnit = ""; - - /** - * Subject locality. - * @member {string} locality - * @memberof google.cloud.security.privateca.v1.Subject - * @instance - */ - Subject.prototype.locality = ""; - - /** - * Subject province. - * @member {string} province - * @memberof google.cloud.security.privateca.v1.Subject - * @instance - */ - Subject.prototype.province = ""; - - /** - * Subject streetAddress. - * @member {string} streetAddress - * @memberof google.cloud.security.privateca.v1.Subject - * @instance - */ - Subject.prototype.streetAddress = ""; - - /** - * Subject postalCode. - * @member {string} postalCode - * @memberof google.cloud.security.privateca.v1.Subject - * @instance - */ - Subject.prototype.postalCode = ""; - - /** - * Subject rdnSequence. - * @member {Array.} rdnSequence - * @memberof google.cloud.security.privateca.v1.Subject - * @instance - */ - Subject.prototype.rdnSequence = $util.emptyArray; - - /** - * Creates a new Subject instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.Subject - * @static - * @param {google.cloud.security.privateca.v1.ISubject=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.Subject} Subject instance - */ - Subject.create = function create(properties) { - return new Subject(properties); - }; - - /** - * Encodes the specified Subject message. Does not implicitly {@link google.cloud.security.privateca.v1.Subject.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.Subject - * @static - * @param {google.cloud.security.privateca.v1.ISubject} message Subject message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Subject.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.commonName); - if (message.countryCode != null && Object.hasOwnProperty.call(message, "countryCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.countryCode); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.organization); - if (message.organizationalUnit != null && Object.hasOwnProperty.call(message, "organizationalUnit")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.organizationalUnit); - if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.locality); - if (message.province != null && Object.hasOwnProperty.call(message, "province")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.province); - if (message.streetAddress != null && Object.hasOwnProperty.call(message, "streetAddress")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.streetAddress); - if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.postalCode); - if (message.rdnSequence != null && message.rdnSequence.length) - for (var i = 0; i < message.rdnSequence.length; ++i) - $root.google.cloud.security.privateca.v1.RelativeDistinguishedName.encode(message.rdnSequence[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.Subject.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.Subject - * @static - * @param {google.cloud.security.privateca.v1.ISubject} message Subject message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Subject.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Subject message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.Subject - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.Subject} Subject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Subject.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.Subject(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonName = reader.string(); - break; - } - case 2: { - message.countryCode = reader.string(); - break; - } - case 3: { - message.organization = reader.string(); - break; - } - case 4: { - message.organizationalUnit = reader.string(); - break; - } - case 5: { - message.locality = reader.string(); - break; - } - case 6: { - message.province = reader.string(); - break; - } - case 7: { - message.streetAddress = reader.string(); - break; - } - case 8: { - message.postalCode = reader.string(); - break; - } - case 9: { - if (!(message.rdnSequence && message.rdnSequence.length)) - message.rdnSequence = []; - message.rdnSequence.push($root.google.cloud.security.privateca.v1.RelativeDistinguishedName.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Subject message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.Subject - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.Subject} Subject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Subject.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Subject message. - * @function verify - * @memberof google.cloud.security.privateca.v1.Subject - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Subject.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonName != null && message.hasOwnProperty("commonName")) - if (!$util.isString(message.commonName)) - return "commonName: string expected"; - if (message.countryCode != null && message.hasOwnProperty("countryCode")) - if (!$util.isString(message.countryCode)) - return "countryCode: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - if (!$util.isString(message.organization)) - return "organization: string expected"; - if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) - if (!$util.isString(message.organizationalUnit)) - return "organizationalUnit: string expected"; - if (message.locality != null && message.hasOwnProperty("locality")) - if (!$util.isString(message.locality)) - return "locality: string expected"; - if (message.province != null && message.hasOwnProperty("province")) - if (!$util.isString(message.province)) - return "province: string expected"; - if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) - if (!$util.isString(message.streetAddress)) - return "streetAddress: string expected"; - if (message.postalCode != null && message.hasOwnProperty("postalCode")) - if (!$util.isString(message.postalCode)) - return "postalCode: string expected"; - if (message.rdnSequence != null && message.hasOwnProperty("rdnSequence")) { - if (!Array.isArray(message.rdnSequence)) - return "rdnSequence: array expected"; - for (var i = 0; i < message.rdnSequence.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.RelativeDistinguishedName.verify(message.rdnSequence[i]); - if (error) - return "rdnSequence." + error; - } - } - return null; - }; - - /** - * Creates a Subject message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.Subject - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.Subject} Subject - */ - Subject.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.Subject) - return object; - var message = new $root.google.cloud.security.privateca.v1.Subject(); - if (object.commonName != null) - message.commonName = String(object.commonName); - if (object.countryCode != null) - message.countryCode = String(object.countryCode); - if (object.organization != null) - message.organization = String(object.organization); - if (object.organizationalUnit != null) - message.organizationalUnit = String(object.organizationalUnit); - if (object.locality != null) - message.locality = String(object.locality); - if (object.province != null) - message.province = String(object.province); - if (object.streetAddress != null) - message.streetAddress = String(object.streetAddress); - if (object.postalCode != null) - message.postalCode = String(object.postalCode); - if (object.rdnSequence) { - if (!Array.isArray(object.rdnSequence)) - throw TypeError(".google.cloud.security.privateca.v1.Subject.rdnSequence: array expected"); - message.rdnSequence = []; - for (var i = 0; i < object.rdnSequence.length; ++i) { - if (typeof object.rdnSequence[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.Subject.rdnSequence: object expected"); - message.rdnSequence[i] = $root.google.cloud.security.privateca.v1.RelativeDistinguishedName.fromObject(object.rdnSequence[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Subject message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.Subject - * @static - * @param {google.cloud.security.privateca.v1.Subject} message Subject - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Subject.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rdnSequence = []; - if (options.defaults) { - object.commonName = ""; - object.countryCode = ""; - object.organization = ""; - object.organizationalUnit = ""; - object.locality = ""; - object.province = ""; - object.streetAddress = ""; - object.postalCode = ""; - } - if (message.commonName != null && message.hasOwnProperty("commonName")) - object.commonName = message.commonName; - if (message.countryCode != null && message.hasOwnProperty("countryCode")) - object.countryCode = message.countryCode; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = message.organization; - if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) - object.organizationalUnit = message.organizationalUnit; - if (message.locality != null && message.hasOwnProperty("locality")) - object.locality = message.locality; - if (message.province != null && message.hasOwnProperty("province")) - object.province = message.province; - if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) - object.streetAddress = message.streetAddress; - if (message.postalCode != null && message.hasOwnProperty("postalCode")) - object.postalCode = message.postalCode; - if (message.rdnSequence && message.rdnSequence.length) { - object.rdnSequence = []; - for (var j = 0; j < message.rdnSequence.length; ++j) - object.rdnSequence[j] = $root.google.cloud.security.privateca.v1.RelativeDistinguishedName.toObject(message.rdnSequence[j], options); - } - return object; - }; - - /** - * Converts this Subject to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.Subject - * @instance - * @returns {Object.} JSON object - */ - Subject.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Subject - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.Subject - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Subject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.Subject"; - }; - - return Subject; - })(); - - v1.SubjectAltNames = (function() { - - /** - * Properties of a SubjectAltNames. - * @memberof google.cloud.security.privateca.v1 - * @interface ISubjectAltNames - * @property {Array.|null} [dnsNames] SubjectAltNames dnsNames - * @property {Array.|null} [uris] SubjectAltNames uris - * @property {Array.|null} [emailAddresses] SubjectAltNames emailAddresses - * @property {Array.|null} [ipAddresses] SubjectAltNames ipAddresses - * @property {Array.|null} [customSans] SubjectAltNames customSans - */ - - /** - * Constructs a new SubjectAltNames. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a SubjectAltNames. - * @implements ISubjectAltNames - * @constructor - * @param {google.cloud.security.privateca.v1.ISubjectAltNames=} [properties] Properties to set - */ - function SubjectAltNames(properties) { - this.dnsNames = []; - this.uris = []; - this.emailAddresses = []; - this.ipAddresses = []; - this.customSans = []; - 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]]; - } - - /** - * SubjectAltNames dnsNames. - * @member {Array.} dnsNames - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @instance - */ - SubjectAltNames.prototype.dnsNames = $util.emptyArray; - - /** - * SubjectAltNames uris. - * @member {Array.} uris - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @instance - */ - SubjectAltNames.prototype.uris = $util.emptyArray; - - /** - * SubjectAltNames emailAddresses. - * @member {Array.} emailAddresses - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @instance - */ - SubjectAltNames.prototype.emailAddresses = $util.emptyArray; - - /** - * SubjectAltNames ipAddresses. - * @member {Array.} ipAddresses - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @instance - */ - SubjectAltNames.prototype.ipAddresses = $util.emptyArray; - - /** - * SubjectAltNames customSans. - * @member {Array.} customSans - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @instance - */ - SubjectAltNames.prototype.customSans = $util.emptyArray; - - /** - * Creates a new SubjectAltNames instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1.ISubjectAltNames=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.SubjectAltNames} SubjectAltNames instance - */ - SubjectAltNames.create = function create(properties) { - return new SubjectAltNames(properties); - }; - - /** - * Encodes the specified SubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1.SubjectAltNames.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1.ISubjectAltNames} message SubjectAltNames message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectAltNames.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dnsNames != null && message.dnsNames.length) - for (var i = 0; i < message.dnsNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dnsNames[i]); - if (message.uris != null && message.uris.length) - for (var i = 0; i < message.uris.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uris[i]); - if (message.emailAddresses != null && message.emailAddresses.length) - for (var i = 0; i < message.emailAddresses.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.emailAddresses[i]); - if (message.ipAddresses != null && message.ipAddresses.length) - for (var i = 0; i < message.ipAddresses.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ipAddresses[i]); - if (message.customSans != null && message.customSans.length) - for (var i = 0; i < message.customSans.length; ++i) - $root.google.cloud.security.privateca.v1.X509Extension.encode(message.customSans[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.SubjectAltNames.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1.ISubjectAltNames} message SubjectAltNames message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectAltNames.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubjectAltNames message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.SubjectAltNames} SubjectAltNames - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectAltNames.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.SubjectAltNames(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.dnsNames && message.dnsNames.length)) - message.dnsNames = []; - message.dnsNames.push(reader.string()); - break; - } - case 2: { - if (!(message.uris && message.uris.length)) - message.uris = []; - message.uris.push(reader.string()); - break; - } - case 3: { - if (!(message.emailAddresses && message.emailAddresses.length)) - message.emailAddresses = []; - message.emailAddresses.push(reader.string()); - break; - } - case 4: { - if (!(message.ipAddresses && message.ipAddresses.length)) - message.ipAddresses = []; - message.ipAddresses.push(reader.string()); - break; - } - case 5: { - if (!(message.customSans && message.customSans.length)) - message.customSans = []; - message.customSans.push($root.google.cloud.security.privateca.v1.X509Extension.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubjectAltNames message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.SubjectAltNames} SubjectAltNames - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectAltNames.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubjectAltNames message. - * @function verify - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubjectAltNames.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { - if (!Array.isArray(message.dnsNames)) - return "dnsNames: array expected"; - for (var i = 0; i < message.dnsNames.length; ++i) - if (!$util.isString(message.dnsNames[i])) - return "dnsNames: string[] expected"; - } - if (message.uris != null && message.hasOwnProperty("uris")) { - if (!Array.isArray(message.uris)) - return "uris: array expected"; - for (var i = 0; i < message.uris.length; ++i) - if (!$util.isString(message.uris[i])) - return "uris: string[] expected"; - } - if (message.emailAddresses != null && message.hasOwnProperty("emailAddresses")) { - if (!Array.isArray(message.emailAddresses)) - return "emailAddresses: array expected"; - for (var i = 0; i < message.emailAddresses.length; ++i) - if (!$util.isString(message.emailAddresses[i])) - return "emailAddresses: string[] expected"; - } - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { - if (!Array.isArray(message.ipAddresses)) - return "ipAddresses: array expected"; - for (var i = 0; i < message.ipAddresses.length; ++i) - if (!$util.isString(message.ipAddresses[i])) - return "ipAddresses: string[] expected"; - } - if (message.customSans != null && message.hasOwnProperty("customSans")) { - if (!Array.isArray(message.customSans)) - return "customSans: array expected"; - for (var i = 0; i < message.customSans.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.X509Extension.verify(message.customSans[i]); - if (error) - return "customSans." + error; - } - } - return null; - }; - - /** - * Creates a SubjectAltNames message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.SubjectAltNames} SubjectAltNames - */ - SubjectAltNames.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.SubjectAltNames) - return object; - var message = new $root.google.cloud.security.privateca.v1.SubjectAltNames(); - if (object.dnsNames) { - if (!Array.isArray(object.dnsNames)) - throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.dnsNames: array expected"); - message.dnsNames = []; - for (var i = 0; i < object.dnsNames.length; ++i) - message.dnsNames[i] = String(object.dnsNames[i]); - } - if (object.uris) { - if (!Array.isArray(object.uris)) - throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.uris: array expected"); - message.uris = []; - for (var i = 0; i < object.uris.length; ++i) - message.uris[i] = String(object.uris[i]); - } - if (object.emailAddresses) { - if (!Array.isArray(object.emailAddresses)) - throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.emailAddresses: array expected"); - message.emailAddresses = []; - for (var i = 0; i < object.emailAddresses.length; ++i) - message.emailAddresses[i] = String(object.emailAddresses[i]); - } - if (object.ipAddresses) { - if (!Array.isArray(object.ipAddresses)) - throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.ipAddresses: array expected"); - message.ipAddresses = []; - for (var i = 0; i < object.ipAddresses.length; ++i) - message.ipAddresses[i] = String(object.ipAddresses[i]); - } - if (object.customSans) { - if (!Array.isArray(object.customSans)) - throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.customSans: array expected"); - message.customSans = []; - for (var i = 0; i < object.customSans.length; ++i) { - if (typeof object.customSans[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.SubjectAltNames.customSans: object expected"); - message.customSans[i] = $root.google.cloud.security.privateca.v1.X509Extension.fromObject(object.customSans[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SubjectAltNames message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1.SubjectAltNames} message SubjectAltNames - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubjectAltNames.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dnsNames = []; - object.uris = []; - object.emailAddresses = []; - object.ipAddresses = []; - object.customSans = []; - } - if (message.dnsNames && message.dnsNames.length) { - object.dnsNames = []; - for (var j = 0; j < message.dnsNames.length; ++j) - object.dnsNames[j] = message.dnsNames[j]; - } - if (message.uris && message.uris.length) { - object.uris = []; - for (var j = 0; j < message.uris.length; ++j) - object.uris[j] = message.uris[j]; - } - if (message.emailAddresses && message.emailAddresses.length) { - object.emailAddresses = []; - for (var j = 0; j < message.emailAddresses.length; ++j) - object.emailAddresses[j] = message.emailAddresses[j]; - } - if (message.ipAddresses && message.ipAddresses.length) { - object.ipAddresses = []; - for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = message.ipAddresses[j]; - } - if (message.customSans && message.customSans.length) { - object.customSans = []; - for (var j = 0; j < message.customSans.length; ++j) - object.customSans[j] = $root.google.cloud.security.privateca.v1.X509Extension.toObject(message.customSans[j], options); - } - return object; - }; - - /** - * Converts this SubjectAltNames to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @instance - * @returns {Object.} JSON object - */ - SubjectAltNames.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubjectAltNames - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.SubjectAltNames - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubjectAltNames.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.SubjectAltNames"; - }; - - return SubjectAltNames; - })(); - - v1.CertificateIdentityConstraints = (function() { - - /** - * Properties of a CertificateIdentityConstraints. - * @memberof google.cloud.security.privateca.v1 - * @interface ICertificateIdentityConstraints - * @property {google.type.IExpr|null} [celExpression] CertificateIdentityConstraints celExpression - * @property {boolean|null} [allowSubjectPassthrough] CertificateIdentityConstraints allowSubjectPassthrough - * @property {boolean|null} [allowSubjectAltNamesPassthrough] CertificateIdentityConstraints allowSubjectAltNamesPassthrough - */ - - /** - * Constructs a new CertificateIdentityConstraints. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CertificateIdentityConstraints. - * @implements ICertificateIdentityConstraints - * @constructor - * @param {google.cloud.security.privateca.v1.ICertificateIdentityConstraints=} [properties] Properties to set - */ - function CertificateIdentityConstraints(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]]; - } - - /** - * CertificateIdentityConstraints celExpression. - * @member {google.type.IExpr|null|undefined} celExpression - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @instance - */ - CertificateIdentityConstraints.prototype.celExpression = null; - - /** - * CertificateIdentityConstraints allowSubjectPassthrough. - * @member {boolean|null|undefined} allowSubjectPassthrough - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @instance - */ - CertificateIdentityConstraints.prototype.allowSubjectPassthrough = null; - - /** - * CertificateIdentityConstraints allowSubjectAltNamesPassthrough. - * @member {boolean|null|undefined} allowSubjectAltNamesPassthrough - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @instance - */ - CertificateIdentityConstraints.prototype.allowSubjectAltNamesPassthrough = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CertificateIdentityConstraints.prototype, "_allowSubjectPassthrough", { - get: $util.oneOfGetter($oneOfFields = ["allowSubjectPassthrough"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CertificateIdentityConstraints.prototype, "_allowSubjectAltNamesPassthrough", { - get: $util.oneOfGetter($oneOfFields = ["allowSubjectAltNamesPassthrough"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CertificateIdentityConstraints instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @static - * @param {google.cloud.security.privateca.v1.ICertificateIdentityConstraints=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateIdentityConstraints} CertificateIdentityConstraints instance - */ - CertificateIdentityConstraints.create = function create(properties) { - return new CertificateIdentityConstraints(properties); - }; - - /** - * Encodes the specified CertificateIdentityConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @static - * @param {google.cloud.security.privateca.v1.ICertificateIdentityConstraints} message CertificateIdentityConstraints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateIdentityConstraints.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.celExpression != null && Object.hasOwnProperty.call(message, "celExpression")) - $root.google.type.Expr.encode(message.celExpression, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.allowSubjectPassthrough != null && Object.hasOwnProperty.call(message, "allowSubjectPassthrough")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowSubjectPassthrough); - if (message.allowSubjectAltNamesPassthrough != null && Object.hasOwnProperty.call(message, "allowSubjectAltNamesPassthrough")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowSubjectAltNamesPassthrough); - return writer; - }; - - /** - * Encodes the specified CertificateIdentityConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateIdentityConstraints.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @static - * @param {google.cloud.security.privateca.v1.ICertificateIdentityConstraints} message CertificateIdentityConstraints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateIdentityConstraints.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateIdentityConstraints message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateIdentityConstraints} CertificateIdentityConstraints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateIdentityConstraints.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.celExpression = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - case 2: { - message.allowSubjectPassthrough = reader.bool(); - break; - } - case 3: { - message.allowSubjectAltNamesPassthrough = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateIdentityConstraints message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateIdentityConstraints} CertificateIdentityConstraints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateIdentityConstraints.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateIdentityConstraints message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateIdentityConstraints.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.celExpression != null && message.hasOwnProperty("celExpression")) { - var error = $root.google.type.Expr.verify(message.celExpression); - if (error) - return "celExpression." + error; - } - if (message.allowSubjectPassthrough != null && message.hasOwnProperty("allowSubjectPassthrough")) { - properties._allowSubjectPassthrough = 1; - if (typeof message.allowSubjectPassthrough !== "boolean") - return "allowSubjectPassthrough: boolean expected"; - } - if (message.allowSubjectAltNamesPassthrough != null && message.hasOwnProperty("allowSubjectAltNamesPassthrough")) { - properties._allowSubjectAltNamesPassthrough = 1; - if (typeof message.allowSubjectAltNamesPassthrough !== "boolean") - return "allowSubjectAltNamesPassthrough: boolean expected"; - } - return null; - }; - - /** - * Creates a CertificateIdentityConstraints message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateIdentityConstraints} CertificateIdentityConstraints - */ - CertificateIdentityConstraints.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateIdentityConstraints(); - if (object.celExpression != null) { - if (typeof object.celExpression !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateIdentityConstraints.celExpression: object expected"); - message.celExpression = $root.google.type.Expr.fromObject(object.celExpression); - } - if (object.allowSubjectPassthrough != null) - message.allowSubjectPassthrough = Boolean(object.allowSubjectPassthrough); - if (object.allowSubjectAltNamesPassthrough != null) - message.allowSubjectAltNamesPassthrough = Boolean(object.allowSubjectAltNamesPassthrough); - return message; - }; - - /** - * Creates a plain object from a CertificateIdentityConstraints message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @static - * @param {google.cloud.security.privateca.v1.CertificateIdentityConstraints} message CertificateIdentityConstraints - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateIdentityConstraints.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.celExpression = null; - if (message.celExpression != null && message.hasOwnProperty("celExpression")) - object.celExpression = $root.google.type.Expr.toObject(message.celExpression, options); - if (message.allowSubjectPassthrough != null && message.hasOwnProperty("allowSubjectPassthrough")) { - object.allowSubjectPassthrough = message.allowSubjectPassthrough; - if (options.oneofs) - object._allowSubjectPassthrough = "allowSubjectPassthrough"; - } - if (message.allowSubjectAltNamesPassthrough != null && message.hasOwnProperty("allowSubjectAltNamesPassthrough")) { - object.allowSubjectAltNamesPassthrough = message.allowSubjectAltNamesPassthrough; - if (options.oneofs) - object._allowSubjectAltNamesPassthrough = "allowSubjectAltNamesPassthrough"; - } - return object; - }; - - /** - * Converts this CertificateIdentityConstraints to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @instance - * @returns {Object.} JSON object - */ - CertificateIdentityConstraints.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateIdentityConstraints - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateIdentityConstraints - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateIdentityConstraints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateIdentityConstraints"; - }; - - return CertificateIdentityConstraints; - })(); - - v1.CertificateExtensionConstraints = (function() { - - /** - * Properties of a CertificateExtensionConstraints. - * @memberof google.cloud.security.privateca.v1 - * @interface ICertificateExtensionConstraints - * @property {Array.|null} [knownExtensions] CertificateExtensionConstraints knownExtensions - * @property {Array.|null} [additionalExtensions] CertificateExtensionConstraints additionalExtensions - */ - - /** - * Constructs a new CertificateExtensionConstraints. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CertificateExtensionConstraints. - * @implements ICertificateExtensionConstraints - * @constructor - * @param {google.cloud.security.privateca.v1.ICertificateExtensionConstraints=} [properties] Properties to set - */ - function CertificateExtensionConstraints(properties) { - this.knownExtensions = []; - this.additionalExtensions = []; - 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]]; - } - - /** - * CertificateExtensionConstraints knownExtensions. - * @member {Array.} knownExtensions - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @instance - */ - CertificateExtensionConstraints.prototype.knownExtensions = $util.emptyArray; - - /** - * CertificateExtensionConstraints additionalExtensions. - * @member {Array.} additionalExtensions - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @instance - */ - CertificateExtensionConstraints.prototype.additionalExtensions = $util.emptyArray; - - /** - * Creates a new CertificateExtensionConstraints instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @static - * @param {google.cloud.security.privateca.v1.ICertificateExtensionConstraints=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CertificateExtensionConstraints} CertificateExtensionConstraints instance - */ - CertificateExtensionConstraints.create = function create(properties) { - return new CertificateExtensionConstraints(properties); - }; - - /** - * Encodes the specified CertificateExtensionConstraints message. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @static - * @param {google.cloud.security.privateca.v1.ICertificateExtensionConstraints} message CertificateExtensionConstraints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateExtensionConstraints.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.knownExtensions != null && message.knownExtensions.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.knownExtensions.length; ++i) - writer.int32(message.knownExtensions[i]); - writer.ldelim(); - } - if (message.additionalExtensions != null && message.additionalExtensions.length) - for (var i = 0; i < message.additionalExtensions.length; ++i) - $root.google.cloud.security.privateca.v1.ObjectId.encode(message.additionalExtensions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CertificateExtensionConstraints message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CertificateExtensionConstraints.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @static - * @param {google.cloud.security.privateca.v1.ICertificateExtensionConstraints} message CertificateExtensionConstraints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateExtensionConstraints.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateExtensionConstraints message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CertificateExtensionConstraints} CertificateExtensionConstraints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateExtensionConstraints.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.knownExtensions && message.knownExtensions.length)) - message.knownExtensions = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.knownExtensions.push(reader.int32()); - } else - message.knownExtensions.push(reader.int32()); - break; - } - case 2: { - if (!(message.additionalExtensions && message.additionalExtensions.length)) - message.additionalExtensions = []; - message.additionalExtensions.push($root.google.cloud.security.privateca.v1.ObjectId.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateExtensionConstraints message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CertificateExtensionConstraints} CertificateExtensionConstraints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateExtensionConstraints.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateExtensionConstraints message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateExtensionConstraints.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.knownExtensions != null && message.hasOwnProperty("knownExtensions")) { - if (!Array.isArray(message.knownExtensions)) - return "knownExtensions: array expected"; - for (var i = 0; i < message.knownExtensions.length; ++i) - switch (message.knownExtensions[i]) { - default: - return "knownExtensions: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - } - if (message.additionalExtensions != null && message.hasOwnProperty("additionalExtensions")) { - if (!Array.isArray(message.additionalExtensions)) - return "additionalExtensions: array expected"; - for (var i = 0; i < message.additionalExtensions.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.ObjectId.verify(message.additionalExtensions[i]); - if (error) - return "additionalExtensions." + error; - } - } - return null; - }; - - /** - * Creates a CertificateExtensionConstraints message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CertificateExtensionConstraints} CertificateExtensionConstraints - */ - CertificateExtensionConstraints.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints) - return object; - var message = new $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints(); - if (object.knownExtensions) { - if (!Array.isArray(object.knownExtensions)) - throw TypeError(".google.cloud.security.privateca.v1.CertificateExtensionConstraints.knownExtensions: array expected"); - message.knownExtensions = []; - for (var i = 0; i < object.knownExtensions.length; ++i) - switch (object.knownExtensions[i]) { - default: - if (typeof object.knownExtensions[i] === "number") { - message.knownExtensions[i] = object.knownExtensions[i]; - break; - } - case "KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED": - case 0: - message.knownExtensions[i] = 0; - break; - case "BASE_KEY_USAGE": - case 1: - message.knownExtensions[i] = 1; - break; - case "EXTENDED_KEY_USAGE": - case 2: - message.knownExtensions[i] = 2; - break; - case "CA_OPTIONS": - case 3: - message.knownExtensions[i] = 3; - break; - case "POLICY_IDS": - case 4: - message.knownExtensions[i] = 4; - break; - case "AIA_OCSP_SERVERS": - case 5: - message.knownExtensions[i] = 5; - break; - case "NAME_CONSTRAINTS": - case 6: - message.knownExtensions[i] = 6; - break; - } - } - if (object.additionalExtensions) { - if (!Array.isArray(object.additionalExtensions)) - throw TypeError(".google.cloud.security.privateca.v1.CertificateExtensionConstraints.additionalExtensions: array expected"); - message.additionalExtensions = []; - for (var i = 0; i < object.additionalExtensions.length; ++i) { - if (typeof object.additionalExtensions[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CertificateExtensionConstraints.additionalExtensions: object expected"); - message.additionalExtensions[i] = $root.google.cloud.security.privateca.v1.ObjectId.fromObject(object.additionalExtensions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CertificateExtensionConstraints message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @static - * @param {google.cloud.security.privateca.v1.CertificateExtensionConstraints} message CertificateExtensionConstraints - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateExtensionConstraints.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.knownExtensions = []; - object.additionalExtensions = []; - } - if (message.knownExtensions && message.knownExtensions.length) { - object.knownExtensions = []; - for (var j = 0; j < message.knownExtensions.length; ++j) - object.knownExtensions[j] = options.enums === String ? $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension[message.knownExtensions[j]] === undefined ? message.knownExtensions[j] : $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension[message.knownExtensions[j]] : message.knownExtensions[j]; - } - if (message.additionalExtensions && message.additionalExtensions.length) { - object.additionalExtensions = []; - for (var j = 0; j < message.additionalExtensions.length; ++j) - object.additionalExtensions[j] = $root.google.cloud.security.privateca.v1.ObjectId.toObject(message.additionalExtensions[j], options); - } - return object; - }; - - /** - * Converts this CertificateExtensionConstraints to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @instance - * @returns {Object.} JSON object - */ - CertificateExtensionConstraints.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateExtensionConstraints - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CertificateExtensionConstraints - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateExtensionConstraints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CertificateExtensionConstraints"; - }; - - /** - * KnownCertificateExtension enum. - * @name google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension - * @enum {number} - * @property {number} KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED=0 KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED value - * @property {number} BASE_KEY_USAGE=1 BASE_KEY_USAGE value - * @property {number} EXTENDED_KEY_USAGE=2 EXTENDED_KEY_USAGE value - * @property {number} CA_OPTIONS=3 CA_OPTIONS value - * @property {number} POLICY_IDS=4 POLICY_IDS value - * @property {number} AIA_OCSP_SERVERS=5 AIA_OCSP_SERVERS value - * @property {number} NAME_CONSTRAINTS=6 NAME_CONSTRAINTS value - */ - CertificateExtensionConstraints.KnownCertificateExtension = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "BASE_KEY_USAGE"] = 1; - values[valuesById[2] = "EXTENDED_KEY_USAGE"] = 2; - values[valuesById[3] = "CA_OPTIONS"] = 3; - values[valuesById[4] = "POLICY_IDS"] = 4; - values[valuesById[5] = "AIA_OCSP_SERVERS"] = 5; - values[valuesById[6] = "NAME_CONSTRAINTS"] = 6; - return values; - })(); - - return CertificateExtensionConstraints; - })(); - - /** - * AttributeType enum. - * @name google.cloud.security.privateca.v1.AttributeType - * @enum {number} - * @property {number} ATTRIBUTE_TYPE_UNSPECIFIED=0 ATTRIBUTE_TYPE_UNSPECIFIED value - * @property {number} COMMON_NAME=1 COMMON_NAME value - * @property {number} COUNTRY_CODE=2 COUNTRY_CODE value - * @property {number} ORGANIZATION=3 ORGANIZATION value - * @property {number} ORGANIZATIONAL_UNIT=4 ORGANIZATIONAL_UNIT value - * @property {number} LOCALITY=5 LOCALITY value - * @property {number} PROVINCE=6 PROVINCE value - * @property {number} STREET_ADDRESS=7 STREET_ADDRESS value - * @property {number} POSTAL_CODE=8 POSTAL_CODE value - */ - v1.AttributeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ATTRIBUTE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "COMMON_NAME"] = 1; - values[valuesById[2] = "COUNTRY_CODE"] = 2; - values[valuesById[3] = "ORGANIZATION"] = 3; - values[valuesById[4] = "ORGANIZATIONAL_UNIT"] = 4; - values[valuesById[5] = "LOCALITY"] = 5; - values[valuesById[6] = "PROVINCE"] = 6; - values[valuesById[7] = "STREET_ADDRESS"] = 7; - values[valuesById[8] = "POSTAL_CODE"] = 8; - return values; - })(); - - /** - * RevocationReason enum. - * @name google.cloud.security.privateca.v1.RevocationReason - * @enum {number} - * @property {number} REVOCATION_REASON_UNSPECIFIED=0 REVOCATION_REASON_UNSPECIFIED value - * @property {number} KEY_COMPROMISE=1 KEY_COMPROMISE value - * @property {number} CERTIFICATE_AUTHORITY_COMPROMISE=2 CERTIFICATE_AUTHORITY_COMPROMISE value - * @property {number} AFFILIATION_CHANGED=3 AFFILIATION_CHANGED value - * @property {number} SUPERSEDED=4 SUPERSEDED value - * @property {number} CESSATION_OF_OPERATION=5 CESSATION_OF_OPERATION value - * @property {number} CERTIFICATE_HOLD=6 CERTIFICATE_HOLD value - * @property {number} PRIVILEGE_WITHDRAWN=7 PRIVILEGE_WITHDRAWN value - * @property {number} ATTRIBUTE_AUTHORITY_COMPROMISE=8 ATTRIBUTE_AUTHORITY_COMPROMISE value - */ - v1.RevocationReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REVOCATION_REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "KEY_COMPROMISE"] = 1; - values[valuesById[2] = "CERTIFICATE_AUTHORITY_COMPROMISE"] = 2; - values[valuesById[3] = "AFFILIATION_CHANGED"] = 3; - values[valuesById[4] = "SUPERSEDED"] = 4; - values[valuesById[5] = "CESSATION_OF_OPERATION"] = 5; - values[valuesById[6] = "CERTIFICATE_HOLD"] = 6; - values[valuesById[7] = "PRIVILEGE_WITHDRAWN"] = 7; - values[valuesById[8] = "ATTRIBUTE_AUTHORITY_COMPROMISE"] = 8; - return values; - })(); - - /** - * SubjectRequestMode enum. - * @name google.cloud.security.privateca.v1.SubjectRequestMode - * @enum {number} - * @property {number} SUBJECT_REQUEST_MODE_UNSPECIFIED=0 SUBJECT_REQUEST_MODE_UNSPECIFIED value - * @property {number} DEFAULT=1 DEFAULT value - * @property {number} RDN_SEQUENCE=3 RDN_SEQUENCE value - * @property {number} REFLECTED_SPIFFE=2 REFLECTED_SPIFFE value - */ - v1.SubjectRequestMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SUBJECT_REQUEST_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DEFAULT"] = 1; - values[valuesById[3] = "RDN_SEQUENCE"] = 3; - values[valuesById[2] = "REFLECTED_SPIFFE"] = 2; - return values; - })(); - - v1.CertificateAuthorityService = (function() { - - /** - * Constructs a new CertificateAuthorityService service. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CertificateAuthorityService - * @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 CertificateAuthorityService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CertificateAuthorityService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CertificateAuthorityService; - - /** - * Creates new CertificateAuthorityService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @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 {CertificateAuthorityService} RPC service. Useful where requests and/or responses are streamed. - */ - CertificateAuthorityService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificate}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef CreateCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.Certificate} [response] Certificate - */ - - /** - * Calls CreateCertificate. - * @function createCertificate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest} request CreateCertificateRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateCallback} callback Node-style callback called with the error, if any, and Certificate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.createCertificate = function createCertificate(request, callback) { - return this.rpcCall(createCertificate, $root.google.cloud.security.privateca.v1.CreateCertificateRequest, $root.google.cloud.security.privateca.v1.Certificate, request, callback); - }, "name", { value: "CreateCertificate" }); - - /** - * Calls CreateCertificate. - * @function createCertificate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest} request CreateCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificate}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef GetCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.Certificate} [response] Certificate - */ - - /** - * Calls GetCertificate. - * @function getCertificate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IGetCertificateRequest} request GetCertificateRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateCallback} callback Node-style callback called with the error, if any, and Certificate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.getCertificate = function getCertificate(request, callback) { - return this.rpcCall(getCertificate, $root.google.cloud.security.privateca.v1.GetCertificateRequest, $root.google.cloud.security.privateca.v1.Certificate, request, callback); - }, "name", { value: "GetCertificate" }); - - /** - * Calls GetCertificate. - * @function getCertificate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IGetCertificateRequest} request GetCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificates}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef ListCertificatesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.ListCertificatesResponse} [response] ListCertificatesResponse - */ - - /** - * Calls ListCertificates. - * @function listCertificates - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IListCertificatesRequest} request ListCertificatesRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificatesCallback} callback Node-style callback called with the error, if any, and ListCertificatesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.listCertificates = function listCertificates(request, callback) { - return this.rpcCall(listCertificates, $root.google.cloud.security.privateca.v1.ListCertificatesRequest, $root.google.cloud.security.privateca.v1.ListCertificatesResponse, request, callback); - }, "name", { value: "ListCertificates" }); - - /** - * Calls ListCertificates. - * @function listCertificates - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IListCertificatesRequest} request ListCertificatesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|revokeCertificate}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef RevokeCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.Certificate} [response] Certificate - */ - - /** - * Calls RevokeCertificate. - * @function revokeCertificate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest} request RevokeCertificateRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificateCallback} callback Node-style callback called with the error, if any, and Certificate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.revokeCertificate = function revokeCertificate(request, callback) { - return this.rpcCall(revokeCertificate, $root.google.cloud.security.privateca.v1.RevokeCertificateRequest, $root.google.cloud.security.privateca.v1.Certificate, request, callback); - }, "name", { value: "RevokeCertificate" }); - - /** - * Calls RevokeCertificate. - * @function revokeCertificate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest} request RevokeCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificate}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef UpdateCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.Certificate} [response] Certificate - */ - - /** - * Calls UpdateCertificate. - * @function updateCertificate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest} request UpdateCertificateRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateCallback} callback Node-style callback called with the error, if any, and Certificate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.updateCertificate = function updateCertificate(request, callback) { - return this.rpcCall(updateCertificate, $root.google.cloud.security.privateca.v1.UpdateCertificateRequest, $root.google.cloud.security.privateca.v1.Certificate, request, callback); - }, "name", { value: "UpdateCertificate" }); - - /** - * Calls UpdateCertificate. - * @function updateCertificate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest} request UpdateCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|activateCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef ActivateCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ActivateCertificateAuthority. - * @function activateCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest} request ActivateCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.activateCertificateAuthority = function activateCertificateAuthority(request, callback) { - return this.rpcCall(activateCertificateAuthority, $root.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ActivateCertificateAuthority" }); - - /** - * Calls ActivateCertificateAuthority. - * @function activateCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest} request ActivateCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef CreateCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateCertificateAuthority. - * @function createCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest} request CreateCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.createCertificateAuthority = function createCertificateAuthority(request, callback) { - return this.rpcCall(createCertificateAuthority, $root.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCertificateAuthority" }); - - /** - * Calls CreateCertificateAuthority. - * @function createCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest} request CreateCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|disableCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef DisableCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DisableCertificateAuthority. - * @function disableCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest} request DisableCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.disableCertificateAuthority = function disableCertificateAuthority(request, callback) { - return this.rpcCall(disableCertificateAuthority, $root.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DisableCertificateAuthority" }); - - /** - * Calls DisableCertificateAuthority. - * @function disableCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest} request DisableCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|enableCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef EnableCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls EnableCertificateAuthority. - * @function enableCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest} request EnableCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.enableCertificateAuthority = function enableCertificateAuthority(request, callback) { - return this.rpcCall(enableCertificateAuthority, $root.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "EnableCertificateAuthority" }); - - /** - * Calls EnableCertificateAuthority. - * @function enableCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest} request EnableCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|fetchCertificateAuthorityCsr}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef FetchCertificateAuthorityCsrCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} [response] FetchCertificateAuthorityCsrResponse - */ - - /** - * Calls FetchCertificateAuthorityCsr. - * @function fetchCertificateAuthorityCsr - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest} request FetchCertificateAuthorityCsrRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsrCallback} callback Node-style callback called with the error, if any, and FetchCertificateAuthorityCsrResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.fetchCertificateAuthorityCsr = function fetchCertificateAuthorityCsr(request, callback) { - return this.rpcCall(fetchCertificateAuthorityCsr, $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest, $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse, request, callback); - }, "name", { value: "FetchCertificateAuthorityCsr" }); - - /** - * Calls FetchCertificateAuthorityCsr. - * @function fetchCertificateAuthorityCsr - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest} request FetchCertificateAuthorityCsrRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef GetCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.CertificateAuthority} [response] CertificateAuthority - */ - - /** - * Calls GetCertificateAuthority. - * @function getCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest} request GetCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and CertificateAuthority - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.getCertificateAuthority = function getCertificateAuthority(request, callback) { - return this.rpcCall(getCertificateAuthority, $root.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest, $root.google.cloud.security.privateca.v1.CertificateAuthority, request, callback); - }, "name", { value: "GetCertificateAuthority" }); - - /** - * Calls GetCertificateAuthority. - * @function getCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest} request GetCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateAuthorities}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef ListCertificateAuthoritiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} [response] ListCertificateAuthoritiesResponse - */ - - /** - * Calls ListCertificateAuthorities. - * @function listCertificateAuthorities - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest} request ListCertificateAuthoritiesRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthoritiesCallback} callback Node-style callback called with the error, if any, and ListCertificateAuthoritiesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.listCertificateAuthorities = function listCertificateAuthorities(request, callback) { - return this.rpcCall(listCertificateAuthorities, $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest, $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse, request, callback); - }, "name", { value: "ListCertificateAuthorities" }); - - /** - * Calls ListCertificateAuthorities. - * @function listCertificateAuthorities - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest} request ListCertificateAuthoritiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|undeleteCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef UndeleteCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UndeleteCertificateAuthority. - * @function undeleteCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest} request UndeleteCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.undeleteCertificateAuthority = function undeleteCertificateAuthority(request, callback) { - return this.rpcCall(undeleteCertificateAuthority, $root.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UndeleteCertificateAuthority" }); - - /** - * Calls UndeleteCertificateAuthority. - * @function undeleteCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest} request UndeleteCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef DeleteCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteCertificateAuthority. - * @function deleteCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest} request DeleteCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.deleteCertificateAuthority = function deleteCertificateAuthority(request, callback) { - return this.rpcCall(deleteCertificateAuthority, $root.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteCertificateAuthority" }); - - /** - * Calls DeleteCertificateAuthority. - * @function deleteCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest} request DeleteCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef UpdateCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateCertificateAuthority. - * @function updateCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest} request UpdateCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.updateCertificateAuthority = function updateCertificateAuthority(request, callback) { - return this.rpcCall(updateCertificateAuthority, $root.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCertificateAuthority" }); - - /** - * Calls UpdateCertificateAuthority. - * @function updateCertificateAuthority - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest} request UpdateCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCaPool}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef CreateCaPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateCaPool. - * @function createCaPool - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest} request CreateCaPoolRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.createCaPool = function createCaPool(request, callback) { - return this.rpcCall(createCaPool, $root.google.cloud.security.privateca.v1.CreateCaPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCaPool" }); - - /** - * Calls CreateCaPool. - * @function createCaPool - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest} request CreateCaPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCaPool}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef UpdateCaPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateCaPool. - * @function updateCaPool - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest} request UpdateCaPoolRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.updateCaPool = function updateCaPool(request, callback) { - return this.rpcCall(updateCaPool, $root.google.cloud.security.privateca.v1.UpdateCaPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCaPool" }); - - /** - * Calls UpdateCaPool. - * @function updateCaPool - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest} request UpdateCaPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCaPool}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef GetCaPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.CaPool} [response] CaPool - */ - - /** - * Calls GetCaPool. - * @function getCaPool - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest} request GetCaPoolRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPoolCallback} callback Node-style callback called with the error, if any, and CaPool - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.getCaPool = function getCaPool(request, callback) { - return this.rpcCall(getCaPool, $root.google.cloud.security.privateca.v1.GetCaPoolRequest, $root.google.cloud.security.privateca.v1.CaPool, request, callback); - }, "name", { value: "GetCaPool" }); - - /** - * Calls GetCaPool. - * @function getCaPool - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest} request GetCaPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCaPools}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef ListCaPoolsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.ListCaPoolsResponse} [response] ListCaPoolsResponse - */ - - /** - * Calls ListCaPools. - * @function listCaPools - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest} request ListCaPoolsRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPoolsCallback} callback Node-style callback called with the error, if any, and ListCaPoolsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.listCaPools = function listCaPools(request, callback) { - return this.rpcCall(listCaPools, $root.google.cloud.security.privateca.v1.ListCaPoolsRequest, $root.google.cloud.security.privateca.v1.ListCaPoolsResponse, request, callback); - }, "name", { value: "ListCaPools" }); - - /** - * Calls ListCaPools. - * @function listCaPools - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest} request ListCaPoolsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCaPool}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef DeleteCaPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteCaPool. - * @function deleteCaPool - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest} request DeleteCaPoolRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.deleteCaPool = function deleteCaPool(request, callback) { - return this.rpcCall(deleteCaPool, $root.google.cloud.security.privateca.v1.DeleteCaPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteCaPool" }); - - /** - * Calls DeleteCaPool. - * @function deleteCaPool - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest} request DeleteCaPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|fetchCaCerts}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef FetchCaCertsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse} [response] FetchCaCertsResponse - */ - - /** - * Calls FetchCaCerts. - * @function fetchCaCerts - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest} request FetchCaCertsRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCertsCallback} callback Node-style callback called with the error, if any, and FetchCaCertsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.fetchCaCerts = function fetchCaCerts(request, callback) { - return this.rpcCall(fetchCaCerts, $root.google.cloud.security.privateca.v1.FetchCaCertsRequest, $root.google.cloud.security.privateca.v1.FetchCaCertsResponse, request, callback); - }, "name", { value: "FetchCaCerts" }); - - /** - * Calls FetchCaCerts. - * @function fetchCaCerts - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest} request FetchCaCertsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateRevocationList}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef GetCertificateRevocationListCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.CertificateRevocationList} [response] CertificateRevocationList - */ - - /** - * Calls GetCertificateRevocationList. - * @function getCertificateRevocationList - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest} request GetCertificateRevocationListRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationListCallback} callback Node-style callback called with the error, if any, and CertificateRevocationList - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.getCertificateRevocationList = function getCertificateRevocationList(request, callback) { - return this.rpcCall(getCertificateRevocationList, $root.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest, $root.google.cloud.security.privateca.v1.CertificateRevocationList, request, callback); - }, "name", { value: "GetCertificateRevocationList" }); - - /** - * Calls GetCertificateRevocationList. - * @function getCertificateRevocationList - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest} request GetCertificateRevocationListRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateRevocationLists}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef ListCertificateRevocationListsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} [response] ListCertificateRevocationListsResponse - */ - - /** - * Calls ListCertificateRevocationLists. - * @function listCertificateRevocationLists - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest} request ListCertificateRevocationListsRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationListsCallback} callback Node-style callback called with the error, if any, and ListCertificateRevocationListsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.listCertificateRevocationLists = function listCertificateRevocationLists(request, callback) { - return this.rpcCall(listCertificateRevocationLists, $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest, $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse, request, callback); - }, "name", { value: "ListCertificateRevocationLists" }); - - /** - * Calls ListCertificateRevocationLists. - * @function listCertificateRevocationLists - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest} request ListCertificateRevocationListsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateRevocationList}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef UpdateCertificateRevocationListCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateCertificateRevocationList. - * @function updateCertificateRevocationList - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest} request UpdateCertificateRevocationListRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationListCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.updateCertificateRevocationList = function updateCertificateRevocationList(request, callback) { - return this.rpcCall(updateCertificateRevocationList, $root.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCertificateRevocationList" }); - - /** - * Calls UpdateCertificateRevocationList. - * @function updateCertificateRevocationList - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest} request UpdateCertificateRevocationListRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|createCertificateTemplate}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef CreateCertificateTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateCertificateTemplate. - * @function createCertificateTemplate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest} request CreateCertificateTemplateRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplateCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.createCertificateTemplate = function createCertificateTemplate(request, callback) { - return this.rpcCall(createCertificateTemplate, $root.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCertificateTemplate" }); - - /** - * Calls CreateCertificateTemplate. - * @function createCertificateTemplate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest} request CreateCertificateTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|deleteCertificateTemplate}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef DeleteCertificateTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteCertificateTemplate. - * @function deleteCertificateTemplate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest} request DeleteCertificateTemplateRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplateCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.deleteCertificateTemplate = function deleteCertificateTemplate(request, callback) { - return this.rpcCall(deleteCertificateTemplate, $root.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteCertificateTemplate" }); - - /** - * Calls DeleteCertificateTemplate. - * @function deleteCertificateTemplate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest} request DeleteCertificateTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|getCertificateTemplate}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef GetCertificateTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.CertificateTemplate} [response] CertificateTemplate - */ - - /** - * Calls GetCertificateTemplate. - * @function getCertificateTemplate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest} request GetCertificateTemplateRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplateCallback} callback Node-style callback called with the error, if any, and CertificateTemplate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.getCertificateTemplate = function getCertificateTemplate(request, callback) { - return this.rpcCall(getCertificateTemplate, $root.google.cloud.security.privateca.v1.GetCertificateTemplateRequest, $root.google.cloud.security.privateca.v1.CertificateTemplate, request, callback); - }, "name", { value: "GetCertificateTemplate" }); - - /** - * Calls GetCertificateTemplate. - * @function getCertificateTemplate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest} request GetCertificateTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|listCertificateTemplates}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef ListCertificateTemplatesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} [response] ListCertificateTemplatesResponse - */ - - /** - * Calls ListCertificateTemplates. - * @function listCertificateTemplates - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest} request ListCertificateTemplatesRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplatesCallback} callback Node-style callback called with the error, if any, and ListCertificateTemplatesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.listCertificateTemplates = function listCertificateTemplates(request, callback) { - return this.rpcCall(listCertificateTemplates, $root.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest, $root.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse, request, callback); - }, "name", { value: "ListCertificateTemplates" }); - - /** - * Calls ListCertificateTemplates. - * @function listCertificateTemplates - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest} request ListCertificateTemplatesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1.CertificateAuthorityService|updateCertificateTemplate}. - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @typedef UpdateCertificateTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateCertificateTemplate. - * @function updateCertificateTemplate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest} request UpdateCertificateTemplateRequest message or plain object - * @param {google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplateCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.updateCertificateTemplate = function updateCertificateTemplate(request, callback) { - return this.rpcCall(updateCertificateTemplate, $root.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCertificateTemplate" }); - - /** - * Calls UpdateCertificateTemplate. - * @function updateCertificateTemplate - * @memberof google.cloud.security.privateca.v1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest} request UpdateCertificateTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CertificateAuthorityService; - })(); - - v1.CreateCertificateRequest = (function() { - - /** - * Properties of a CreateCertificateRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface ICreateCertificateRequest - * @property {string|null} [parent] CreateCertificateRequest parent - * @property {string|null} [certificateId] CreateCertificateRequest certificateId - * @property {google.cloud.security.privateca.v1.ICertificate|null} [certificate] CreateCertificateRequest certificate - * @property {string|null} [requestId] CreateCertificateRequest requestId - * @property {boolean|null} [validateOnly] CreateCertificateRequest validateOnly - * @property {string|null} [issuingCertificateAuthorityId] CreateCertificateRequest issuingCertificateAuthorityId - */ - - /** - * Constructs a new CreateCertificateRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CreateCertificateRequest. - * @implements ICreateCertificateRequest - * @constructor - * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest=} [properties] Properties to set - */ - function CreateCertificateRequest(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]]; - } - - /** - * CreateCertificateRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @instance - */ - CreateCertificateRequest.prototype.parent = ""; - - /** - * CreateCertificateRequest certificateId. - * @member {string} certificateId - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @instance - */ - CreateCertificateRequest.prototype.certificateId = ""; - - /** - * CreateCertificateRequest certificate. - * @member {google.cloud.security.privateca.v1.ICertificate|null|undefined} certificate - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @instance - */ - CreateCertificateRequest.prototype.certificate = null; - - /** - * CreateCertificateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @instance - */ - CreateCertificateRequest.prototype.requestId = ""; - - /** - * CreateCertificateRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @instance - */ - CreateCertificateRequest.prototype.validateOnly = false; - - /** - * CreateCertificateRequest issuingCertificateAuthorityId. - * @member {string} issuingCertificateAuthorityId - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @instance - */ - CreateCertificateRequest.prototype.issuingCertificateAuthorityId = ""; - - /** - * Creates a new CreateCertificateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CreateCertificateRequest} CreateCertificateRequest instance - */ - CreateCertificateRequest.create = function create(properties) { - return new CreateCertificateRequest(properties); - }; - - /** - * Encodes the specified CreateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest} message CreateCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCertificateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.certificateId != null && Object.hasOwnProperty.call(message, "certificateId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateId); - if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) - $root.google.cloud.security.privateca.v1.Certificate.encode(message.certificate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - if (message.issuingCertificateAuthorityId != null && Object.hasOwnProperty.call(message, "issuingCertificateAuthorityId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.issuingCertificateAuthorityId); - return writer; - }; - - /** - * Encodes the specified CreateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCertificateRequest} message CreateCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCertificateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CreateCertificateRequest} CreateCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCertificateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CreateCertificateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.certificateId = reader.string(); - break; - } - case 3: { - message.certificate = $root.google.cloud.security.privateca.v1.Certificate.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - case 6: { - message.issuingCertificateAuthorityId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCertificateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CreateCertificateRequest} CreateCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCertificateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCertificateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCertificateRequest.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.certificateId != null && message.hasOwnProperty("certificateId")) - if (!$util.isString(message.certificateId)) - return "certificateId: string expected"; - if (message.certificate != null && message.hasOwnProperty("certificate")) { - var error = $root.google.cloud.security.privateca.v1.Certificate.verify(message.certificate); - if (error) - return "certificate." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.issuingCertificateAuthorityId != null && message.hasOwnProperty("issuingCertificateAuthorityId")) - if (!$util.isString(message.issuingCertificateAuthorityId)) - return "issuingCertificateAuthorityId: string expected"; - return null; - }; - - /** - * Creates a CreateCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CreateCertificateRequest} CreateCertificateRequest - */ - CreateCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CreateCertificateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.CreateCertificateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.certificateId != null) - message.certificateId = String(object.certificateId); - if (object.certificate != null) { - if (typeof object.certificate !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CreateCertificateRequest.certificate: object expected"); - message.certificate = $root.google.cloud.security.privateca.v1.Certificate.fromObject(object.certificate); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.issuingCertificateAuthorityId != null) - message.issuingCertificateAuthorityId = String(object.issuingCertificateAuthorityId); - return message; - }; - - /** - * Creates a plain object from a CreateCertificateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.CreateCertificateRequest} message CreateCertificateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCertificateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.certificateId = ""; - object.certificate = null; - object.requestId = ""; - object.validateOnly = false; - object.issuingCertificateAuthorityId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.certificateId != null && message.hasOwnProperty("certificateId")) - object.certificateId = message.certificateId; - if (message.certificate != null && message.hasOwnProperty("certificate")) - object.certificate = $root.google.cloud.security.privateca.v1.Certificate.toObject(message.certificate, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.issuingCertificateAuthorityId != null && message.hasOwnProperty("issuingCertificateAuthorityId")) - object.issuingCertificateAuthorityId = message.issuingCertificateAuthorityId; - return object; - }; - - /** - * Converts this CreateCertificateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCertificateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCertificateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CreateCertificateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CreateCertificateRequest"; - }; - - return CreateCertificateRequest; - })(); - - v1.GetCertificateRequest = (function() { - - /** - * Properties of a GetCertificateRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IGetCertificateRequest - * @property {string|null} [name] GetCertificateRequest name - */ - - /** - * Constructs a new GetCertificateRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a GetCertificateRequest. - * @implements IGetCertificateRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IGetCertificateRequest=} [properties] Properties to set - */ - function GetCertificateRequest(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]]; - } - - /** - * GetCertificateRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.GetCertificateRequest - * @instance - */ - GetCertificateRequest.prototype.name = ""; - - /** - * Creates a new GetCertificateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.GetCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.GetCertificateRequest} GetCertificateRequest instance - */ - GetCertificateRequest.create = function create(properties) { - return new GetCertificateRequest(properties); - }; - - /** - * Encodes the specified GetCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.GetCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateRequest} message GetCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.GetCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateRequest} message GetCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCertificateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.GetCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.GetCertificateRequest} GetCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.GetCertificateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCertificateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.GetCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.GetCertificateRequest} GetCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCertificateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.GetCertificateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCertificateRequest.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 GetCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.GetCertificateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.GetCertificateRequest} GetCertificateRequest - */ - GetCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.GetCertificateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.GetCertificateRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetCertificateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.GetCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.GetCertificateRequest} message GetCertificateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCertificateRequest.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 GetCertificateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.GetCertificateRequest - * @instance - * @returns {Object.} JSON object - */ - GetCertificateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCertificateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.GetCertificateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.GetCertificateRequest"; - }; - - return GetCertificateRequest; - })(); - - v1.ListCertificatesRequest = (function() { - - /** - * Properties of a ListCertificatesRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IListCertificatesRequest - * @property {string|null} [parent] ListCertificatesRequest parent - * @property {number|null} [pageSize] ListCertificatesRequest pageSize - * @property {string|null} [pageToken] ListCertificatesRequest pageToken - * @property {string|null} [filter] ListCertificatesRequest filter - * @property {string|null} [orderBy] ListCertificatesRequest orderBy - */ - - /** - * Constructs a new ListCertificatesRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a ListCertificatesRequest. - * @implements IListCertificatesRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IListCertificatesRequest=} [properties] Properties to set - */ - function ListCertificatesRequest(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]]; - } - - /** - * ListCertificatesRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @instance - */ - ListCertificatesRequest.prototype.parent = ""; - - /** - * ListCertificatesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @instance - */ - ListCertificatesRequest.prototype.pageSize = 0; - - /** - * ListCertificatesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @instance - */ - ListCertificatesRequest.prototype.pageToken = ""; - - /** - * ListCertificatesRequest filter. - * @member {string} filter - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @instance - */ - ListCertificatesRequest.prototype.filter = ""; - - /** - * ListCertificatesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @instance - */ - ListCertificatesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListCertificatesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificatesRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ListCertificatesRequest} ListCertificatesRequest instance - */ - ListCertificatesRequest.create = function create(properties) { - return new ListCertificatesRequest(properties); - }; - - /** - * Encodes the specified ListCertificatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificatesRequest} message ListCertificatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificatesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificatesRequest} message ListCertificatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificatesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ListCertificatesRequest} ListCertificatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificatesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificatesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListCertificatesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ListCertificatesRequest} ListCertificatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificatesRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificatesRequest.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 ListCertificatesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ListCertificatesRequest} ListCertificatesRequest - */ - ListCertificatesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificatesRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.ListCertificatesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListCertificatesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @static - * @param {google.cloud.security.privateca.v1.ListCertificatesRequest} message ListCertificatesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificatesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListCertificatesRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @instance - * @returns {Object.} JSON object - */ - ListCertificatesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificatesRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ListCertificatesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificatesRequest"; - }; - - return ListCertificatesRequest; - })(); - - v1.ListCertificatesResponse = (function() { - - /** - * Properties of a ListCertificatesResponse. - * @memberof google.cloud.security.privateca.v1 - * @interface IListCertificatesResponse - * @property {Array.|null} [certificates] ListCertificatesResponse certificates - * @property {string|null} [nextPageToken] ListCertificatesResponse nextPageToken - * @property {Array.|null} [unreachable] ListCertificatesResponse unreachable - */ - - /** - * Constructs a new ListCertificatesResponse. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a ListCertificatesResponse. - * @implements IListCertificatesResponse - * @constructor - * @param {google.cloud.security.privateca.v1.IListCertificatesResponse=} [properties] Properties to set - */ - function ListCertificatesResponse(properties) { - this.certificates = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCertificatesResponse certificates. - * @member {Array.} certificates - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @instance - */ - ListCertificatesResponse.prototype.certificates = $util.emptyArray; - - /** - * ListCertificatesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @instance - */ - ListCertificatesResponse.prototype.nextPageToken = ""; - - /** - * ListCertificatesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @instance - */ - ListCertificatesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListCertificatesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificatesResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ListCertificatesResponse} ListCertificatesResponse instance - */ - ListCertificatesResponse.create = function create(properties) { - return new ListCertificatesResponse(properties); - }; - - /** - * Encodes the specified ListCertificatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificatesResponse} message ListCertificatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificatesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificates != null && message.certificates.length) - for (var i = 0; i < message.certificates.length; ++i) - $root.google.cloud.security.privateca.v1.Certificate.encode(message.certificates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListCertificatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificatesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificatesResponse} message ListCertificatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificatesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ListCertificatesResponse} ListCertificatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificatesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificatesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.certificates && message.certificates.length)) - message.certificates = []; - message.certificates.push($root.google.cloud.security.privateca.v1.Certificate.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCertificatesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ListCertificatesResponse} ListCertificatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificatesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificatesResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificatesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificates != null && message.hasOwnProperty("certificates")) { - if (!Array.isArray(message.certificates)) - return "certificates: array expected"; - for (var i = 0; i < message.certificates.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.Certificate.verify(message.certificates[i]); - if (error) - return "certificates." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListCertificatesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ListCertificatesResponse} ListCertificatesResponse - */ - ListCertificatesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificatesResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1.ListCertificatesResponse(); - if (object.certificates) { - if (!Array.isArray(object.certificates)) - throw TypeError(".google.cloud.security.privateca.v1.ListCertificatesResponse.certificates: array expected"); - message.certificates = []; - for (var i = 0; i < object.certificates.length; ++i) { - if (typeof object.certificates[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.ListCertificatesResponse.certificates: object expected"); - message.certificates[i] = $root.google.cloud.security.privateca.v1.Certificate.fromObject(object.certificates[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.security.privateca.v1.ListCertificatesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListCertificatesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @static - * @param {google.cloud.security.privateca.v1.ListCertificatesResponse} message ListCertificatesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificatesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.certificates = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.certificates && message.certificates.length) { - object.certificates = []; - for (var j = 0; j < message.certificates.length; ++j) - object.certificates[j] = $root.google.cloud.security.privateca.v1.Certificate.toObject(message.certificates[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListCertificatesResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @instance - * @returns {Object.} JSON object - */ - ListCertificatesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificatesResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ListCertificatesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificatesResponse"; - }; - - return ListCertificatesResponse; - })(); - - v1.RevokeCertificateRequest = (function() { - - /** - * Properties of a RevokeCertificateRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IRevokeCertificateRequest - * @property {string|null} [name] RevokeCertificateRequest name - * @property {google.cloud.security.privateca.v1.RevocationReason|null} [reason] RevokeCertificateRequest reason - * @property {string|null} [requestId] RevokeCertificateRequest requestId - */ - - /** - * Constructs a new RevokeCertificateRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a RevokeCertificateRequest. - * @implements IRevokeCertificateRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest=} [properties] Properties to set - */ - function RevokeCertificateRequest(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]]; - } - - /** - * RevokeCertificateRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @instance - */ - RevokeCertificateRequest.prototype.name = ""; - - /** - * RevokeCertificateRequest reason. - * @member {google.cloud.security.privateca.v1.RevocationReason} reason - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @instance - */ - RevokeCertificateRequest.prototype.reason = 0; - - /** - * RevokeCertificateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @instance - */ - RevokeCertificateRequest.prototype.requestId = ""; - - /** - * Creates a new RevokeCertificateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.RevokeCertificateRequest} RevokeCertificateRequest instance - */ - RevokeCertificateRequest.create = function create(properties) { - return new RevokeCertificateRequest(properties); - }; - - /** - * Encodes the specified RevokeCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.RevokeCertificateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest} message RevokeCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevokeCertificateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified RevokeCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.RevokeCertificateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.IRevokeCertificateRequest} message RevokeCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevokeCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevokeCertificateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.RevokeCertificateRequest} RevokeCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevokeCertificateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.RevokeCertificateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.reason = reader.int32(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevokeCertificateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.RevokeCertificateRequest} RevokeCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevokeCertificateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevokeCertificateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevokeCertificateRequest.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.reason != null && message.hasOwnProperty("reason")) - switch (message.reason) { - default: - return "reason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a RevokeCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.RevokeCertificateRequest} RevokeCertificateRequest - */ - RevokeCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.RevokeCertificateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.RevokeCertificateRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.reason) { - default: - if (typeof object.reason === "number") { - message.reason = object.reason; - break; - } - break; - case "REVOCATION_REASON_UNSPECIFIED": - case 0: - message.reason = 0; - break; - case "KEY_COMPROMISE": - case 1: - message.reason = 1; - break; - case "CERTIFICATE_AUTHORITY_COMPROMISE": - case 2: - message.reason = 2; - break; - case "AFFILIATION_CHANGED": - case 3: - message.reason = 3; - break; - case "SUPERSEDED": - case 4: - message.reason = 4; - break; - case "CESSATION_OF_OPERATION": - case 5: - message.reason = 5; - break; - case "CERTIFICATE_HOLD": - case 6: - message.reason = 6; - break; - case "PRIVILEGE_WITHDRAWN": - case 7: - message.reason = 7; - break; - case "ATTRIBUTE_AUTHORITY_COMPROMISE": - case 8: - message.reason = 8; - break; - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a RevokeCertificateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.RevokeCertificateRequest} message RevokeCertificateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevokeCertificateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.reason = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = options.enums === String ? $root.google.cloud.security.privateca.v1.RevocationReason[message.reason] === undefined ? message.reason : $root.google.cloud.security.privateca.v1.RevocationReason[message.reason] : message.reason; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this RevokeCertificateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @instance - * @returns {Object.} JSON object - */ - RevokeCertificateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevokeCertificateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.RevokeCertificateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevokeCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.RevokeCertificateRequest"; - }; - - return RevokeCertificateRequest; - })(); - - v1.UpdateCertificateRequest = (function() { - - /** - * Properties of an UpdateCertificateRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IUpdateCertificateRequest - * @property {google.cloud.security.privateca.v1.ICertificate|null} [certificate] UpdateCertificateRequest certificate - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateRequest updateMask - * @property {string|null} [requestId] UpdateCertificateRequest requestId - */ - - /** - * Constructs a new UpdateCertificateRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an UpdateCertificateRequest. - * @implements IUpdateCertificateRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest=} [properties] Properties to set - */ - function UpdateCertificateRequest(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]]; - } - - /** - * UpdateCertificateRequest certificate. - * @member {google.cloud.security.privateca.v1.ICertificate|null|undefined} certificate - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @instance - */ - UpdateCertificateRequest.prototype.certificate = null; - - /** - * UpdateCertificateRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @instance - */ - UpdateCertificateRequest.prototype.updateMask = null; - - /** - * UpdateCertificateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @instance - */ - UpdateCertificateRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateCertificateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.UpdateCertificateRequest} UpdateCertificateRequest instance - */ - UpdateCertificateRequest.create = function create(properties) { - return new UpdateCertificateRequest(properties); - }; - - /** - * Encodes the specified UpdateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest} message UpdateCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) - $root.google.cloud.security.privateca.v1.Certificate.encode(message.certificate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRequest} message UpdateCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCertificateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.UpdateCertificateRequest} UpdateCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UpdateCertificateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.certificate = $root.google.cloud.security.privateca.v1.Certificate.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCertificateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.UpdateCertificateRequest} UpdateCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCertificateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCertificateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificate != null && message.hasOwnProperty("certificate")) { - var error = $root.google.cloud.security.privateca.v1.Certificate.verify(message.certificate); - if (error) - return "certificate." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.UpdateCertificateRequest} UpdateCertificateRequest - */ - UpdateCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.UpdateCertificateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.UpdateCertificateRequest(); - if (object.certificate != null) { - if (typeof object.certificate !== "object") - throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateRequest.certificate: object expected"); - message.certificate = $root.google.cloud.security.privateca.v1.Certificate.fromObject(object.certificate); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateCertificateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1.UpdateCertificateRequest} message UpdateCertificateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCertificateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.certificate = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.certificate != null && message.hasOwnProperty("certificate")) - object.certificate = $root.google.cloud.security.privateca.v1.Certificate.toObject(message.certificate, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateCertificateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCertificateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCertificateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.UpdateCertificateRequest"; - }; - - return UpdateCertificateRequest; - })(); - - v1.ActivateCertificateAuthorityRequest = (function() { - - /** - * Properties of an ActivateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IActivateCertificateAuthorityRequest - * @property {string|null} [name] ActivateCertificateAuthorityRequest name - * @property {string|null} [pemCaCertificate] ActivateCertificateAuthorityRequest pemCaCertificate - * @property {google.cloud.security.privateca.v1.ISubordinateConfig|null} [subordinateConfig] ActivateCertificateAuthorityRequest subordinateConfig - * @property {string|null} [requestId] ActivateCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new ActivateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an ActivateCertificateAuthorityRequest. - * @implements IActivateCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest=} [properties] Properties to set - */ - function ActivateCertificateAuthorityRequest(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]]; - } - - /** - * ActivateCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @instance - */ - ActivateCertificateAuthorityRequest.prototype.name = ""; - - /** - * ActivateCertificateAuthorityRequest pemCaCertificate. - * @member {string} pemCaCertificate - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @instance - */ - ActivateCertificateAuthorityRequest.prototype.pemCaCertificate = ""; - - /** - * ActivateCertificateAuthorityRequest subordinateConfig. - * @member {google.cloud.security.privateca.v1.ISubordinateConfig|null|undefined} subordinateConfig - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @instance - */ - ActivateCertificateAuthorityRequest.prototype.subordinateConfig = null; - - /** - * ActivateCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @instance - */ - ActivateCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new ActivateCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest instance - */ - ActivateCertificateAuthorityRequest.create = function create(properties) { - return new ActivateCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified ActivateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActivateCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.pemCaCertificate != null && Object.hasOwnProperty.call(message, "pemCaCertificate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCaCertificate); - if (message.subordinateConfig != null && Object.hasOwnProperty.call(message, "subordinateConfig")) - $root.google.cloud.security.privateca.v1.SubordinateConfig.encode(message.subordinateConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified ActivateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActivateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActivateCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.pemCaCertificate = reader.string(); - break; - } - case 3: { - message.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActivateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ActivateCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ActivateCertificateAuthorityRequest.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.pemCaCertificate != null && message.hasOwnProperty("pemCaCertificate")) - if (!$util.isString(message.pemCaCertificate)) - return "pemCaCertificate: string expected"; - if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) { - var error = $root.google.cloud.security.privateca.v1.SubordinateConfig.verify(message.subordinateConfig); - if (error) - return "subordinateConfig." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an ActivateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest - */ - ActivateCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.pemCaCertificate != null) - message.pemCaCertificate = String(object.pemCaCertificate); - if (object.subordinateConfig != null) { - if (typeof object.subordinateConfig !== "object") - throw TypeError(".google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest.subordinateConfig: object expected"); - message.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.fromObject(object.subordinateConfig); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an ActivateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ActivateCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.pemCaCertificate = ""; - object.subordinateConfig = null; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.pemCaCertificate != null && message.hasOwnProperty("pemCaCertificate")) - object.pemCaCertificate = message.pemCaCertificate; - if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) - object.subordinateConfig = $root.google.cloud.security.privateca.v1.SubordinateConfig.toObject(message.subordinateConfig, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this ActivateCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - ActivateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ActivateCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ActivateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest"; - }; - - return ActivateCertificateAuthorityRequest; - })(); - - v1.CreateCertificateAuthorityRequest = (function() { - - /** - * Properties of a CreateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface ICreateCertificateAuthorityRequest - * @property {string|null} [parent] CreateCertificateAuthorityRequest parent - * @property {string|null} [certificateAuthorityId] CreateCertificateAuthorityRequest certificateAuthorityId - * @property {google.cloud.security.privateca.v1.ICertificateAuthority|null} [certificateAuthority] CreateCertificateAuthorityRequest certificateAuthority - * @property {string|null} [requestId] CreateCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new CreateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CreateCertificateAuthorityRequest. - * @implements ICreateCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest=} [properties] Properties to set - */ - function CreateCertificateAuthorityRequest(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]]; - } - - /** - * CreateCertificateAuthorityRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @instance - */ - CreateCertificateAuthorityRequest.prototype.parent = ""; - - /** - * CreateCertificateAuthorityRequest certificateAuthorityId. - * @member {string} certificateAuthorityId - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @instance - */ - CreateCertificateAuthorityRequest.prototype.certificateAuthorityId = ""; - - /** - * CreateCertificateAuthorityRequest certificateAuthority. - * @member {google.cloud.security.privateca.v1.ICertificateAuthority|null|undefined} certificateAuthority - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @instance - */ - CreateCertificateAuthorityRequest.prototype.certificateAuthority = null; - - /** - * CreateCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @instance - */ - CreateCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new CreateCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest instance - */ - CreateCertificateAuthorityRequest.create = function create(properties) { - return new CreateCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified CreateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.certificateAuthorityId != null && Object.hasOwnProperty.call(message, "certificateAuthorityId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateAuthorityId); - if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) - $root.google.cloud.security.privateca.v1.CertificateAuthority.encode(message.certificateAuthority, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.certificateAuthorityId = reader.string(); - break; - } - case 3: { - message.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCertificateAuthorityRequest.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.certificateAuthorityId != null && message.hasOwnProperty("certificateAuthorityId")) - if (!$util.isString(message.certificateAuthorityId)) - return "certificateAuthorityId: string expected"; - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { - var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.verify(message.certificateAuthority); - if (error) - return "certificateAuthority." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest - */ - CreateCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.certificateAuthorityId != null) - message.certificateAuthorityId = String(object.certificateAuthorityId); - if (object.certificateAuthority != null) { - if (typeof object.certificateAuthority !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest.certificateAuthority: object expected"); - message.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.fromObject(object.certificateAuthority); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.certificateAuthorityId = ""; - object.certificateAuthority = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.certificateAuthorityId != null && message.hasOwnProperty("certificateAuthorityId")) - object.certificateAuthorityId = message.certificateAuthorityId; - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) - object.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.toObject(message.certificateAuthority, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest"; - }; - - return CreateCertificateAuthorityRequest; - })(); - - v1.DisableCertificateAuthorityRequest = (function() { - - /** - * Properties of a DisableCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IDisableCertificateAuthorityRequest - * @property {string|null} [name] DisableCertificateAuthorityRequest name - * @property {string|null} [requestId] DisableCertificateAuthorityRequest requestId - * @property {boolean|null} [ignoreDependentResources] DisableCertificateAuthorityRequest ignoreDependentResources - */ - - /** - * Constructs a new DisableCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a DisableCertificateAuthorityRequest. - * @implements IDisableCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest=} [properties] Properties to set - */ - function DisableCertificateAuthorityRequest(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]]; - } - - /** - * DisableCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @instance - */ - DisableCertificateAuthorityRequest.prototype.name = ""; - - /** - * DisableCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @instance - */ - DisableCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * DisableCertificateAuthorityRequest ignoreDependentResources. - * @member {boolean} ignoreDependentResources - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @instance - */ - DisableCertificateAuthorityRequest.prototype.ignoreDependentResources = false; - - /** - * Creates a new DisableCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest instance - */ - DisableCertificateAuthorityRequest.create = function create(properties) { - return new DisableCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified DisableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.ignoreDependentResources != null && Object.hasOwnProperty.call(message, "ignoreDependentResources")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreDependentResources); - return writer; - }; - - /** - * Encodes the specified DisableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.ignoreDependentResources = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisableCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisableCertificateAuthorityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) - if (typeof message.ignoreDependentResources !== "boolean") - return "ignoreDependentResources: boolean expected"; - return null; - }; - - /** - * Creates a DisableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest - */ - DisableCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.ignoreDependentResources != null) - message.ignoreDependentResources = Boolean(object.ignoreDependentResources); - return message; - }; - - /** - * Creates a plain object from a DisableCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisableCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.ignoreDependentResources = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) - object.ignoreDependentResources = message.ignoreDependentResources; - return object; - }; - - /** - * Converts this DisableCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - DisableCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisableCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisableCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest"; - }; - - return DisableCertificateAuthorityRequest; - })(); - - v1.EnableCertificateAuthorityRequest = (function() { - - /** - * Properties of an EnableCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IEnableCertificateAuthorityRequest - * @property {string|null} [name] EnableCertificateAuthorityRequest name - * @property {string|null} [requestId] EnableCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new EnableCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an EnableCertificateAuthorityRequest. - * @implements IEnableCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest=} [properties] Properties to set - */ - function EnableCertificateAuthorityRequest(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]]; - } - - /** - * EnableCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @instance - */ - EnableCertificateAuthorityRequest.prototype.name = ""; - - /** - * EnableCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @instance - */ - EnableCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new EnableCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest instance - */ - EnableCertificateAuthorityRequest.create = function create(properties) { - return new EnableCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified EnableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified EnableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnableCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnableCertificateAuthorityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an EnableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest - */ - EnableCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an EnableCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnableCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this EnableCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - EnableCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnableCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnableCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest"; - }; - - return EnableCertificateAuthorityRequest; - })(); - - v1.FetchCertificateAuthorityCsrRequest = (function() { - - /** - * Properties of a FetchCertificateAuthorityCsrRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IFetchCertificateAuthorityCsrRequest - * @property {string|null} [name] FetchCertificateAuthorityCsrRequest name - */ - - /** - * Constructs a new FetchCertificateAuthorityCsrRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a FetchCertificateAuthorityCsrRequest. - * @implements IFetchCertificateAuthorityCsrRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest=} [properties] Properties to set - */ - function FetchCertificateAuthorityCsrRequest(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]]; - } - - /** - * FetchCertificateAuthorityCsrRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest - * @instance - */ - FetchCertificateAuthorityCsrRequest.prototype.name = ""; - - /** - * Creates a new FetchCertificateAuthorityCsrRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest - * @static - * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest instance - */ - FetchCertificateAuthorityCsrRequest.create = function create(properties) { - return new FetchCertificateAuthorityCsrRequest(properties); - }; - - /** - * Encodes the specified FetchCertificateAuthorityCsrRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest - * @static - * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCertificateAuthorityCsrRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified FetchCertificateAuthorityCsrRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest - * @static - * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCertificateAuthorityCsrRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCertificateAuthorityCsrRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCertificateAuthorityCsrRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchCertificateAuthorityCsrRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchCertificateAuthorityCsrRequest.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 FetchCertificateAuthorityCsrRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest - */ - FetchCertificateAuthorityCsrRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a FetchCertificateAuthorityCsrRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest - * @static - * @param {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchCertificateAuthorityCsrRequest.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 FetchCertificateAuthorityCsrRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest - * @instance - * @returns {Object.} JSON object - */ - FetchCertificateAuthorityCsrRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchCertificateAuthorityCsrRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchCertificateAuthorityCsrRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest"; - }; - - return FetchCertificateAuthorityCsrRequest; - })(); - - v1.FetchCertificateAuthorityCsrResponse = (function() { - - /** - * Properties of a FetchCertificateAuthorityCsrResponse. - * @memberof google.cloud.security.privateca.v1 - * @interface IFetchCertificateAuthorityCsrResponse - * @property {string|null} [pemCsr] FetchCertificateAuthorityCsrResponse pemCsr - */ - - /** - * Constructs a new FetchCertificateAuthorityCsrResponse. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a FetchCertificateAuthorityCsrResponse. - * @implements IFetchCertificateAuthorityCsrResponse - * @constructor - * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse=} [properties] Properties to set - */ - function FetchCertificateAuthorityCsrResponse(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]]; - } - - /** - * FetchCertificateAuthorityCsrResponse pemCsr. - * @member {string} pemCsr - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse - * @instance - */ - FetchCertificateAuthorityCsrResponse.prototype.pemCsr = ""; - - /** - * Creates a new FetchCertificateAuthorityCsrResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse - * @static - * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse instance - */ - FetchCertificateAuthorityCsrResponse.create = function create(properties) { - return new FetchCertificateAuthorityCsrResponse(properties); - }; - - /** - * Encodes the specified FetchCertificateAuthorityCsrResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse - * @static - * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCertificateAuthorityCsrResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCsr); - return writer; - }; - - /** - * Encodes the specified FetchCertificateAuthorityCsrResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse - * @static - * @param {google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCertificateAuthorityCsrResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCertificateAuthorityCsrResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pemCsr = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCertificateAuthorityCsrResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchCertificateAuthorityCsrResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchCertificateAuthorityCsrResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - if (!$util.isString(message.pemCsr)) - return "pemCsr: string expected"; - return null; - }; - - /** - * Creates a FetchCertificateAuthorityCsrResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse - */ - FetchCertificateAuthorityCsrResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse(); - if (object.pemCsr != null) - message.pemCsr = String(object.pemCsr); - return message; - }; - - /** - * Creates a plain object from a FetchCertificateAuthorityCsrResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse - * @static - * @param {google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchCertificateAuthorityCsrResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pemCsr = ""; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - object.pemCsr = message.pemCsr; - return object; - }; - - /** - * Converts this FetchCertificateAuthorityCsrResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse - * @instance - * @returns {Object.} JSON object - */ - FetchCertificateAuthorityCsrResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchCertificateAuthorityCsrResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchCertificateAuthorityCsrResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse"; - }; - - return FetchCertificateAuthorityCsrResponse; - })(); - - v1.GetCertificateAuthorityRequest = (function() { - - /** - * Properties of a GetCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IGetCertificateAuthorityRequest - * @property {string|null} [name] GetCertificateAuthorityRequest name - */ - - /** - * Constructs a new GetCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a GetCertificateAuthorityRequest. - * @implements IGetCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest=} [properties] Properties to set - */ - function GetCertificateAuthorityRequest(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]]; - } - - /** - * GetCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest - * @instance - */ - GetCertificateAuthorityRequest.prototype.name = ""; - - /** - * Creates a new GetCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest instance - */ - GetCertificateAuthorityRequest.create = function create(properties) { - return new GetCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified GetCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest} message GetCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest} message GetCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCertificateAuthorityRequest.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 GetCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest - */ - GetCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.GetCertificateAuthorityRequest} message GetCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCertificateAuthorityRequest.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 GetCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - GetCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.GetCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.GetCertificateAuthorityRequest"; - }; - - return GetCertificateAuthorityRequest; - })(); - - v1.ListCertificateAuthoritiesRequest = (function() { - - /** - * Properties of a ListCertificateAuthoritiesRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IListCertificateAuthoritiesRequest - * @property {string|null} [parent] ListCertificateAuthoritiesRequest parent - * @property {number|null} [pageSize] ListCertificateAuthoritiesRequest pageSize - * @property {string|null} [pageToken] ListCertificateAuthoritiesRequest pageToken - * @property {string|null} [filter] ListCertificateAuthoritiesRequest filter - * @property {string|null} [orderBy] ListCertificateAuthoritiesRequest orderBy - */ - - /** - * Constructs a new ListCertificateAuthoritiesRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a ListCertificateAuthoritiesRequest. - * @implements IListCertificateAuthoritiesRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest=} [properties] Properties to set - */ - function ListCertificateAuthoritiesRequest(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]]; - } - - /** - * ListCertificateAuthoritiesRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @instance - */ - ListCertificateAuthoritiesRequest.prototype.parent = ""; - - /** - * ListCertificateAuthoritiesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @instance - */ - ListCertificateAuthoritiesRequest.prototype.pageSize = 0; - - /** - * ListCertificateAuthoritiesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @instance - */ - ListCertificateAuthoritiesRequest.prototype.pageToken = ""; - - /** - * ListCertificateAuthoritiesRequest filter. - * @member {string} filter - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @instance - */ - ListCertificateAuthoritiesRequest.prototype.filter = ""; - - /** - * ListCertificateAuthoritiesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @instance - */ - ListCertificateAuthoritiesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListCertificateAuthoritiesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest instance - */ - ListCertificateAuthoritiesRequest.create = function create(properties) { - return new ListCertificateAuthoritiesRequest(properties); - }; - - /** - * Encodes the specified ListCertificateAuthoritiesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateAuthoritiesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListCertificateAuthoritiesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateAuthoritiesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateAuthoritiesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListCertificateAuthoritiesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateAuthoritiesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificateAuthoritiesRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificateAuthoritiesRequest.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 ListCertificateAuthoritiesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest - */ - ListCertificateAuthoritiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListCertificateAuthoritiesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @static - * @param {google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificateAuthoritiesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListCertificateAuthoritiesRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @instance - * @returns {Object.} JSON object - */ - ListCertificateAuthoritiesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificateAuthoritiesRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificateAuthoritiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest"; - }; - - return ListCertificateAuthoritiesRequest; - })(); - - v1.ListCertificateAuthoritiesResponse = (function() { - - /** - * Properties of a ListCertificateAuthoritiesResponse. - * @memberof google.cloud.security.privateca.v1 - * @interface IListCertificateAuthoritiesResponse - * @property {Array.|null} [certificateAuthorities] ListCertificateAuthoritiesResponse certificateAuthorities - * @property {string|null} [nextPageToken] ListCertificateAuthoritiesResponse nextPageToken - * @property {Array.|null} [unreachable] ListCertificateAuthoritiesResponse unreachable - */ - - /** - * Constructs a new ListCertificateAuthoritiesResponse. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a ListCertificateAuthoritiesResponse. - * @implements IListCertificateAuthoritiesResponse - * @constructor - * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse=} [properties] Properties to set - */ - function ListCertificateAuthoritiesResponse(properties) { - this.certificateAuthorities = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCertificateAuthoritiesResponse certificateAuthorities. - * @member {Array.} certificateAuthorities - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @instance - */ - ListCertificateAuthoritiesResponse.prototype.certificateAuthorities = $util.emptyArray; - - /** - * ListCertificateAuthoritiesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @instance - */ - ListCertificateAuthoritiesResponse.prototype.nextPageToken = ""; - - /** - * ListCertificateAuthoritiesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @instance - */ - ListCertificateAuthoritiesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListCertificateAuthoritiesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse instance - */ - ListCertificateAuthoritiesResponse.create = function create(properties) { - return new ListCertificateAuthoritiesResponse(properties); - }; - - /** - * Encodes the specified ListCertificateAuthoritiesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateAuthoritiesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateAuthorities != null && message.certificateAuthorities.length) - for (var i = 0; i < message.certificateAuthorities.length; ++i) - $root.google.cloud.security.privateca.v1.CertificateAuthority.encode(message.certificateAuthorities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListCertificateAuthoritiesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateAuthoritiesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateAuthoritiesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.certificateAuthorities && message.certificateAuthorities.length)) - message.certificateAuthorities = []; - message.certificateAuthorities.push($root.google.cloud.security.privateca.v1.CertificateAuthority.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateAuthoritiesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificateAuthoritiesResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificateAuthoritiesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificateAuthorities != null && message.hasOwnProperty("certificateAuthorities")) { - if (!Array.isArray(message.certificateAuthorities)) - return "certificateAuthorities: array expected"; - for (var i = 0; i < message.certificateAuthorities.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.verify(message.certificateAuthorities[i]); - if (error) - return "certificateAuthorities." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListCertificateAuthoritiesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse - */ - ListCertificateAuthoritiesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse(); - if (object.certificateAuthorities) { - if (!Array.isArray(object.certificateAuthorities)) - throw TypeError(".google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.certificateAuthorities: array expected"); - message.certificateAuthorities = []; - for (var i = 0; i < object.certificateAuthorities.length; ++i) { - if (typeof object.certificateAuthorities[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.certificateAuthorities: object expected"); - message.certificateAuthorities[i] = $root.google.cloud.security.privateca.v1.CertificateAuthority.fromObject(object.certificateAuthorities[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListCertificateAuthoritiesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @static - * @param {google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificateAuthoritiesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.certificateAuthorities = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.certificateAuthorities && message.certificateAuthorities.length) { - object.certificateAuthorities = []; - for (var j = 0; j < message.certificateAuthorities.length; ++j) - object.certificateAuthorities[j] = $root.google.cloud.security.privateca.v1.CertificateAuthority.toObject(message.certificateAuthorities[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListCertificateAuthoritiesResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @instance - * @returns {Object.} JSON object - */ - ListCertificateAuthoritiesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificateAuthoritiesResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificateAuthoritiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse"; - }; - - return ListCertificateAuthoritiesResponse; - })(); - - v1.UndeleteCertificateAuthorityRequest = (function() { - - /** - * Properties of an UndeleteCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IUndeleteCertificateAuthorityRequest - * @property {string|null} [name] UndeleteCertificateAuthorityRequest name - * @property {string|null} [requestId] UndeleteCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new UndeleteCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an UndeleteCertificateAuthorityRequest. - * @implements IUndeleteCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest=} [properties] Properties to set - */ - function UndeleteCertificateAuthorityRequest(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]]; - } - - /** - * UndeleteCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @instance - */ - UndeleteCertificateAuthorityRequest.prototype.name = ""; - - /** - * UndeleteCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @instance - */ - UndeleteCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new UndeleteCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest} UndeleteCertificateAuthorityRequest instance - */ - UndeleteCertificateAuthorityRequest.create = function create(properties) { - return new UndeleteCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified UndeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest} message UndeleteCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeleteCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UndeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest} message UndeleteCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeleteCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UndeleteCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest} UndeleteCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeleteCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UndeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest} UndeleteCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeleteCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UndeleteCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UndeleteCertificateAuthorityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UndeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest} UndeleteCertificateAuthorityRequest - */ - UndeleteCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UndeleteCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest} message UndeleteCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UndeleteCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UndeleteCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - UndeleteCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UndeleteCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UndeleteCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest"; - }; - - return UndeleteCertificateAuthorityRequest; - })(); - - v1.DeleteCertificateAuthorityRequest = (function() { - - /** - * Properties of a DeleteCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IDeleteCertificateAuthorityRequest - * @property {string|null} [name] DeleteCertificateAuthorityRequest name - * @property {string|null} [requestId] DeleteCertificateAuthorityRequest requestId - * @property {boolean|null} [ignoreActiveCertificates] DeleteCertificateAuthorityRequest ignoreActiveCertificates - * @property {boolean|null} [skipGracePeriod] DeleteCertificateAuthorityRequest skipGracePeriod - * @property {boolean|null} [ignoreDependentResources] DeleteCertificateAuthorityRequest ignoreDependentResources - */ - - /** - * Constructs a new DeleteCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a DeleteCertificateAuthorityRequest. - * @implements IDeleteCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest=} [properties] Properties to set - */ - function DeleteCertificateAuthorityRequest(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]]; - } - - /** - * DeleteCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @instance - */ - DeleteCertificateAuthorityRequest.prototype.name = ""; - - /** - * DeleteCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @instance - */ - DeleteCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * DeleteCertificateAuthorityRequest ignoreActiveCertificates. - * @member {boolean} ignoreActiveCertificates - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @instance - */ - DeleteCertificateAuthorityRequest.prototype.ignoreActiveCertificates = false; - - /** - * DeleteCertificateAuthorityRequest skipGracePeriod. - * @member {boolean} skipGracePeriod - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @instance - */ - DeleteCertificateAuthorityRequest.prototype.skipGracePeriod = false; - - /** - * DeleteCertificateAuthorityRequest ignoreDependentResources. - * @member {boolean} ignoreDependentResources - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @instance - */ - DeleteCertificateAuthorityRequest.prototype.ignoreDependentResources = false; - - /** - * Creates a new DeleteCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest} DeleteCertificateAuthorityRequest instance - */ - DeleteCertificateAuthorityRequest.create = function create(properties) { - return new DeleteCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified DeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest} message DeleteCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.ignoreActiveCertificates != null && Object.hasOwnProperty.call(message, "ignoreActiveCertificates")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreActiveCertificates); - if (message.skipGracePeriod != null && Object.hasOwnProperty.call(message, "skipGracePeriod")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipGracePeriod); - if (message.ignoreDependentResources != null && Object.hasOwnProperty.call(message, "ignoreDependentResources")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.ignoreDependentResources); - return writer; - }; - - /** - * Encodes the specified DeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest} message DeleteCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest} DeleteCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 4: { - message.ignoreActiveCertificates = reader.bool(); - break; - } - case 5: { - message.skipGracePeriod = reader.bool(); - break; - } - case 6: { - message.ignoreDependentResources = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest} DeleteCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteCertificateAuthorityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.ignoreActiveCertificates != null && message.hasOwnProperty("ignoreActiveCertificates")) - if (typeof message.ignoreActiveCertificates !== "boolean") - return "ignoreActiveCertificates: boolean expected"; - if (message.skipGracePeriod != null && message.hasOwnProperty("skipGracePeriod")) - if (typeof message.skipGracePeriod !== "boolean") - return "skipGracePeriod: boolean expected"; - if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) - if (typeof message.ignoreDependentResources !== "boolean") - return "ignoreDependentResources: boolean expected"; - return null; - }; - - /** - * Creates a DeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest} DeleteCertificateAuthorityRequest - */ - DeleteCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.ignoreActiveCertificates != null) - message.ignoreActiveCertificates = Boolean(object.ignoreActiveCertificates); - if (object.skipGracePeriod != null) - message.skipGracePeriod = Boolean(object.skipGracePeriod); - if (object.ignoreDependentResources != null) - message.ignoreDependentResources = Boolean(object.ignoreDependentResources); - return message; - }; - - /** - * Creates a plain object from a DeleteCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest} message DeleteCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.ignoreActiveCertificates = false; - object.skipGracePeriod = false; - object.ignoreDependentResources = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.ignoreActiveCertificates != null && message.hasOwnProperty("ignoreActiveCertificates")) - object.ignoreActiveCertificates = message.ignoreActiveCertificates; - if (message.skipGracePeriod != null && message.hasOwnProperty("skipGracePeriod")) - object.skipGracePeriod = message.skipGracePeriod; - if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) - object.ignoreDependentResources = message.ignoreDependentResources; - return object; - }; - - /** - * Converts this DeleteCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest"; - }; - - return DeleteCertificateAuthorityRequest; - })(); - - v1.UpdateCertificateAuthorityRequest = (function() { - - /** - * Properties of an UpdateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IUpdateCertificateAuthorityRequest - * @property {google.cloud.security.privateca.v1.ICertificateAuthority|null} [certificateAuthority] UpdateCertificateAuthorityRequest certificateAuthority - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateAuthorityRequest updateMask - * @property {string|null} [requestId] UpdateCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new UpdateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an UpdateCertificateAuthorityRequest. - * @implements IUpdateCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest=} [properties] Properties to set - */ - function UpdateCertificateAuthorityRequest(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]]; - } - - /** - * UpdateCertificateAuthorityRequest certificateAuthority. - * @member {google.cloud.security.privateca.v1.ICertificateAuthority|null|undefined} certificateAuthority - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @instance - */ - UpdateCertificateAuthorityRequest.prototype.certificateAuthority = null; - - /** - * UpdateCertificateAuthorityRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @instance - */ - UpdateCertificateAuthorityRequest.prototype.updateMask = null; - - /** - * UpdateCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @instance - */ - UpdateCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest instance - */ - UpdateCertificateAuthorityRequest.create = function create(properties) { - return new UpdateCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified UpdateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) - $root.google.cloud.security.privateca.v1.CertificateAuthority.encode(message.certificateAuthority, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCertificateAuthorityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { - var error = $root.google.cloud.security.privateca.v1.CertificateAuthority.verify(message.certificateAuthority); - if (error) - return "certificateAuthority." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest - */ - UpdateCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(); - if (object.certificateAuthority != null) { - if (typeof object.certificateAuthority !== "object") - throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.certificateAuthority: object expected"); - message.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.fromObject(object.certificateAuthority); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.certificateAuthority = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) - object.certificateAuthority = $root.google.cloud.security.privateca.v1.CertificateAuthority.toObject(message.certificateAuthority, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest"; - }; - - return UpdateCertificateAuthorityRequest; - })(); - - v1.CreateCaPoolRequest = (function() { - - /** - * Properties of a CreateCaPoolRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface ICreateCaPoolRequest - * @property {string|null} [parent] CreateCaPoolRequest parent - * @property {string|null} [caPoolId] CreateCaPoolRequest caPoolId - * @property {google.cloud.security.privateca.v1.ICaPool|null} [caPool] CreateCaPoolRequest caPool - * @property {string|null} [requestId] CreateCaPoolRequest requestId - */ - - /** - * Constructs a new CreateCaPoolRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CreateCaPoolRequest. - * @implements ICreateCaPoolRequest - * @constructor - * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest=} [properties] Properties to set - */ - function CreateCaPoolRequest(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]]; - } - - /** - * CreateCaPoolRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @instance - */ - CreateCaPoolRequest.prototype.parent = ""; - - /** - * CreateCaPoolRequest caPoolId. - * @member {string} caPoolId - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @instance - */ - CreateCaPoolRequest.prototype.caPoolId = ""; - - /** - * CreateCaPoolRequest caPool. - * @member {google.cloud.security.privateca.v1.ICaPool|null|undefined} caPool - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @instance - */ - CreateCaPoolRequest.prototype.caPool = null; - - /** - * CreateCaPoolRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @instance - */ - CreateCaPoolRequest.prototype.requestId = ""; - - /** - * Creates a new CreateCaPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CreateCaPoolRequest} CreateCaPoolRequest instance - */ - CreateCaPoolRequest.create = function create(properties) { - return new CreateCaPoolRequest(properties); - }; - - /** - * Encodes the specified CreateCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCaPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest} message CreateCaPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCaPoolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.caPoolId != null && Object.hasOwnProperty.call(message, "caPoolId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.caPoolId); - if (message.caPool != null && Object.hasOwnProperty.call(message, "caPool")) - $root.google.cloud.security.privateca.v1.CaPool.encode(message.caPool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCaPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCaPoolRequest} message CreateCaPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCaPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCaPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CreateCaPoolRequest} CreateCaPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCaPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CreateCaPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.caPoolId = reader.string(); - break; - } - case 3: { - message.caPool = $root.google.cloud.security.privateca.v1.CaPool.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCaPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CreateCaPoolRequest} CreateCaPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCaPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCaPoolRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCaPoolRequest.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.caPoolId != null && message.hasOwnProperty("caPoolId")) - if (!$util.isString(message.caPoolId)) - return "caPoolId: string expected"; - if (message.caPool != null && message.hasOwnProperty("caPool")) { - var error = $root.google.cloud.security.privateca.v1.CaPool.verify(message.caPool); - if (error) - return "caPool." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateCaPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CreateCaPoolRequest} CreateCaPoolRequest - */ - CreateCaPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CreateCaPoolRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.CreateCaPoolRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.caPoolId != null) - message.caPoolId = String(object.caPoolId); - if (object.caPool != null) { - if (typeof object.caPool !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CreateCaPoolRequest.caPool: object expected"); - message.caPool = $root.google.cloud.security.privateca.v1.CaPool.fromObject(object.caPool); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateCaPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.CreateCaPoolRequest} message CreateCaPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCaPoolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.caPoolId = ""; - object.caPool = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.caPoolId != null && message.hasOwnProperty("caPoolId")) - object.caPoolId = message.caPoolId; - if (message.caPool != null && message.hasOwnProperty("caPool")) - object.caPool = $root.google.cloud.security.privateca.v1.CaPool.toObject(message.caPool, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateCaPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCaPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCaPoolRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CreateCaPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCaPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CreateCaPoolRequest"; - }; - - return CreateCaPoolRequest; - })(); - - v1.UpdateCaPoolRequest = (function() { - - /** - * Properties of an UpdateCaPoolRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IUpdateCaPoolRequest - * @property {google.cloud.security.privateca.v1.ICaPool|null} [caPool] UpdateCaPoolRequest caPool - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCaPoolRequest updateMask - * @property {string|null} [requestId] UpdateCaPoolRequest requestId - */ - - /** - * Constructs a new UpdateCaPoolRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an UpdateCaPoolRequest. - * @implements IUpdateCaPoolRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest=} [properties] Properties to set - */ - function UpdateCaPoolRequest(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]]; - } - - /** - * UpdateCaPoolRequest caPool. - * @member {google.cloud.security.privateca.v1.ICaPool|null|undefined} caPool - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @instance - */ - UpdateCaPoolRequest.prototype.caPool = null; - - /** - * UpdateCaPoolRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @instance - */ - UpdateCaPoolRequest.prototype.updateMask = null; - - /** - * UpdateCaPoolRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @instance - */ - UpdateCaPoolRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateCaPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.UpdateCaPoolRequest} UpdateCaPoolRequest instance - */ - UpdateCaPoolRequest.create = function create(properties) { - return new UpdateCaPoolRequest(properties); - }; - - /** - * Encodes the specified UpdateCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCaPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest} message UpdateCaPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCaPoolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.caPool != null && Object.hasOwnProperty.call(message, "caPool")) - $root.google.cloud.security.privateca.v1.CaPool.encode(message.caPool, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCaPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCaPoolRequest} message UpdateCaPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCaPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCaPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.UpdateCaPoolRequest} UpdateCaPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCaPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UpdateCaPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.caPool = $root.google.cloud.security.privateca.v1.CaPool.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCaPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.UpdateCaPoolRequest} UpdateCaPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCaPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCaPoolRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCaPoolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.caPool != null && message.hasOwnProperty("caPool")) { - var error = $root.google.cloud.security.privateca.v1.CaPool.verify(message.caPool); - if (error) - return "caPool." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateCaPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.UpdateCaPoolRequest} UpdateCaPoolRequest - */ - UpdateCaPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.UpdateCaPoolRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.UpdateCaPoolRequest(); - if (object.caPool != null) { - if (typeof object.caPool !== "object") - throw TypeError(".google.cloud.security.privateca.v1.UpdateCaPoolRequest.caPool: object expected"); - message.caPool = $root.google.cloud.security.privateca.v1.CaPool.fromObject(object.caPool); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.security.privateca.v1.UpdateCaPoolRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateCaPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.UpdateCaPoolRequest} message UpdateCaPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCaPoolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.caPool = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.caPool != null && message.hasOwnProperty("caPool")) - object.caPool = $root.google.cloud.security.privateca.v1.CaPool.toObject(message.caPool, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateCaPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCaPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCaPoolRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.UpdateCaPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCaPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.UpdateCaPoolRequest"; - }; - - return UpdateCaPoolRequest; - })(); - - v1.DeleteCaPoolRequest = (function() { - - /** - * Properties of a DeleteCaPoolRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IDeleteCaPoolRequest - * @property {string|null} [name] DeleteCaPoolRequest name - * @property {string|null} [requestId] DeleteCaPoolRequest requestId - * @property {boolean|null} [ignoreDependentResources] DeleteCaPoolRequest ignoreDependentResources - */ - - /** - * Constructs a new DeleteCaPoolRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a DeleteCaPoolRequest. - * @implements IDeleteCaPoolRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest=} [properties] Properties to set - */ - function DeleteCaPoolRequest(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]]; - } - - /** - * DeleteCaPoolRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @instance - */ - DeleteCaPoolRequest.prototype.name = ""; - - /** - * DeleteCaPoolRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @instance - */ - DeleteCaPoolRequest.prototype.requestId = ""; - - /** - * DeleteCaPoolRequest ignoreDependentResources. - * @member {boolean} ignoreDependentResources - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @instance - */ - DeleteCaPoolRequest.prototype.ignoreDependentResources = false; - - /** - * Creates a new DeleteCaPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.DeleteCaPoolRequest} DeleteCaPoolRequest instance - */ - DeleteCaPoolRequest.create = function create(properties) { - return new DeleteCaPoolRequest(properties); - }; - - /** - * Encodes the specified DeleteCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCaPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest} message DeleteCaPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteCaPoolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.ignoreDependentResources != null && Object.hasOwnProperty.call(message, "ignoreDependentResources")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreDependentResources); - return writer; - }; - - /** - * Encodes the specified DeleteCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCaPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.IDeleteCaPoolRequest} message DeleteCaPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteCaPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteCaPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.DeleteCaPoolRequest} DeleteCaPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteCaPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.DeleteCaPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 4: { - message.ignoreDependentResources = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteCaPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.DeleteCaPoolRequest} DeleteCaPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteCaPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteCaPoolRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteCaPoolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) - if (typeof message.ignoreDependentResources !== "boolean") - return "ignoreDependentResources: boolean expected"; - return null; - }; - - /** - * Creates a DeleteCaPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.DeleteCaPoolRequest} DeleteCaPoolRequest - */ - DeleteCaPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.DeleteCaPoolRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.DeleteCaPoolRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.ignoreDependentResources != null) - message.ignoreDependentResources = Boolean(object.ignoreDependentResources); - return message; - }; - - /** - * Creates a plain object from a DeleteCaPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.DeleteCaPoolRequest} message DeleteCaPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteCaPoolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.ignoreDependentResources = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) - object.ignoreDependentResources = message.ignoreDependentResources; - return object; - }; - - /** - * Converts this DeleteCaPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteCaPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteCaPoolRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteCaPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.DeleteCaPoolRequest"; - }; - - return DeleteCaPoolRequest; - })(); - - v1.FetchCaCertsRequest = (function() { - - /** - * Properties of a FetchCaCertsRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IFetchCaCertsRequest - * @property {string|null} [caPool] FetchCaCertsRequest caPool - * @property {string|null} [requestId] FetchCaCertsRequest requestId - */ - - /** - * Constructs a new FetchCaCertsRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a FetchCaCertsRequest. - * @implements IFetchCaCertsRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest=} [properties] Properties to set - */ - function FetchCaCertsRequest(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]]; - } - - /** - * FetchCaCertsRequest caPool. - * @member {string} caPool - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @instance - */ - FetchCaCertsRequest.prototype.caPool = ""; - - /** - * FetchCaCertsRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @instance - */ - FetchCaCertsRequest.prototype.requestId = ""; - - /** - * Creates a new FetchCaCertsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @static - * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.FetchCaCertsRequest} FetchCaCertsRequest instance - */ - FetchCaCertsRequest.create = function create(properties) { - return new FetchCaCertsRequest(properties); - }; - - /** - * Encodes the specified FetchCaCertsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @static - * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest} message FetchCaCertsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCaCertsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.caPool != null && Object.hasOwnProperty.call(message, "caPool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.caPool); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified FetchCaCertsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @static - * @param {google.cloud.security.privateca.v1.IFetchCaCertsRequest} message FetchCaCertsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCaCertsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchCaCertsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.FetchCaCertsRequest} FetchCaCertsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCaCertsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.FetchCaCertsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.caPool = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchCaCertsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.FetchCaCertsRequest} FetchCaCertsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCaCertsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchCaCertsRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchCaCertsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.caPool != null && message.hasOwnProperty("caPool")) - if (!$util.isString(message.caPool)) - return "caPool: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a FetchCaCertsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.FetchCaCertsRequest} FetchCaCertsRequest - */ - FetchCaCertsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.FetchCaCertsRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.FetchCaCertsRequest(); - if (object.caPool != null) - message.caPool = String(object.caPool); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a FetchCaCertsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @static - * @param {google.cloud.security.privateca.v1.FetchCaCertsRequest} message FetchCaCertsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchCaCertsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.caPool = ""; - object.requestId = ""; - } - if (message.caPool != null && message.hasOwnProperty("caPool")) - object.caPool = message.caPool; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this FetchCaCertsRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @instance - * @returns {Object.} JSON object - */ - FetchCaCertsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchCaCertsRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.FetchCaCertsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchCaCertsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.FetchCaCertsRequest"; - }; - - return FetchCaCertsRequest; - })(); - - v1.FetchCaCertsResponse = (function() { - - /** - * Properties of a FetchCaCertsResponse. - * @memberof google.cloud.security.privateca.v1 - * @interface IFetchCaCertsResponse - * @property {Array.|null} [caCerts] FetchCaCertsResponse caCerts - */ - - /** - * Constructs a new FetchCaCertsResponse. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a FetchCaCertsResponse. - * @implements IFetchCaCertsResponse - * @constructor - * @param {google.cloud.security.privateca.v1.IFetchCaCertsResponse=} [properties] Properties to set - */ - function FetchCaCertsResponse(properties) { - this.caCerts = []; - 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]]; - } - - /** - * FetchCaCertsResponse caCerts. - * @member {Array.} caCerts - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @instance - */ - FetchCaCertsResponse.prototype.caCerts = $util.emptyArray; - - /** - * Creates a new FetchCaCertsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @static - * @param {google.cloud.security.privateca.v1.IFetchCaCertsResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse} FetchCaCertsResponse instance - */ - FetchCaCertsResponse.create = function create(properties) { - return new FetchCaCertsResponse(properties); - }; - - /** - * Encodes the specified FetchCaCertsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @static - * @param {google.cloud.security.privateca.v1.IFetchCaCertsResponse} message FetchCaCertsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCaCertsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.caCerts != null && message.caCerts.length) - for (var i = 0; i < message.caCerts.length; ++i) - $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FetchCaCertsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @static - * @param {google.cloud.security.privateca.v1.IFetchCaCertsResponse} message FetchCaCertsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCaCertsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchCaCertsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse} FetchCaCertsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCaCertsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.FetchCaCertsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.caCerts && message.caCerts.length)) - message.caCerts = []; - message.caCerts.push($root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchCaCertsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse} FetchCaCertsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCaCertsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchCaCertsResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchCaCertsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.caCerts != null && message.hasOwnProperty("caCerts")) { - if (!Array.isArray(message.caCerts)) - return "caCerts: array expected"; - for (var i = 0; i < message.caCerts.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.verify(message.caCerts[i]); - if (error) - return "caCerts." + error; - } - } - return null; - }; - - /** - * Creates a FetchCaCertsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse} FetchCaCertsResponse - */ - FetchCaCertsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.FetchCaCertsResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1.FetchCaCertsResponse(); - if (object.caCerts) { - if (!Array.isArray(object.caCerts)) - throw TypeError(".google.cloud.security.privateca.v1.FetchCaCertsResponse.caCerts: array expected"); - message.caCerts = []; - for (var i = 0; i < object.caCerts.length; ++i) { - if (typeof object.caCerts[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.FetchCaCertsResponse.caCerts: object expected"); - message.caCerts[i] = $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.fromObject(object.caCerts[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FetchCaCertsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @static - * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse} message FetchCaCertsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchCaCertsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.caCerts = []; - if (message.caCerts && message.caCerts.length) { - object.caCerts = []; - for (var j = 0; j < message.caCerts.length; ++j) - object.caCerts[j] = $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.toObject(message.caCerts[j], options); - } - return object; - }; - - /** - * Converts this FetchCaCertsResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @instance - * @returns {Object.} JSON object - */ - FetchCaCertsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchCaCertsResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchCaCertsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.FetchCaCertsResponse"; - }; - - FetchCaCertsResponse.CertChain = (function() { - - /** - * Properties of a CertChain. - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @interface ICertChain - * @property {Array.|null} [certificates] CertChain certificates - */ - - /** - * Constructs a new CertChain. - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse - * @classdesc Represents a CertChain. - * @implements ICertChain - * @constructor - * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain=} [properties] Properties to set - */ - function CertChain(properties) { - this.certificates = []; - 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]]; - } - - /** - * CertChain certificates. - * @member {Array.} certificates - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain - * @instance - */ - CertChain.prototype.certificates = $util.emptyArray; - - /** - * Creates a new CertChain instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain - * @static - * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain} CertChain instance - */ - CertChain.create = function create(properties) { - return new CertChain(properties); - }; - - /** - * Encodes the specified CertChain message. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain - * @static - * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain} message CertChain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertChain.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificates != null && message.certificates.length) - for (var i = 0; i < message.certificates.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificates[i]); - return writer; - }; - - /** - * Encodes the specified CertChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain - * @static - * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse.ICertChain} message CertChain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertChain.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertChain message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain} CertChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertChain.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.certificates && message.certificates.length)) - message.certificates = []; - message.certificates.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertChain message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain} CertChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertChain.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertChain message. - * @function verify - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertChain.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificates != null && message.hasOwnProperty("certificates")) { - if (!Array.isArray(message.certificates)) - return "certificates: array expected"; - for (var i = 0; i < message.certificates.length; ++i) - if (!$util.isString(message.certificates[i])) - return "certificates: string[] expected"; - } - return null; - }; - - /** - * Creates a CertChain message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain} CertChain - */ - CertChain.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain) - return object; - var message = new $root.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain(); - if (object.certificates) { - if (!Array.isArray(object.certificates)) - throw TypeError(".google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain.certificates: array expected"); - message.certificates = []; - for (var i = 0; i < object.certificates.length; ++i) - message.certificates[i] = String(object.certificates[i]); - } - return message; - }; - - /** - * Creates a plain object from a CertChain message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain - * @static - * @param {google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain} message CertChain - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertChain.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.certificates = []; - if (message.certificates && message.certificates.length) { - object.certificates = []; - for (var j = 0; j < message.certificates.length; ++j) - object.certificates[j] = message.certificates[j]; - } - return object; - }; - - /** - * Converts this CertChain to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain - * @instance - * @returns {Object.} JSON object - */ - CertChain.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertChain - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertChain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain"; - }; - - return CertChain; - })(); - - return FetchCaCertsResponse; - })(); - - v1.GetCaPoolRequest = (function() { - - /** - * Properties of a GetCaPoolRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IGetCaPoolRequest - * @property {string|null} [name] GetCaPoolRequest name - */ - - /** - * Constructs a new GetCaPoolRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a GetCaPoolRequest. - * @implements IGetCaPoolRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest=} [properties] Properties to set - */ - function GetCaPoolRequest(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]]; - } - - /** - * GetCaPoolRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest - * @instance - */ - GetCaPoolRequest.prototype.name = ""; - - /** - * Creates a new GetCaPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.GetCaPoolRequest} GetCaPoolRequest instance - */ - GetCaPoolRequest.create = function create(properties) { - return new GetCaPoolRequest(properties); - }; - - /** - * Encodes the specified GetCaPoolRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCaPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest} message GetCaPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCaPoolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetCaPoolRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCaPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCaPoolRequest} message GetCaPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCaPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCaPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.GetCaPoolRequest} GetCaPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCaPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.GetCaPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCaPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.GetCaPoolRequest} GetCaPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCaPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCaPoolRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCaPoolRequest.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 GetCaPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.GetCaPoolRequest} GetCaPoolRequest - */ - GetCaPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.GetCaPoolRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.GetCaPoolRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetCaPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest - * @static - * @param {google.cloud.security.privateca.v1.GetCaPoolRequest} message GetCaPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCaPoolRequest.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 GetCaPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest - * @instance - * @returns {Object.} JSON object - */ - GetCaPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCaPoolRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.GetCaPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCaPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.GetCaPoolRequest"; - }; - - return GetCaPoolRequest; - })(); - - v1.ListCaPoolsRequest = (function() { - - /** - * Properties of a ListCaPoolsRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IListCaPoolsRequest - * @property {string|null} [parent] ListCaPoolsRequest parent - * @property {number|null} [pageSize] ListCaPoolsRequest pageSize - * @property {string|null} [pageToken] ListCaPoolsRequest pageToken - * @property {string|null} [filter] ListCaPoolsRequest filter - * @property {string|null} [orderBy] ListCaPoolsRequest orderBy - */ - - /** - * Constructs a new ListCaPoolsRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a ListCaPoolsRequest. - * @implements IListCaPoolsRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest=} [properties] Properties to set - */ - function ListCaPoolsRequest(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]]; - } - - /** - * ListCaPoolsRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @instance - */ - ListCaPoolsRequest.prototype.parent = ""; - - /** - * ListCaPoolsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @instance - */ - ListCaPoolsRequest.prototype.pageSize = 0; - - /** - * ListCaPoolsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @instance - */ - ListCaPoolsRequest.prototype.pageToken = ""; - - /** - * ListCaPoolsRequest filter. - * @member {string} filter - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @instance - */ - ListCaPoolsRequest.prototype.filter = ""; - - /** - * ListCaPoolsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @instance - */ - ListCaPoolsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListCaPoolsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ListCaPoolsRequest} ListCaPoolsRequest instance - */ - ListCaPoolsRequest.create = function create(properties) { - return new ListCaPoolsRequest(properties); - }; - - /** - * Encodes the specified ListCaPoolsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest} message ListCaPoolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCaPoolsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListCaPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCaPoolsRequest} message ListCaPoolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCaPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCaPoolsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ListCaPoolsRequest} ListCaPoolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCaPoolsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCaPoolsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListCaPoolsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ListCaPoolsRequest} ListCaPoolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCaPoolsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCaPoolsRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCaPoolsRequest.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 ListCaPoolsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ListCaPoolsRequest} ListCaPoolsRequest - */ - ListCaPoolsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ListCaPoolsRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.ListCaPoolsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListCaPoolsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @static - * @param {google.cloud.security.privateca.v1.ListCaPoolsRequest} message ListCaPoolsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCaPoolsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListCaPoolsRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @instance - * @returns {Object.} JSON object - */ - ListCaPoolsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCaPoolsRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ListCaPoolsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCaPoolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCaPoolsRequest"; - }; - - return ListCaPoolsRequest; - })(); - - v1.ListCaPoolsResponse = (function() { - - /** - * Properties of a ListCaPoolsResponse. - * @memberof google.cloud.security.privateca.v1 - * @interface IListCaPoolsResponse - * @property {Array.|null} [caPools] ListCaPoolsResponse caPools - * @property {string|null} [nextPageToken] ListCaPoolsResponse nextPageToken - * @property {Array.|null} [unreachable] ListCaPoolsResponse unreachable - */ - - /** - * Constructs a new ListCaPoolsResponse. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a ListCaPoolsResponse. - * @implements IListCaPoolsResponse - * @constructor - * @param {google.cloud.security.privateca.v1.IListCaPoolsResponse=} [properties] Properties to set - */ - function ListCaPoolsResponse(properties) { - this.caPools = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCaPoolsResponse caPools. - * @member {Array.} caPools - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @instance - */ - ListCaPoolsResponse.prototype.caPools = $util.emptyArray; - - /** - * ListCaPoolsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @instance - */ - ListCaPoolsResponse.prototype.nextPageToken = ""; - - /** - * ListCaPoolsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @instance - */ - ListCaPoolsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListCaPoolsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCaPoolsResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ListCaPoolsResponse} ListCaPoolsResponse instance - */ - ListCaPoolsResponse.create = function create(properties) { - return new ListCaPoolsResponse(properties); - }; - - /** - * Encodes the specified ListCaPoolsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCaPoolsResponse} message ListCaPoolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCaPoolsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.caPools != null && message.caPools.length) - for (var i = 0; i < message.caPools.length; ++i) - $root.google.cloud.security.privateca.v1.CaPool.encode(message.caPools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListCaPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCaPoolsResponse} message ListCaPoolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCaPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCaPoolsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ListCaPoolsResponse} ListCaPoolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCaPoolsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCaPoolsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.caPools && message.caPools.length)) - message.caPools = []; - message.caPools.push($root.google.cloud.security.privateca.v1.CaPool.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCaPoolsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ListCaPoolsResponse} ListCaPoolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCaPoolsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCaPoolsResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCaPoolsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.caPools != null && message.hasOwnProperty("caPools")) { - if (!Array.isArray(message.caPools)) - return "caPools: array expected"; - for (var i = 0; i < message.caPools.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.CaPool.verify(message.caPools[i]); - if (error) - return "caPools." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListCaPoolsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ListCaPoolsResponse} ListCaPoolsResponse - */ - ListCaPoolsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ListCaPoolsResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1.ListCaPoolsResponse(); - if (object.caPools) { - if (!Array.isArray(object.caPools)) - throw TypeError(".google.cloud.security.privateca.v1.ListCaPoolsResponse.caPools: array expected"); - message.caPools = []; - for (var i = 0; i < object.caPools.length; ++i) { - if (typeof object.caPools[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.ListCaPoolsResponse.caPools: object expected"); - message.caPools[i] = $root.google.cloud.security.privateca.v1.CaPool.fromObject(object.caPools[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.security.privateca.v1.ListCaPoolsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListCaPoolsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @static - * @param {google.cloud.security.privateca.v1.ListCaPoolsResponse} message ListCaPoolsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCaPoolsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.caPools = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.caPools && message.caPools.length) { - object.caPools = []; - for (var j = 0; j < message.caPools.length; ++j) - object.caPools[j] = $root.google.cloud.security.privateca.v1.CaPool.toObject(message.caPools[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListCaPoolsResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @instance - * @returns {Object.} JSON object - */ - ListCaPoolsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCaPoolsResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ListCaPoolsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCaPoolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCaPoolsResponse"; - }; - - return ListCaPoolsResponse; - })(); - - v1.GetCertificateRevocationListRequest = (function() { - - /** - * Properties of a GetCertificateRevocationListRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IGetCertificateRevocationListRequest - * @property {string|null} [name] GetCertificateRevocationListRequest name - */ - - /** - * Constructs a new GetCertificateRevocationListRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a GetCertificateRevocationListRequest. - * @implements IGetCertificateRevocationListRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest=} [properties] Properties to set - */ - function GetCertificateRevocationListRequest(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]]; - } - - /** - * GetCertificateRevocationListRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest - * @instance - */ - GetCertificateRevocationListRequest.prototype.name = ""; - - /** - * Creates a new GetCertificateRevocationListRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest instance - */ - GetCertificateRevocationListRequest.create = function create(properties) { - return new GetCertificateRevocationListRequest(properties); - }; - - /** - * Encodes the specified GetCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRevocationListRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest} message GetCertificateRevocationListRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateRevocationListRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateRevocationListRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest} message GetCertificateRevocationListRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateRevocationListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateRevocationListRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateRevocationListRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCertificateRevocationListRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCertificateRevocationListRequest.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 GetCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest - */ - GetCertificateRevocationListRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetCertificateRevocationListRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1.GetCertificateRevocationListRequest} message GetCertificateRevocationListRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCertificateRevocationListRequest.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 GetCertificateRevocationListRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest - * @instance - * @returns {Object.} JSON object - */ - GetCertificateRevocationListRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCertificateRevocationListRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.GetCertificateRevocationListRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCertificateRevocationListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.GetCertificateRevocationListRequest"; - }; - - return GetCertificateRevocationListRequest; - })(); - - v1.ListCertificateRevocationListsRequest = (function() { - - /** - * Properties of a ListCertificateRevocationListsRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IListCertificateRevocationListsRequest - * @property {string|null} [parent] ListCertificateRevocationListsRequest parent - * @property {number|null} [pageSize] ListCertificateRevocationListsRequest pageSize - * @property {string|null} [pageToken] ListCertificateRevocationListsRequest pageToken - * @property {string|null} [filter] ListCertificateRevocationListsRequest filter - * @property {string|null} [orderBy] ListCertificateRevocationListsRequest orderBy - */ - - /** - * Constructs a new ListCertificateRevocationListsRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a ListCertificateRevocationListsRequest. - * @implements IListCertificateRevocationListsRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest=} [properties] Properties to set - */ - function ListCertificateRevocationListsRequest(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]]; - } - - /** - * ListCertificateRevocationListsRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @instance - */ - ListCertificateRevocationListsRequest.prototype.parent = ""; - - /** - * ListCertificateRevocationListsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @instance - */ - ListCertificateRevocationListsRequest.prototype.pageSize = 0; - - /** - * ListCertificateRevocationListsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @instance - */ - ListCertificateRevocationListsRequest.prototype.pageToken = ""; - - /** - * ListCertificateRevocationListsRequest filter. - * @member {string} filter - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @instance - */ - ListCertificateRevocationListsRequest.prototype.filter = ""; - - /** - * ListCertificateRevocationListsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @instance - */ - ListCertificateRevocationListsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListCertificateRevocationListsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest instance - */ - ListCertificateRevocationListsRequest.create = function create(properties) { - return new ListCertificateRevocationListsRequest(properties); - }; - - /** - * Encodes the specified ListCertificateRevocationListsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateRevocationListsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListCertificateRevocationListsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateRevocationListsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateRevocationListsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListCertificateRevocationListsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateRevocationListsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificateRevocationListsRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificateRevocationListsRequest.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 ListCertificateRevocationListsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest - */ - ListCertificateRevocationListsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListCertificateRevocationListsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @static - * @param {google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificateRevocationListsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListCertificateRevocationListsRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @instance - * @returns {Object.} JSON object - */ - ListCertificateRevocationListsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificateRevocationListsRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificateRevocationListsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest"; - }; - - return ListCertificateRevocationListsRequest; - })(); - - v1.ListCertificateRevocationListsResponse = (function() { - - /** - * Properties of a ListCertificateRevocationListsResponse. - * @memberof google.cloud.security.privateca.v1 - * @interface IListCertificateRevocationListsResponse - * @property {Array.|null} [certificateRevocationLists] ListCertificateRevocationListsResponse certificateRevocationLists - * @property {string|null} [nextPageToken] ListCertificateRevocationListsResponse nextPageToken - * @property {Array.|null} [unreachable] ListCertificateRevocationListsResponse unreachable - */ - - /** - * Constructs a new ListCertificateRevocationListsResponse. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a ListCertificateRevocationListsResponse. - * @implements IListCertificateRevocationListsResponse - * @constructor - * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse=} [properties] Properties to set - */ - function ListCertificateRevocationListsResponse(properties) { - this.certificateRevocationLists = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCertificateRevocationListsResponse certificateRevocationLists. - * @member {Array.} certificateRevocationLists - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @instance - */ - ListCertificateRevocationListsResponse.prototype.certificateRevocationLists = $util.emptyArray; - - /** - * ListCertificateRevocationListsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @instance - */ - ListCertificateRevocationListsResponse.prototype.nextPageToken = ""; - - /** - * ListCertificateRevocationListsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @instance - */ - ListCertificateRevocationListsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListCertificateRevocationListsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse instance - */ - ListCertificateRevocationListsResponse.create = function create(properties) { - return new ListCertificateRevocationListsResponse(properties); - }; - - /** - * Encodes the specified ListCertificateRevocationListsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateRevocationListsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateRevocationLists != null && message.certificateRevocationLists.length) - for (var i = 0; i < message.certificateRevocationLists.length; ++i) - $root.google.cloud.security.privateca.v1.CertificateRevocationList.encode(message.certificateRevocationLists[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListCertificateRevocationListsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateRevocationListsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateRevocationListsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.certificateRevocationLists && message.certificateRevocationLists.length)) - message.certificateRevocationLists = []; - message.certificateRevocationLists.push($root.google.cloud.security.privateca.v1.CertificateRevocationList.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateRevocationListsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificateRevocationListsResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificateRevocationListsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificateRevocationLists != null && message.hasOwnProperty("certificateRevocationLists")) { - if (!Array.isArray(message.certificateRevocationLists)) - return "certificateRevocationLists: array expected"; - for (var i = 0; i < message.certificateRevocationLists.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.CertificateRevocationList.verify(message.certificateRevocationLists[i]); - if (error) - return "certificateRevocationLists." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListCertificateRevocationListsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse - */ - ListCertificateRevocationListsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse(); - if (object.certificateRevocationLists) { - if (!Array.isArray(object.certificateRevocationLists)) - throw TypeError(".google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.certificateRevocationLists: array expected"); - message.certificateRevocationLists = []; - for (var i = 0; i < object.certificateRevocationLists.length; ++i) { - if (typeof object.certificateRevocationLists[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.certificateRevocationLists: object expected"); - message.certificateRevocationLists[i] = $root.google.cloud.security.privateca.v1.CertificateRevocationList.fromObject(object.certificateRevocationLists[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListCertificateRevocationListsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @static - * @param {google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificateRevocationListsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.certificateRevocationLists = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.certificateRevocationLists && message.certificateRevocationLists.length) { - object.certificateRevocationLists = []; - for (var j = 0; j < message.certificateRevocationLists.length; ++j) - object.certificateRevocationLists[j] = $root.google.cloud.security.privateca.v1.CertificateRevocationList.toObject(message.certificateRevocationLists[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListCertificateRevocationListsResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @instance - * @returns {Object.} JSON object - */ - ListCertificateRevocationListsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificateRevocationListsResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificateRevocationListsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse"; - }; - - return ListCertificateRevocationListsResponse; - })(); - - v1.UpdateCertificateRevocationListRequest = (function() { - - /** - * Properties of an UpdateCertificateRevocationListRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IUpdateCertificateRevocationListRequest - * @property {google.cloud.security.privateca.v1.ICertificateRevocationList|null} [certificateRevocationList] UpdateCertificateRevocationListRequest certificateRevocationList - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateRevocationListRequest updateMask - * @property {string|null} [requestId] UpdateCertificateRevocationListRequest requestId - */ - - /** - * Constructs a new UpdateCertificateRevocationListRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an UpdateCertificateRevocationListRequest. - * @implements IUpdateCertificateRevocationListRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest=} [properties] Properties to set - */ - function UpdateCertificateRevocationListRequest(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]]; - } - - /** - * UpdateCertificateRevocationListRequest certificateRevocationList. - * @member {google.cloud.security.privateca.v1.ICertificateRevocationList|null|undefined} certificateRevocationList - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @instance - */ - UpdateCertificateRevocationListRequest.prototype.certificateRevocationList = null; - - /** - * UpdateCertificateRevocationListRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @instance - */ - UpdateCertificateRevocationListRequest.prototype.updateMask = null; - - /** - * UpdateCertificateRevocationListRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @instance - */ - UpdateCertificateRevocationListRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateCertificateRevocationListRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest instance - */ - UpdateCertificateRevocationListRequest.create = function create(properties) { - return new UpdateCertificateRevocationListRequest(properties); - }; - - /** - * Encodes the specified UpdateCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateRevocationListRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateRevocationList != null && Object.hasOwnProperty.call(message, "certificateRevocationList")) - $root.google.cloud.security.privateca.v1.CertificateRevocationList.encode(message.certificateRevocationList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateRevocationListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateRevocationListRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.certificateRevocationList = $root.google.cloud.security.privateca.v1.CertificateRevocationList.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateRevocationListRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCertificateRevocationListRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCertificateRevocationListRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificateRevocationList != null && message.hasOwnProperty("certificateRevocationList")) { - var error = $root.google.cloud.security.privateca.v1.CertificateRevocationList.verify(message.certificateRevocationList); - if (error) - return "certificateRevocationList." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest - */ - UpdateCertificateRevocationListRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(); - if (object.certificateRevocationList != null) { - if (typeof object.certificateRevocationList !== "object") - throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.certificateRevocationList: object expected"); - message.certificateRevocationList = $root.google.cloud.security.privateca.v1.CertificateRevocationList.fromObject(object.certificateRevocationList); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateCertificateRevocationListRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCertificateRevocationListRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.certificateRevocationList = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.certificateRevocationList != null && message.hasOwnProperty("certificateRevocationList")) - object.certificateRevocationList = $root.google.cloud.security.privateca.v1.CertificateRevocationList.toObject(message.certificateRevocationList, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateCertificateRevocationListRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCertificateRevocationListRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCertificateRevocationListRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCertificateRevocationListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest"; - }; - - return UpdateCertificateRevocationListRequest; - })(); - - v1.CreateCertificateTemplateRequest = (function() { - - /** - * Properties of a CreateCertificateTemplateRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface ICreateCertificateTemplateRequest - * @property {string|null} [parent] CreateCertificateTemplateRequest parent - * @property {string|null} [certificateTemplateId] CreateCertificateTemplateRequest certificateTemplateId - * @property {google.cloud.security.privateca.v1.ICertificateTemplate|null} [certificateTemplate] CreateCertificateTemplateRequest certificateTemplate - * @property {string|null} [requestId] CreateCertificateTemplateRequest requestId - */ - - /** - * Constructs a new CreateCertificateTemplateRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a CreateCertificateTemplateRequest. - * @implements ICreateCertificateTemplateRequest - * @constructor - * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest=} [properties] Properties to set - */ - function CreateCertificateTemplateRequest(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]]; - } - - /** - * CreateCertificateTemplateRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @instance - */ - CreateCertificateTemplateRequest.prototype.parent = ""; - - /** - * CreateCertificateTemplateRequest certificateTemplateId. - * @member {string} certificateTemplateId - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @instance - */ - CreateCertificateTemplateRequest.prototype.certificateTemplateId = ""; - - /** - * CreateCertificateTemplateRequest certificateTemplate. - * @member {google.cloud.security.privateca.v1.ICertificateTemplate|null|undefined} certificateTemplate - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @instance - */ - CreateCertificateTemplateRequest.prototype.certificateTemplate = null; - - /** - * CreateCertificateTemplateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @instance - */ - CreateCertificateTemplateRequest.prototype.requestId = ""; - - /** - * Creates a new CreateCertificateTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.CreateCertificateTemplateRequest} CreateCertificateTemplateRequest instance - */ - CreateCertificateTemplateRequest.create = function create(properties) { - return new CreateCertificateTemplateRequest(properties); - }; - - /** - * Encodes the specified CreateCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest} message CreateCertificateTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCertificateTemplateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.certificateTemplateId != null && Object.hasOwnProperty.call(message, "certificateTemplateId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateTemplateId); - if (message.certificateTemplate != null && Object.hasOwnProperty.call(message, "certificateTemplate")) - $root.google.cloud.security.privateca.v1.CertificateTemplate.encode(message.certificateTemplate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.CreateCertificateTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest} message CreateCertificateTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCertificateTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCertificateTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.CreateCertificateTemplateRequest} CreateCertificateTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCertificateTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.certificateTemplateId = reader.string(); - break; - } - case 3: { - message.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCertificateTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.CreateCertificateTemplateRequest} CreateCertificateTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCertificateTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCertificateTemplateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCertificateTemplateRequest.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.certificateTemplateId != null && message.hasOwnProperty("certificateTemplateId")) - if (!$util.isString(message.certificateTemplateId)) - return "certificateTemplateId: string expected"; - if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) { - var error = $root.google.cloud.security.privateca.v1.CertificateTemplate.verify(message.certificateTemplate); - if (error) - return "certificateTemplate." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.CreateCertificateTemplateRequest} CreateCertificateTemplateRequest - */ - CreateCertificateTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.certificateTemplateId != null) - message.certificateTemplateId = String(object.certificateTemplateId); - if (object.certificateTemplate != null) { - if (typeof object.certificateTemplate !== "object") - throw TypeError(".google.cloud.security.privateca.v1.CreateCertificateTemplateRequest.certificateTemplate: object expected"); - message.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.fromObject(object.certificateTemplate); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateCertificateTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.CreateCertificateTemplateRequest} message CreateCertificateTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCertificateTemplateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.certificateTemplateId = ""; - object.certificateTemplate = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.certificateTemplateId != null && message.hasOwnProperty("certificateTemplateId")) - object.certificateTemplateId = message.certificateTemplateId; - if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) - object.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.toObject(message.certificateTemplate, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateCertificateTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCertificateTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCertificateTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.CreateCertificateTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCertificateTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.CreateCertificateTemplateRequest"; - }; - - return CreateCertificateTemplateRequest; - })(); - - v1.DeleteCertificateTemplateRequest = (function() { - - /** - * Properties of a DeleteCertificateTemplateRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IDeleteCertificateTemplateRequest - * @property {string|null} [name] DeleteCertificateTemplateRequest name - * @property {string|null} [requestId] DeleteCertificateTemplateRequest requestId - */ - - /** - * Constructs a new DeleteCertificateTemplateRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a DeleteCertificateTemplateRequest. - * @implements IDeleteCertificateTemplateRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest=} [properties] Properties to set - */ - function DeleteCertificateTemplateRequest(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]]; - } - - /** - * DeleteCertificateTemplateRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @instance - */ - DeleteCertificateTemplateRequest.prototype.name = ""; - - /** - * DeleteCertificateTemplateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @instance - */ - DeleteCertificateTemplateRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteCertificateTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest} DeleteCertificateTemplateRequest instance - */ - DeleteCertificateTemplateRequest.create = function create(properties) { - return new DeleteCertificateTemplateRequest(properties); - }; - - /** - * Encodes the specified DeleteCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest} message DeleteCertificateTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteCertificateTemplateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified DeleteCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest} message DeleteCertificateTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteCertificateTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteCertificateTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest} DeleteCertificateTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteCertificateTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteCertificateTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest} DeleteCertificateTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteCertificateTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteCertificateTemplateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteCertificateTemplateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a DeleteCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest} DeleteCertificateTemplateRequest - */ - DeleteCertificateTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a DeleteCertificateTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest} message DeleteCertificateTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteCertificateTemplateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this DeleteCertificateTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteCertificateTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteCertificateTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteCertificateTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest"; - }; - - return DeleteCertificateTemplateRequest; - })(); - - v1.GetCertificateTemplateRequest = (function() { - - /** - * Properties of a GetCertificateTemplateRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IGetCertificateTemplateRequest - * @property {string|null} [name] GetCertificateTemplateRequest name - */ - - /** - * Constructs a new GetCertificateTemplateRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a GetCertificateTemplateRequest. - * @implements IGetCertificateTemplateRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest=} [properties] Properties to set - */ - function GetCertificateTemplateRequest(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]]; - } - - /** - * GetCertificateTemplateRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest - * @instance - */ - GetCertificateTemplateRequest.prototype.name = ""; - - /** - * Creates a new GetCertificateTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.GetCertificateTemplateRequest} GetCertificateTemplateRequest instance - */ - GetCertificateTemplateRequest.create = function create(properties) { - return new GetCertificateTemplateRequest(properties); - }; - - /** - * Encodes the specified GetCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest} message GetCertificateTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateTemplateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.GetCertificateTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.IGetCertificateTemplateRequest} message GetCertificateTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCertificateTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.GetCertificateTemplateRequest} GetCertificateTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCertificateTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.GetCertificateTemplateRequest} GetCertificateTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCertificateTemplateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCertificateTemplateRequest.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 GetCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.GetCertificateTemplateRequest} GetCertificateTemplateRequest - */ - GetCertificateTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.GetCertificateTemplateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetCertificateTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.GetCertificateTemplateRequest} message GetCertificateTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCertificateTemplateRequest.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 GetCertificateTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - GetCertificateTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCertificateTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.GetCertificateTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCertificateTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.GetCertificateTemplateRequest"; - }; - - return GetCertificateTemplateRequest; - })(); - - v1.ListCertificateTemplatesRequest = (function() { - - /** - * Properties of a ListCertificateTemplatesRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IListCertificateTemplatesRequest - * @property {string|null} [parent] ListCertificateTemplatesRequest parent - * @property {number|null} [pageSize] ListCertificateTemplatesRequest pageSize - * @property {string|null} [pageToken] ListCertificateTemplatesRequest pageToken - * @property {string|null} [filter] ListCertificateTemplatesRequest filter - * @property {string|null} [orderBy] ListCertificateTemplatesRequest orderBy - */ - - /** - * Constructs a new ListCertificateTemplatesRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a ListCertificateTemplatesRequest. - * @implements IListCertificateTemplatesRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest=} [properties] Properties to set - */ - function ListCertificateTemplatesRequest(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]]; - } - - /** - * ListCertificateTemplatesRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @instance - */ - ListCertificateTemplatesRequest.prototype.parent = ""; - - /** - * ListCertificateTemplatesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @instance - */ - ListCertificateTemplatesRequest.prototype.pageSize = 0; - - /** - * ListCertificateTemplatesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @instance - */ - ListCertificateTemplatesRequest.prototype.pageToken = ""; - - /** - * ListCertificateTemplatesRequest filter. - * @member {string} filter - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @instance - */ - ListCertificateTemplatesRequest.prototype.filter = ""; - - /** - * ListCertificateTemplatesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @instance - */ - ListCertificateTemplatesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListCertificateTemplatesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesRequest} ListCertificateTemplatesRequest instance - */ - ListCertificateTemplatesRequest.create = function create(properties) { - return new ListCertificateTemplatesRequest(properties); - }; - - /** - * Encodes the specified ListCertificateTemplatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest} message ListCertificateTemplatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateTemplatesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListCertificateTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesRequest} message ListCertificateTemplatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificateTemplatesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesRequest} ListCertificateTemplatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateTemplatesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListCertificateTemplatesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesRequest} ListCertificateTemplatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificateTemplatesRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificateTemplatesRequest.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 ListCertificateTemplatesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesRequest} ListCertificateTemplatesRequest - */ - ListCertificateTemplatesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListCertificateTemplatesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @static - * @param {google.cloud.security.privateca.v1.ListCertificateTemplatesRequest} message ListCertificateTemplatesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificateTemplatesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListCertificateTemplatesRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @instance - * @returns {Object.} JSON object - */ - ListCertificateTemplatesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificateTemplatesRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificateTemplatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateTemplatesRequest"; - }; - - return ListCertificateTemplatesRequest; - })(); - - v1.ListCertificateTemplatesResponse = (function() { - - /** - * Properties of a ListCertificateTemplatesResponse. - * @memberof google.cloud.security.privateca.v1 - * @interface IListCertificateTemplatesResponse - * @property {Array.|null} [certificateTemplates] ListCertificateTemplatesResponse certificateTemplates - * @property {string|null} [nextPageToken] ListCertificateTemplatesResponse nextPageToken - * @property {Array.|null} [unreachable] ListCertificateTemplatesResponse unreachable - */ - - /** - * Constructs a new ListCertificateTemplatesResponse. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents a ListCertificateTemplatesResponse. - * @implements IListCertificateTemplatesResponse - * @constructor - * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesResponse=} [properties] Properties to set - */ - function ListCertificateTemplatesResponse(properties) { - this.certificateTemplates = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCertificateTemplatesResponse certificateTemplates. - * @member {Array.} certificateTemplates - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @instance - */ - ListCertificateTemplatesResponse.prototype.certificateTemplates = $util.emptyArray; - - /** - * ListCertificateTemplatesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @instance - */ - ListCertificateTemplatesResponse.prototype.nextPageToken = ""; - - /** - * ListCertificateTemplatesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @instance - */ - ListCertificateTemplatesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListCertificateTemplatesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} ListCertificateTemplatesResponse instance - */ - ListCertificateTemplatesResponse.create = function create(properties) { - return new ListCertificateTemplatesResponse(properties); - }; - - /** - * Encodes the specified ListCertificateTemplatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesResponse} message ListCertificateTemplatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateTemplatesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateTemplates != null && message.certificateTemplates.length) - for (var i = 0; i < message.certificateTemplates.length; ++i) - $root.google.cloud.security.privateca.v1.CertificateTemplate.encode(message.certificateTemplates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListCertificateTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @static - * @param {google.cloud.security.privateca.v1.IListCertificateTemplatesResponse} message ListCertificateTemplatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateTemplatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificateTemplatesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} ListCertificateTemplatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateTemplatesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.certificateTemplates && message.certificateTemplates.length)) - message.certificateTemplates = []; - message.certificateTemplates.push($root.google.cloud.security.privateca.v1.CertificateTemplate.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCertificateTemplatesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} ListCertificateTemplatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateTemplatesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificateTemplatesResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificateTemplatesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificateTemplates != null && message.hasOwnProperty("certificateTemplates")) { - if (!Array.isArray(message.certificateTemplates)) - return "certificateTemplates: array expected"; - for (var i = 0; i < message.certificateTemplates.length; ++i) { - var error = $root.google.cloud.security.privateca.v1.CertificateTemplate.verify(message.certificateTemplates[i]); - if (error) - return "certificateTemplates." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListCertificateTemplatesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} ListCertificateTemplatesResponse - */ - ListCertificateTemplatesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse(); - if (object.certificateTemplates) { - if (!Array.isArray(object.certificateTemplates)) - throw TypeError(".google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.certificateTemplates: array expected"); - message.certificateTemplates = []; - for (var i = 0; i < object.certificateTemplates.length; ++i) { - if (typeof object.certificateTemplates[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.certificateTemplates: object expected"); - message.certificateTemplates[i] = $root.google.cloud.security.privateca.v1.CertificateTemplate.fromObject(object.certificateTemplates[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListCertificateTemplatesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @static - * @param {google.cloud.security.privateca.v1.ListCertificateTemplatesResponse} message ListCertificateTemplatesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificateTemplatesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.certificateTemplates = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.certificateTemplates && message.certificateTemplates.length) { - object.certificateTemplates = []; - for (var j = 0; j < message.certificateTemplates.length; ++j) - object.certificateTemplates[j] = $root.google.cloud.security.privateca.v1.CertificateTemplate.toObject(message.certificateTemplates[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListCertificateTemplatesResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @instance - * @returns {Object.} JSON object - */ - ListCertificateTemplatesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificateTemplatesResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.ListCertificateTemplatesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificateTemplatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.ListCertificateTemplatesResponse"; - }; - - return ListCertificateTemplatesResponse; - })(); - - v1.UpdateCertificateTemplateRequest = (function() { - - /** - * Properties of an UpdateCertificateTemplateRequest. - * @memberof google.cloud.security.privateca.v1 - * @interface IUpdateCertificateTemplateRequest - * @property {google.cloud.security.privateca.v1.ICertificateTemplate|null} [certificateTemplate] UpdateCertificateTemplateRequest certificateTemplate - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateTemplateRequest updateMask - * @property {string|null} [requestId] UpdateCertificateTemplateRequest requestId - */ - - /** - * Constructs a new UpdateCertificateTemplateRequest. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an UpdateCertificateTemplateRequest. - * @implements IUpdateCertificateTemplateRequest - * @constructor - * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest=} [properties] Properties to set - */ - function UpdateCertificateTemplateRequest(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]]; - } - - /** - * UpdateCertificateTemplateRequest certificateTemplate. - * @member {google.cloud.security.privateca.v1.ICertificateTemplate|null|undefined} certificateTemplate - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @instance - */ - UpdateCertificateTemplateRequest.prototype.certificateTemplate = null; - - /** - * UpdateCertificateTemplateRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @instance - */ - UpdateCertificateTemplateRequest.prototype.updateMask = null; - - /** - * UpdateCertificateTemplateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @instance - */ - UpdateCertificateTemplateRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateCertificateTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest} UpdateCertificateTemplateRequest instance - */ - UpdateCertificateTemplateRequest.create = function create(properties) { - return new UpdateCertificateTemplateRequest(properties); - }; - - /** - * Encodes the specified UpdateCertificateTemplateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest} message UpdateCertificateTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateTemplateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateTemplate != null && Object.hasOwnProperty.call(message, "certificateTemplate")) - $root.google.cloud.security.privateca.v1.CertificateTemplate.encode(message.certificateTemplate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateCertificateTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest} message UpdateCertificateTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCertificateTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest} UpdateCertificateTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCertificateTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest} UpdateCertificateTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCertificateTemplateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCertificateTemplateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) { - var error = $root.google.cloud.security.privateca.v1.CertificateTemplate.verify(message.certificateTemplate); - if (error) - return "certificateTemplate." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateCertificateTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest} UpdateCertificateTemplateRequest - */ - UpdateCertificateTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(); - if (object.certificateTemplate != null) { - if (typeof object.certificateTemplate !== "object") - throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.certificateTemplate: object expected"); - message.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.fromObject(object.certificateTemplate); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateCertificateTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @static - * @param {google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest} message UpdateCertificateTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCertificateTemplateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.certificateTemplate = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.certificateTemplate != null && message.hasOwnProperty("certificateTemplate")) - object.certificateTemplate = $root.google.cloud.security.privateca.v1.CertificateTemplate.toObject(message.certificateTemplate, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateCertificateTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCertificateTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCertificateTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCertificateTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest"; - }; - - return UpdateCertificateTemplateRequest; - })(); - - v1.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.security.privateca.v1 - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.security.privateca.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.security.privateca.v1.IOperationMetadata=} [properties] Properties to set - */ - function OperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @static - * @param {google.cloud.security.privateca.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.security.privateca.v1.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @static - * @param {google.cloud.security.privateca.v1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @static - * @param {google.cloud.security.privateca.v1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.OperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationMetadata message. - * @function verify - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1.OperationMetadata) - return object; - var message = new $root.google.cloud.security.privateca.v1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @static - * @param {google.cloud.security.privateca.v1.OperationMetadata} message OperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationMetadata - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1.OperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - return v1; - })(); - - privateca.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof google.cloud.security.privateca - * @namespace - */ - var v1beta1 = {}; - - v1beta1.CertificateAuthority = (function() { - - /** - * Properties of a CertificateAuthority. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface ICertificateAuthority - * @property {string|null} [name] CertificateAuthority name - * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.Type|null} [type] CertificateAuthority type - * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier|null} [tier] CertificateAuthority tier - * @property {google.cloud.security.privateca.v1beta1.ICertificateConfig|null} [config] CertificateAuthority config - * @property {google.protobuf.IDuration|null} [lifetime] CertificateAuthority lifetime - * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec|null} [keySpec] CertificateAuthority keySpec - * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy|null} [certificatePolicy] CertificateAuthority certificatePolicy - * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions|null} [issuingOptions] CertificateAuthority issuingOptions - * @property {google.cloud.security.privateca.v1beta1.ISubordinateConfig|null} [subordinateConfig] CertificateAuthority subordinateConfig - * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.State|null} [state] CertificateAuthority state - * @property {Array.|null} [pemCaCertificates] CertificateAuthority pemCaCertificates - * @property {Array.|null} [caCertificateDescriptions] CertificateAuthority caCertificateDescriptions - * @property {string|null} [gcsBucket] CertificateAuthority gcsBucket - * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls|null} [accessUrls] CertificateAuthority accessUrls - * @property {google.protobuf.ITimestamp|null} [createTime] CertificateAuthority createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateAuthority updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] CertificateAuthority deleteTime - * @property {Object.|null} [labels] CertificateAuthority labels - */ - - /** - * Constructs a new CertificateAuthority. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a CertificateAuthority. - * @implements ICertificateAuthority - * @constructor - * @param {google.cloud.security.privateca.v1beta1.ICertificateAuthority=} [properties] Properties to set - */ - function CertificateAuthority(properties) { - this.pemCaCertificates = []; - this.caCertificateDescriptions = []; - 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]]; - } - - /** - * CertificateAuthority name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.name = ""; - - /** - * CertificateAuthority type. - * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.Type} type - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.type = 0; - - /** - * CertificateAuthority tier. - * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier} tier - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.tier = 0; - - /** - * CertificateAuthority config. - * @member {google.cloud.security.privateca.v1beta1.ICertificateConfig|null|undefined} config - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.config = null; - - /** - * CertificateAuthority lifetime. - * @member {google.protobuf.IDuration|null|undefined} lifetime - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.lifetime = null; - - /** - * CertificateAuthority keySpec. - * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec|null|undefined} keySpec - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.keySpec = null; - - /** - * CertificateAuthority certificatePolicy. - * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy|null|undefined} certificatePolicy - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.certificatePolicy = null; - - /** - * CertificateAuthority issuingOptions. - * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions|null|undefined} issuingOptions - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.issuingOptions = null; - - /** - * CertificateAuthority subordinateConfig. - * @member {google.cloud.security.privateca.v1beta1.ISubordinateConfig|null|undefined} subordinateConfig - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.subordinateConfig = null; - - /** - * CertificateAuthority state. - * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.State} state - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.state = 0; - - /** - * CertificateAuthority pemCaCertificates. - * @member {Array.} pemCaCertificates - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.pemCaCertificates = $util.emptyArray; - - /** - * CertificateAuthority caCertificateDescriptions. - * @member {Array.} caCertificateDescriptions - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.caCertificateDescriptions = $util.emptyArray; - - /** - * CertificateAuthority gcsBucket. - * @member {string} gcsBucket - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.gcsBucket = ""; - - /** - * CertificateAuthority accessUrls. - * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls|null|undefined} accessUrls - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.accessUrls = null; - - /** - * CertificateAuthority createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.createTime = null; - - /** - * CertificateAuthority updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.updateTime = null; - - /** - * CertificateAuthority deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.deleteTime = null; - - /** - * CertificateAuthority labels. - * @member {Object.} labels - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - */ - CertificateAuthority.prototype.labels = $util.emptyObject; - - /** - * Creates a new CertificateAuthority instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateAuthority=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority} CertificateAuthority instance - */ - CertificateAuthority.create = function create(properties) { - return new CertificateAuthority(properties); - }; - - /** - * Encodes the specified CertificateAuthority message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateAuthority} message CertificateAuthority message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateAuthority.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.tier); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.security.privateca.v1beta1.CertificateConfig.encode(message.config, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) - $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.keySpec != null && Object.hasOwnProperty.call(message, "keySpec")) - $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.encode(message.keySpec, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.certificatePolicy != null && Object.hasOwnProperty.call(message, "certificatePolicy")) - $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.encode(message.certificatePolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.issuingOptions != null && Object.hasOwnProperty.call(message, "issuingOptions")) - $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.encode(message.issuingOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.pemCaCertificates != null && message.pemCaCertificates.length) - for (var i = 0; i < message.pemCaCertificates.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.pemCaCertificates[i]); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); - if (message.caCertificateDescriptions != null && message.caCertificateDescriptions.length) - for (var i = 0; i < message.caCertificateDescriptions.length; ++i) - $root.google.cloud.security.privateca.v1beta1.CertificateDescription.encode(message.caCertificateDescriptions[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.gcsBucket); - if (message.accessUrls != null && Object.hasOwnProperty.call(message, "accessUrls")) - $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.encode(message.accessUrls, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.subordinateConfig != null && Object.hasOwnProperty.call(message, "subordinateConfig")) - $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.encode(message.subordinateConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CertificateAuthority message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateAuthority} message CertificateAuthority message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateAuthority.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateAuthority message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority} CertificateAuthority - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateAuthority.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - case 3: { - message.tier = reader.int32(); - break; - } - case 4: { - message.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.keySpec = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.decode(reader, reader.uint32()); - break; - } - case 7: { - message.certificatePolicy = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.decode(reader, reader.uint32()); - break; - } - case 8: { - message.issuingOptions = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.decode(reader, reader.uint32()); - break; - } - case 19: { - message.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.decode(reader, reader.uint32()); - break; - } - case 10: { - message.state = reader.int32(); - break; - } - case 9: { - if (!(message.pemCaCertificates && message.pemCaCertificates.length)) - message.pemCaCertificates = []; - message.pemCaCertificates.push(reader.string()); - break; - } - case 12: { - if (!(message.caCertificateDescriptions && message.caCertificateDescriptions.length)) - message.caCertificateDescriptions = []; - message.caCertificateDescriptions.push($root.google.cloud.security.privateca.v1beta1.CertificateDescription.decode(reader, reader.uint32())); - break; - } - case 13: { - message.gcsBucket = reader.string(); - break; - } - case 14: { - message.accessUrls = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.decode(reader, reader.uint32()); - break; - } - case 15: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 16: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 17: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 18: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateAuthority message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority} CertificateAuthority - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateAuthority.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateAuthority message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateAuthority.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.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.tier != null && message.hasOwnProperty("tier")) - switch (message.tier) { - default: - return "tier: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.lifetime != null && message.hasOwnProperty("lifetime")) { - var error = $root.google.protobuf.Duration.verify(message.lifetime); - if (error) - return "lifetime." + error; - } - if (message.keySpec != null && message.hasOwnProperty("keySpec")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.verify(message.keySpec); - if (error) - return "keySpec." + error; - } - if (message.certificatePolicy != null && message.hasOwnProperty("certificatePolicy")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.verify(message.certificatePolicy); - if (error) - return "certificatePolicy." + error; - } - if (message.issuingOptions != null && message.hasOwnProperty("issuingOptions")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.verify(message.issuingOptions); - if (error) - return "issuingOptions." + error; - } - if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) { - var error = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.verify(message.subordinateConfig); - if (error) - return "subordinateConfig." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.pemCaCertificates != null && message.hasOwnProperty("pemCaCertificates")) { - if (!Array.isArray(message.pemCaCertificates)) - return "pemCaCertificates: array expected"; - for (var i = 0; i < message.pemCaCertificates.length; ++i) - if (!$util.isString(message.pemCaCertificates[i])) - return "pemCaCertificates: string[] expected"; - } - if (message.caCertificateDescriptions != null && message.hasOwnProperty("caCertificateDescriptions")) { - if (!Array.isArray(message.caCertificateDescriptions)) - return "caCertificateDescriptions: array expected"; - for (var i = 0; i < message.caCertificateDescriptions.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.verify(message.caCertificateDescriptions[i]); - if (error) - return "caCertificateDescriptions." + error; - } - } - if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) - if (!$util.isString(message.gcsBucket)) - return "gcsBucket: string expected"; - if (message.accessUrls != null && message.hasOwnProperty("accessUrls")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.verify(message.accessUrls); - if (error) - return "accessUrls." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + 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 CertificateAuthority message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority} CertificateAuthority - */ - CertificateAuthority.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority(); - if (object.name != null) - message.name = String(object.name); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "SELF_SIGNED": - case 1: - message.type = 1; - break; - case "SUBORDINATE": - case 2: - message.type = 2; - break; - } - switch (object.tier) { - default: - if (typeof object.tier === "number") { - message.tier = object.tier; - break; - } - break; - case "TIER_UNSPECIFIED": - case 0: - message.tier = 0; - break; - case "ENTERPRISE": - case 1: - message.tier = 1; - break; - case "DEVOPS": - case 2: - message.tier = 2; - break; - } - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.config: object expected"); - message.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.fromObject(object.config); - } - if (object.lifetime != null) { - if (typeof object.lifetime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.lifetime: object expected"); - message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); - } - if (object.keySpec != null) { - if (typeof object.keySpec !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.keySpec: object expected"); - message.keySpec = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.fromObject(object.keySpec); - } - if (object.certificatePolicy != null) { - if (typeof object.certificatePolicy !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.certificatePolicy: object expected"); - message.certificatePolicy = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.fromObject(object.certificatePolicy); - } - if (object.issuingOptions != null) { - if (typeof object.issuingOptions !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.issuingOptions: object expected"); - message.issuingOptions = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.fromObject(object.issuingOptions); - } - if (object.subordinateConfig != null) { - if (typeof object.subordinateConfig !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.subordinateConfig: object expected"); - message.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.fromObject(object.subordinateConfig); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ENABLED": - case 1: - message.state = 1; - break; - case "DISABLED": - case 2: - message.state = 2; - break; - case "PENDING_ACTIVATION": - case 3: - message.state = 3; - break; - case "PENDING_DELETION": - case 4: - message.state = 4; - break; - } - if (object.pemCaCertificates) { - if (!Array.isArray(object.pemCaCertificates)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.pemCaCertificates: array expected"); - message.pemCaCertificates = []; - for (var i = 0; i < object.pemCaCertificates.length; ++i) - message.pemCaCertificates[i] = String(object.pemCaCertificates[i]); - } - if (object.caCertificateDescriptions) { - if (!Array.isArray(object.caCertificateDescriptions)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.caCertificateDescriptions: array expected"); - message.caCertificateDescriptions = []; - for (var i = 0; i < object.caCertificateDescriptions.length; ++i) { - if (typeof object.caCertificateDescriptions[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.caCertificateDescriptions: object expected"); - message.caCertificateDescriptions[i] = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.fromObject(object.caCertificateDescriptions[i]); - } - } - if (object.gcsBucket != null) - message.gcsBucket = String(object.gcsBucket); - if (object.accessUrls != null) { - if (typeof object.accessUrls !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.accessUrls: object expected"); - message.accessUrls = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.fromObject(object.accessUrls); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.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 CertificateAuthority message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority} message CertificateAuthority - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateAuthority.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pemCaCertificates = []; - object.caCertificateDescriptions = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; - object.config = null; - object.lifetime = null; - object.keySpec = null; - object.certificatePolicy = null; - object.issuingOptions = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.gcsBucket = ""; - object.accessUrls = null; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.subordinateConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type[message.type] === undefined ? message.type : $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type[message.type] : message.type; - if (message.tier != null && message.hasOwnProperty("tier")) - object.tier = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier[message.tier] === undefined ? message.tier : $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier[message.tier] : message.tier; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.toObject(message.config, options); - if (message.lifetime != null && message.hasOwnProperty("lifetime")) - object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); - if (message.keySpec != null && message.hasOwnProperty("keySpec")) - object.keySpec = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.toObject(message.keySpec, options); - if (message.certificatePolicy != null && message.hasOwnProperty("certificatePolicy")) - object.certificatePolicy = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.toObject(message.certificatePolicy, options); - if (message.issuingOptions != null && message.hasOwnProperty("issuingOptions")) - object.issuingOptions = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.toObject(message.issuingOptions, options); - if (message.pemCaCertificates && message.pemCaCertificates.length) { - object.pemCaCertificates = []; - for (var j = 0; j < message.pemCaCertificates.length; ++j) - object.pemCaCertificates[j] = message.pemCaCertificates[j]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.State[message.state] === undefined ? message.state : $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.State[message.state] : message.state; - if (message.caCertificateDescriptions && message.caCertificateDescriptions.length) { - object.caCertificateDescriptions = []; - for (var j = 0; j < message.caCertificateDescriptions.length; ++j) - object.caCertificateDescriptions[j] = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.toObject(message.caCertificateDescriptions[j], options); - } - if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) - object.gcsBucket = message.gcsBucket; - if (message.accessUrls != null && message.hasOwnProperty("accessUrls")) - object.accessUrls = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.toObject(message.accessUrls, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) - object.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.toObject(message.subordinateConfig, options); - return object; - }; - - /** - * Converts this CertificateAuthority to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @instance - * @returns {Object.} JSON object - */ - CertificateAuthority.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateAuthority - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateAuthority.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority"; - }; - - CertificateAuthority.IssuingOptions = (function() { - - /** - * Properties of an IssuingOptions. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @interface IIssuingOptions - * @property {boolean|null} [includeCaCertUrl] IssuingOptions includeCaCertUrl - * @property {boolean|null} [includeCrlAccessUrl] IssuingOptions includeCrlAccessUrl - */ - - /** - * Constructs a new IssuingOptions. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @classdesc Represents an IssuingOptions. - * @implements IIssuingOptions - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions=} [properties] Properties to set - */ - function IssuingOptions(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]]; - } - - /** - * IssuingOptions includeCaCertUrl. - * @member {boolean} includeCaCertUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @instance - */ - IssuingOptions.prototype.includeCaCertUrl = false; - - /** - * IssuingOptions includeCrlAccessUrl. - * @member {boolean} includeCrlAccessUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @instance - */ - IssuingOptions.prototype.includeCrlAccessUrl = false; - - /** - * Creates a new IssuingOptions instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions} IssuingOptions instance - */ - IssuingOptions.create = function create(properties) { - return new IssuingOptions(properties); - }; - - /** - * Encodes the specified IssuingOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions} message IssuingOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IssuingOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.includeCaCertUrl != null && Object.hasOwnProperty.call(message, "includeCaCertUrl")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.includeCaCertUrl); - if (message.includeCrlAccessUrl != null && Object.hasOwnProperty.call(message, "includeCrlAccessUrl")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeCrlAccessUrl); - return writer; - }; - - /** - * Encodes the specified IssuingOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IIssuingOptions} message IssuingOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IssuingOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IssuingOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions} IssuingOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IssuingOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.includeCaCertUrl = reader.bool(); - break; - } - case 2: { - message.includeCrlAccessUrl = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IssuingOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions} IssuingOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IssuingOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IssuingOptions message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IssuingOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.includeCaCertUrl != null && message.hasOwnProperty("includeCaCertUrl")) - if (typeof message.includeCaCertUrl !== "boolean") - return "includeCaCertUrl: boolean expected"; - if (message.includeCrlAccessUrl != null && message.hasOwnProperty("includeCrlAccessUrl")) - if (typeof message.includeCrlAccessUrl !== "boolean") - return "includeCrlAccessUrl: boolean expected"; - return null; - }; - - /** - * Creates an IssuingOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions} IssuingOptions - */ - IssuingOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions(); - if (object.includeCaCertUrl != null) - message.includeCaCertUrl = Boolean(object.includeCaCertUrl); - if (object.includeCrlAccessUrl != null) - message.includeCrlAccessUrl = Boolean(object.includeCrlAccessUrl); - return message; - }; - - /** - * Creates a plain object from an IssuingOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions} message IssuingOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IssuingOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.includeCaCertUrl = false; - object.includeCrlAccessUrl = false; - } - if (message.includeCaCertUrl != null && message.hasOwnProperty("includeCaCertUrl")) - object.includeCaCertUrl = message.includeCaCertUrl; - if (message.includeCrlAccessUrl != null && message.hasOwnProperty("includeCrlAccessUrl")) - object.includeCrlAccessUrl = message.includeCrlAccessUrl; - return object; - }; - - /** - * Converts this IssuingOptions to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @instance - * @returns {Object.} JSON object - */ - IssuingOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IssuingOptions - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IssuingOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions"; - }; - - return IssuingOptions; - })(); - - CertificateAuthority.CertificateAuthorityPolicy = (function() { - - /** - * Properties of a CertificateAuthorityPolicy. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @interface ICertificateAuthorityPolicy - * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList|null} [allowedConfigList] CertificateAuthorityPolicy allowedConfigList - * @property {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null} [overwriteConfigValues] CertificateAuthorityPolicy overwriteConfigValues - * @property {Array.|null} [allowedLocationsAndOrganizations] CertificateAuthorityPolicy allowedLocationsAndOrganizations - * @property {Array.|null} [allowedCommonNames] CertificateAuthorityPolicy allowedCommonNames - * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames|null} [allowedSans] CertificateAuthorityPolicy allowedSans - * @property {google.protobuf.IDuration|null} [maximumLifetime] CertificateAuthorityPolicy maximumLifetime - * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes|null} [allowedIssuanceModes] CertificateAuthorityPolicy allowedIssuanceModes - */ - - /** - * Constructs a new CertificateAuthorityPolicy. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @classdesc Represents a CertificateAuthorityPolicy. - * @implements ICertificateAuthorityPolicy - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy=} [properties] Properties to set - */ - function CertificateAuthorityPolicy(properties) { - this.allowedLocationsAndOrganizations = []; - this.allowedCommonNames = []; - 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]]; - } - - /** - * CertificateAuthorityPolicy allowedConfigList. - * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList|null|undefined} allowedConfigList - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @instance - */ - CertificateAuthorityPolicy.prototype.allowedConfigList = null; - - /** - * CertificateAuthorityPolicy overwriteConfigValues. - * @member {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null|undefined} overwriteConfigValues - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @instance - */ - CertificateAuthorityPolicy.prototype.overwriteConfigValues = null; - - /** - * CertificateAuthorityPolicy allowedLocationsAndOrganizations. - * @member {Array.} allowedLocationsAndOrganizations - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @instance - */ - CertificateAuthorityPolicy.prototype.allowedLocationsAndOrganizations = $util.emptyArray; - - /** - * CertificateAuthorityPolicy allowedCommonNames. - * @member {Array.} allowedCommonNames - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @instance - */ - CertificateAuthorityPolicy.prototype.allowedCommonNames = $util.emptyArray; - - /** - * CertificateAuthorityPolicy allowedSans. - * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames|null|undefined} allowedSans - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @instance - */ - CertificateAuthorityPolicy.prototype.allowedSans = null; - - /** - * CertificateAuthorityPolicy maximumLifetime. - * @member {google.protobuf.IDuration|null|undefined} maximumLifetime - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @instance - */ - CertificateAuthorityPolicy.prototype.maximumLifetime = null; - - /** - * CertificateAuthorityPolicy allowedIssuanceModes. - * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes|null|undefined} allowedIssuanceModes - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @instance - */ - CertificateAuthorityPolicy.prototype.allowedIssuanceModes = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CertificateAuthorityPolicy configPolicy. - * @member {"allowedConfigList"|"overwriteConfigValues"|undefined} configPolicy - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @instance - */ - Object.defineProperty(CertificateAuthorityPolicy.prototype, "configPolicy", { - get: $util.oneOfGetter($oneOfFields = ["allowedConfigList", "overwriteConfigValues"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CertificateAuthorityPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy} CertificateAuthorityPolicy instance - */ - CertificateAuthorityPolicy.create = function create(properties) { - return new CertificateAuthorityPolicy(properties); - }; - - /** - * Encodes the specified CertificateAuthorityPolicy message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy} message CertificateAuthorityPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateAuthorityPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedConfigList != null && Object.hasOwnProperty.call(message, "allowedConfigList")) - $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.encode(message.allowedConfigList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.overwriteConfigValues != null && Object.hasOwnProperty.call(message, "overwriteConfigValues")) - $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.encode(message.overwriteConfigValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.allowedLocationsAndOrganizations != null && message.allowedLocationsAndOrganizations.length) - for (var i = 0; i < message.allowedLocationsAndOrganizations.length; ++i) - $root.google.cloud.security.privateca.v1beta1.Subject.encode(message.allowedLocationsAndOrganizations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.allowedCommonNames != null && message.allowedCommonNames.length) - for (var i = 0; i < message.allowedCommonNames.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.allowedCommonNames[i]); - if (message.allowedSans != null && Object.hasOwnProperty.call(message, "allowedSans")) - $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.encode(message.allowedSans, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.maximumLifetime != null && Object.hasOwnProperty.call(message, "maximumLifetime")) - $root.google.protobuf.Duration.encode(message.maximumLifetime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.allowedIssuanceModes != null && Object.hasOwnProperty.call(message, "allowedIssuanceModes")) - $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.encode(message.allowedIssuanceModes, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CertificateAuthorityPolicy message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.ICertificateAuthorityPolicy} message CertificateAuthorityPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateAuthorityPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateAuthorityPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy} CertificateAuthorityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateAuthorityPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.allowedConfigList = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.decode(reader, reader.uint32()); - break; - } - case 2: { - message.overwriteConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.allowedLocationsAndOrganizations && message.allowedLocationsAndOrganizations.length)) - message.allowedLocationsAndOrganizations = []; - message.allowedLocationsAndOrganizations.push($root.google.cloud.security.privateca.v1beta1.Subject.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.allowedCommonNames && message.allowedCommonNames.length)) - message.allowedCommonNames = []; - message.allowedCommonNames.push(reader.string()); - break; - } - case 5: { - message.allowedSans = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.decode(reader, reader.uint32()); - break; - } - case 6: { - message.maximumLifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 8: { - message.allowedIssuanceModes = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateAuthorityPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy} CertificateAuthorityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateAuthorityPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateAuthorityPolicy message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateAuthorityPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.allowedConfigList != null && message.hasOwnProperty("allowedConfigList")) { - properties.configPolicy = 1; - { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.verify(message.allowedConfigList); - if (error) - return "allowedConfigList." + error; - } - } - if (message.overwriteConfigValues != null && message.hasOwnProperty("overwriteConfigValues")) { - if (properties.configPolicy === 1) - return "configPolicy: multiple values"; - properties.configPolicy = 1; - { - var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify(message.overwriteConfigValues); - if (error) - return "overwriteConfigValues." + error; - } - } - if (message.allowedLocationsAndOrganizations != null && message.hasOwnProperty("allowedLocationsAndOrganizations")) { - if (!Array.isArray(message.allowedLocationsAndOrganizations)) - return "allowedLocationsAndOrganizations: array expected"; - for (var i = 0; i < message.allowedLocationsAndOrganizations.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.Subject.verify(message.allowedLocationsAndOrganizations[i]); - if (error) - return "allowedLocationsAndOrganizations." + error; - } - } - if (message.allowedCommonNames != null && message.hasOwnProperty("allowedCommonNames")) { - if (!Array.isArray(message.allowedCommonNames)) - return "allowedCommonNames: array expected"; - for (var i = 0; i < message.allowedCommonNames.length; ++i) - if (!$util.isString(message.allowedCommonNames[i])) - return "allowedCommonNames: string[] expected"; - } - if (message.allowedSans != null && message.hasOwnProperty("allowedSans")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.verify(message.allowedSans); - if (error) - return "allowedSans." + error; - } - if (message.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) { - var error = $root.google.protobuf.Duration.verify(message.maximumLifetime); - if (error) - return "maximumLifetime." + error; - } - if (message.allowedIssuanceModes != null && message.hasOwnProperty("allowedIssuanceModes")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.verify(message.allowedIssuanceModes); - if (error) - return "allowedIssuanceModes." + error; - } - return null; - }; - - /** - * Creates a CertificateAuthorityPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy} CertificateAuthorityPolicy - */ - CertificateAuthorityPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy(); - if (object.allowedConfigList != null) { - if (typeof object.allowedConfigList !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedConfigList: object expected"); - message.allowedConfigList = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.fromObject(object.allowedConfigList); - } - if (object.overwriteConfigValues != null) { - if (typeof object.overwriteConfigValues !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.overwriteConfigValues: object expected"); - message.overwriteConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.fromObject(object.overwriteConfigValues); - } - if (object.allowedLocationsAndOrganizations) { - if (!Array.isArray(object.allowedLocationsAndOrganizations)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedLocationsAndOrganizations: array expected"); - message.allowedLocationsAndOrganizations = []; - for (var i = 0; i < object.allowedLocationsAndOrganizations.length; ++i) { - if (typeof object.allowedLocationsAndOrganizations[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedLocationsAndOrganizations: object expected"); - message.allowedLocationsAndOrganizations[i] = $root.google.cloud.security.privateca.v1beta1.Subject.fromObject(object.allowedLocationsAndOrganizations[i]); - } - } - if (object.allowedCommonNames) { - if (!Array.isArray(object.allowedCommonNames)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedCommonNames: array expected"); - message.allowedCommonNames = []; - for (var i = 0; i < object.allowedCommonNames.length; ++i) - message.allowedCommonNames[i] = String(object.allowedCommonNames[i]); - } - if (object.allowedSans != null) { - if (typeof object.allowedSans !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedSans: object expected"); - message.allowedSans = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.fromObject(object.allowedSans); - } - if (object.maximumLifetime != null) { - if (typeof object.maximumLifetime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.maximumLifetime: object expected"); - message.maximumLifetime = $root.google.protobuf.Duration.fromObject(object.maximumLifetime); - } - if (object.allowedIssuanceModes != null) { - if (typeof object.allowedIssuanceModes !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.allowedIssuanceModes: object expected"); - message.allowedIssuanceModes = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.fromObject(object.allowedIssuanceModes); - } - return message; - }; - - /** - * Creates a plain object from a CertificateAuthorityPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy} message CertificateAuthorityPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateAuthorityPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.allowedLocationsAndOrganizations = []; - object.allowedCommonNames = []; - } - if (options.defaults) { - object.allowedSans = null; - object.maximumLifetime = null; - object.allowedIssuanceModes = null; - } - if (message.allowedConfigList != null && message.hasOwnProperty("allowedConfigList")) { - object.allowedConfigList = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.toObject(message.allowedConfigList, options); - if (options.oneofs) - object.configPolicy = "allowedConfigList"; - } - if (message.overwriteConfigValues != null && message.hasOwnProperty("overwriteConfigValues")) { - object.overwriteConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.toObject(message.overwriteConfigValues, options); - if (options.oneofs) - object.configPolicy = "overwriteConfigValues"; - } - if (message.allowedLocationsAndOrganizations && message.allowedLocationsAndOrganizations.length) { - object.allowedLocationsAndOrganizations = []; - for (var j = 0; j < message.allowedLocationsAndOrganizations.length; ++j) - object.allowedLocationsAndOrganizations[j] = $root.google.cloud.security.privateca.v1beta1.Subject.toObject(message.allowedLocationsAndOrganizations[j], options); - } - if (message.allowedCommonNames && message.allowedCommonNames.length) { - object.allowedCommonNames = []; - for (var j = 0; j < message.allowedCommonNames.length; ++j) - object.allowedCommonNames[j] = message.allowedCommonNames[j]; - } - if (message.allowedSans != null && message.hasOwnProperty("allowedSans")) - object.allowedSans = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.toObject(message.allowedSans, options); - if (message.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) - object.maximumLifetime = $root.google.protobuf.Duration.toObject(message.maximumLifetime, options); - if (message.allowedIssuanceModes != null && message.hasOwnProperty("allowedIssuanceModes")) - object.allowedIssuanceModes = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.toObject(message.allowedIssuanceModes, options); - return object; - }; - - /** - * Converts this CertificateAuthorityPolicy to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @instance - * @returns {Object.} JSON object - */ - CertificateAuthorityPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateAuthorityPolicy - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateAuthorityPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy"; - }; - - CertificateAuthorityPolicy.AllowedConfigList = (function() { - - /** - * Properties of an AllowedConfigList. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @interface IAllowedConfigList - * @property {Array.|null} [allowedConfigValues] AllowedConfigList allowedConfigValues - */ - - /** - * Constructs a new AllowedConfigList. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @classdesc Represents an AllowedConfigList. - * @implements IAllowedConfigList - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList=} [properties] Properties to set - */ - function AllowedConfigList(properties) { - this.allowedConfigValues = []; - 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]]; - } - - /** - * AllowedConfigList allowedConfigValues. - * @member {Array.} allowedConfigValues - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList - * @instance - */ - AllowedConfigList.prototype.allowedConfigValues = $util.emptyArray; - - /** - * Creates a new AllowedConfigList instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList} AllowedConfigList instance - */ - AllowedConfigList.create = function create(properties) { - return new AllowedConfigList(properties); - }; - - /** - * Encodes the specified AllowedConfigList message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList} message AllowedConfigList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedConfigList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedConfigValues != null && message.allowedConfigValues.length) - for (var i = 0; i < message.allowedConfigValues.length; ++i) - $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.encode(message.allowedConfigValues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AllowedConfigList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedConfigList} message AllowedConfigList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedConfigList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllowedConfigList message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList} AllowedConfigList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedConfigList.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.allowedConfigValues && message.allowedConfigValues.length)) - message.allowedConfigValues = []; - message.allowedConfigValues.push($root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllowedConfigList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList} AllowedConfigList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedConfigList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllowedConfigList message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllowedConfigList.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedConfigValues != null && message.hasOwnProperty("allowedConfigValues")) { - if (!Array.isArray(message.allowedConfigValues)) - return "allowedConfigValues: array expected"; - for (var i = 0; i < message.allowedConfigValues.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify(message.allowedConfigValues[i]); - if (error) - return "allowedConfigValues." + error; - } - } - return null; - }; - - /** - * Creates an AllowedConfigList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList} AllowedConfigList - */ - AllowedConfigList.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList(); - if (object.allowedConfigValues) { - if (!Array.isArray(object.allowedConfigValues)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.allowedConfigValues: array expected"); - message.allowedConfigValues = []; - for (var i = 0; i < object.allowedConfigValues.length; ++i) { - if (typeof object.allowedConfigValues[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList.allowedConfigValues: object expected"); - message.allowedConfigValues[i] = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.fromObject(object.allowedConfigValues[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AllowedConfigList message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList} message AllowedConfigList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllowedConfigList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedConfigValues = []; - if (message.allowedConfigValues && message.allowedConfigValues.length) { - object.allowedConfigValues = []; - for (var j = 0; j < message.allowedConfigValues.length; ++j) - object.allowedConfigValues[j] = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.toObject(message.allowedConfigValues[j], options); - } - return object; - }; - - /** - * Converts this AllowedConfigList to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList - * @instance - * @returns {Object.} JSON object - */ - AllowedConfigList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AllowedConfigList - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllowedConfigList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList"; - }; - - return AllowedConfigList; - })(); - - CertificateAuthorityPolicy.AllowedSubjectAltNames = (function() { - - /** - * Properties of an AllowedSubjectAltNames. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @interface IAllowedSubjectAltNames - * @property {Array.|null} [allowedDnsNames] AllowedSubjectAltNames allowedDnsNames - * @property {Array.|null} [allowedUris] AllowedSubjectAltNames allowedUris - * @property {Array.|null} [allowedEmailAddresses] AllowedSubjectAltNames allowedEmailAddresses - * @property {Array.|null} [allowedIps] AllowedSubjectAltNames allowedIps - * @property {boolean|null} [allowGlobbingDnsWildcards] AllowedSubjectAltNames allowGlobbingDnsWildcards - * @property {boolean|null} [allowCustomSans] AllowedSubjectAltNames allowCustomSans - */ - - /** - * Constructs a new AllowedSubjectAltNames. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @classdesc Represents an AllowedSubjectAltNames. - * @implements IAllowedSubjectAltNames - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames=} [properties] Properties to set - */ - function AllowedSubjectAltNames(properties) { - this.allowedDnsNames = []; - this.allowedUris = []; - this.allowedEmailAddresses = []; - this.allowedIps = []; - 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]]; - } - - /** - * AllowedSubjectAltNames allowedDnsNames. - * @member {Array.} allowedDnsNames - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @instance - */ - AllowedSubjectAltNames.prototype.allowedDnsNames = $util.emptyArray; - - /** - * AllowedSubjectAltNames allowedUris. - * @member {Array.} allowedUris - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @instance - */ - AllowedSubjectAltNames.prototype.allowedUris = $util.emptyArray; - - /** - * AllowedSubjectAltNames allowedEmailAddresses. - * @member {Array.} allowedEmailAddresses - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @instance - */ - AllowedSubjectAltNames.prototype.allowedEmailAddresses = $util.emptyArray; - - /** - * AllowedSubjectAltNames allowedIps. - * @member {Array.} allowedIps - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @instance - */ - AllowedSubjectAltNames.prototype.allowedIps = $util.emptyArray; - - /** - * AllowedSubjectAltNames allowGlobbingDnsWildcards. - * @member {boolean} allowGlobbingDnsWildcards - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @instance - */ - AllowedSubjectAltNames.prototype.allowGlobbingDnsWildcards = false; - - /** - * AllowedSubjectAltNames allowCustomSans. - * @member {boolean} allowCustomSans - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @instance - */ - AllowedSubjectAltNames.prototype.allowCustomSans = false; - - /** - * Creates a new AllowedSubjectAltNames instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames} AllowedSubjectAltNames instance - */ - AllowedSubjectAltNames.create = function create(properties) { - return new AllowedSubjectAltNames(properties); - }; - - /** - * Encodes the specified AllowedSubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames} message AllowedSubjectAltNames message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedSubjectAltNames.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedDnsNames != null && message.allowedDnsNames.length) - for (var i = 0; i < message.allowedDnsNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDnsNames[i]); - if (message.allowedUris != null && message.allowedUris.length) - for (var i = 0; i < message.allowedUris.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedUris[i]); - if (message.allowedEmailAddresses != null && message.allowedEmailAddresses.length) - for (var i = 0; i < message.allowedEmailAddresses.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.allowedEmailAddresses[i]); - if (message.allowedIps != null && message.allowedIps.length) - for (var i = 0; i < message.allowedIps.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.allowedIps[i]); - if (message.allowGlobbingDnsWildcards != null && Object.hasOwnProperty.call(message, "allowGlobbingDnsWildcards")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowGlobbingDnsWildcards); - if (message.allowCustomSans != null && Object.hasOwnProperty.call(message, "allowCustomSans")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowCustomSans); - return writer; - }; - - /** - * Encodes the specified AllowedSubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IAllowedSubjectAltNames} message AllowedSubjectAltNames message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedSubjectAltNames.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllowedSubjectAltNames message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames} AllowedSubjectAltNames - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedSubjectAltNames.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.allowedDnsNames && message.allowedDnsNames.length)) - message.allowedDnsNames = []; - message.allowedDnsNames.push(reader.string()); - break; - } - case 2: { - if (!(message.allowedUris && message.allowedUris.length)) - message.allowedUris = []; - message.allowedUris.push(reader.string()); - break; - } - case 3: { - if (!(message.allowedEmailAddresses && message.allowedEmailAddresses.length)) - message.allowedEmailAddresses = []; - message.allowedEmailAddresses.push(reader.string()); - break; - } - case 4: { - if (!(message.allowedIps && message.allowedIps.length)) - message.allowedIps = []; - message.allowedIps.push(reader.string()); - break; - } - case 5: { - message.allowGlobbingDnsWildcards = reader.bool(); - break; - } - case 6: { - message.allowCustomSans = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllowedSubjectAltNames message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames} AllowedSubjectAltNames - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedSubjectAltNames.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllowedSubjectAltNames message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllowedSubjectAltNames.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedDnsNames != null && message.hasOwnProperty("allowedDnsNames")) { - if (!Array.isArray(message.allowedDnsNames)) - return "allowedDnsNames: array expected"; - for (var i = 0; i < message.allowedDnsNames.length; ++i) - if (!$util.isString(message.allowedDnsNames[i])) - return "allowedDnsNames: string[] expected"; - } - if (message.allowedUris != null && message.hasOwnProperty("allowedUris")) { - if (!Array.isArray(message.allowedUris)) - return "allowedUris: array expected"; - for (var i = 0; i < message.allowedUris.length; ++i) - if (!$util.isString(message.allowedUris[i])) - return "allowedUris: string[] expected"; - } - if (message.allowedEmailAddresses != null && message.hasOwnProperty("allowedEmailAddresses")) { - if (!Array.isArray(message.allowedEmailAddresses)) - return "allowedEmailAddresses: array expected"; - for (var i = 0; i < message.allowedEmailAddresses.length; ++i) - if (!$util.isString(message.allowedEmailAddresses[i])) - return "allowedEmailAddresses: string[] expected"; - } - if (message.allowedIps != null && message.hasOwnProperty("allowedIps")) { - if (!Array.isArray(message.allowedIps)) - return "allowedIps: array expected"; - for (var i = 0; i < message.allowedIps.length; ++i) - if (!$util.isString(message.allowedIps[i])) - return "allowedIps: string[] expected"; - } - if (message.allowGlobbingDnsWildcards != null && message.hasOwnProperty("allowGlobbingDnsWildcards")) - if (typeof message.allowGlobbingDnsWildcards !== "boolean") - return "allowGlobbingDnsWildcards: boolean expected"; - if (message.allowCustomSans != null && message.hasOwnProperty("allowCustomSans")) - if (typeof message.allowCustomSans !== "boolean") - return "allowCustomSans: boolean expected"; - return null; - }; - - /** - * Creates an AllowedSubjectAltNames message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames} AllowedSubjectAltNames - */ - AllowedSubjectAltNames.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames(); - if (object.allowedDnsNames) { - if (!Array.isArray(object.allowedDnsNames)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowedDnsNames: array expected"); - message.allowedDnsNames = []; - for (var i = 0; i < object.allowedDnsNames.length; ++i) - message.allowedDnsNames[i] = String(object.allowedDnsNames[i]); - } - if (object.allowedUris) { - if (!Array.isArray(object.allowedUris)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowedUris: array expected"); - message.allowedUris = []; - for (var i = 0; i < object.allowedUris.length; ++i) - message.allowedUris[i] = String(object.allowedUris[i]); - } - if (object.allowedEmailAddresses) { - if (!Array.isArray(object.allowedEmailAddresses)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowedEmailAddresses: array expected"); - message.allowedEmailAddresses = []; - for (var i = 0; i < object.allowedEmailAddresses.length; ++i) - message.allowedEmailAddresses[i] = String(object.allowedEmailAddresses[i]); - } - if (object.allowedIps) { - if (!Array.isArray(object.allowedIps)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames.allowedIps: array expected"); - message.allowedIps = []; - for (var i = 0; i < object.allowedIps.length; ++i) - message.allowedIps[i] = String(object.allowedIps[i]); - } - if (object.allowGlobbingDnsWildcards != null) - message.allowGlobbingDnsWildcards = Boolean(object.allowGlobbingDnsWildcards); - if (object.allowCustomSans != null) - message.allowCustomSans = Boolean(object.allowCustomSans); - return message; - }; - - /** - * Creates a plain object from an AllowedSubjectAltNames message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames} message AllowedSubjectAltNames - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllowedSubjectAltNames.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.allowedDnsNames = []; - object.allowedUris = []; - object.allowedEmailAddresses = []; - object.allowedIps = []; - } - if (options.defaults) { - object.allowGlobbingDnsWildcards = false; - object.allowCustomSans = false; - } - if (message.allowedDnsNames && message.allowedDnsNames.length) { - object.allowedDnsNames = []; - for (var j = 0; j < message.allowedDnsNames.length; ++j) - object.allowedDnsNames[j] = message.allowedDnsNames[j]; - } - if (message.allowedUris && message.allowedUris.length) { - object.allowedUris = []; - for (var j = 0; j < message.allowedUris.length; ++j) - object.allowedUris[j] = message.allowedUris[j]; - } - if (message.allowedEmailAddresses && message.allowedEmailAddresses.length) { - object.allowedEmailAddresses = []; - for (var j = 0; j < message.allowedEmailAddresses.length; ++j) - object.allowedEmailAddresses[j] = message.allowedEmailAddresses[j]; - } - if (message.allowedIps && message.allowedIps.length) { - object.allowedIps = []; - for (var j = 0; j < message.allowedIps.length; ++j) - object.allowedIps[j] = message.allowedIps[j]; - } - if (message.allowGlobbingDnsWildcards != null && message.hasOwnProperty("allowGlobbingDnsWildcards")) - object.allowGlobbingDnsWildcards = message.allowGlobbingDnsWildcards; - if (message.allowCustomSans != null && message.hasOwnProperty("allowCustomSans")) - object.allowCustomSans = message.allowCustomSans; - return object; - }; - - /** - * Converts this AllowedSubjectAltNames to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @instance - * @returns {Object.} JSON object - */ - AllowedSubjectAltNames.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AllowedSubjectAltNames - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllowedSubjectAltNames.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames"; - }; - - return AllowedSubjectAltNames; - })(); - - CertificateAuthorityPolicy.IssuanceModes = (function() { - - /** - * Properties of an IssuanceModes. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @interface IIssuanceModes - * @property {boolean|null} [allowCsrBasedIssuance] IssuanceModes allowCsrBasedIssuance - * @property {boolean|null} [allowConfigBasedIssuance] IssuanceModes allowConfigBasedIssuance - */ - - /** - * Constructs a new IssuanceModes. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy - * @classdesc Represents an IssuanceModes. - * @implements IIssuanceModes - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes=} [properties] Properties to set - */ - function IssuanceModes(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]]; - } - - /** - * IssuanceModes allowCsrBasedIssuance. - * @member {boolean} allowCsrBasedIssuance - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @instance - */ - IssuanceModes.prototype.allowCsrBasedIssuance = false; - - /** - * IssuanceModes allowConfigBasedIssuance. - * @member {boolean} allowConfigBasedIssuance - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @instance - */ - IssuanceModes.prototype.allowConfigBasedIssuance = false; - - /** - * Creates a new IssuanceModes instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes} IssuanceModes instance - */ - IssuanceModes.create = function create(properties) { - return new IssuanceModes(properties); - }; - - /** - * Encodes the specified IssuanceModes message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes} message IssuanceModes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IssuanceModes.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowCsrBasedIssuance != null && Object.hasOwnProperty.call(message, "allowCsrBasedIssuance")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowCsrBasedIssuance); - if (message.allowConfigBasedIssuance != null && Object.hasOwnProperty.call(message, "allowConfigBasedIssuance")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowConfigBasedIssuance); - return writer; - }; - - /** - * Encodes the specified IssuanceModes message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IIssuanceModes} message IssuanceModes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IssuanceModes.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IssuanceModes message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes} IssuanceModes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IssuanceModes.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.allowCsrBasedIssuance = reader.bool(); - break; - } - case 2: { - message.allowConfigBasedIssuance = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IssuanceModes message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes} IssuanceModes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IssuanceModes.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IssuanceModes message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IssuanceModes.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowCsrBasedIssuance != null && message.hasOwnProperty("allowCsrBasedIssuance")) - if (typeof message.allowCsrBasedIssuance !== "boolean") - return "allowCsrBasedIssuance: boolean expected"; - if (message.allowConfigBasedIssuance != null && message.hasOwnProperty("allowConfigBasedIssuance")) - if (typeof message.allowConfigBasedIssuance !== "boolean") - return "allowConfigBasedIssuance: boolean expected"; - return null; - }; - - /** - * Creates an IssuanceModes message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes} IssuanceModes - */ - IssuanceModes.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes(); - if (object.allowCsrBasedIssuance != null) - message.allowCsrBasedIssuance = Boolean(object.allowCsrBasedIssuance); - if (object.allowConfigBasedIssuance != null) - message.allowConfigBasedIssuance = Boolean(object.allowConfigBasedIssuance); - return message; - }; - - /** - * Creates a plain object from an IssuanceModes message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes} message IssuanceModes - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IssuanceModes.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.allowCsrBasedIssuance = false; - object.allowConfigBasedIssuance = false; - } - if (message.allowCsrBasedIssuance != null && message.hasOwnProperty("allowCsrBasedIssuance")) - object.allowCsrBasedIssuance = message.allowCsrBasedIssuance; - if (message.allowConfigBasedIssuance != null && message.hasOwnProperty("allowConfigBasedIssuance")) - object.allowConfigBasedIssuance = message.allowConfigBasedIssuance; - return object; - }; - - /** - * Converts this IssuanceModes to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @instance - * @returns {Object.} JSON object - */ - IssuanceModes.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IssuanceModes - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IssuanceModes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes"; - }; - - return IssuanceModes; - })(); - - return CertificateAuthorityPolicy; - })(); - - CertificateAuthority.AccessUrls = (function() { - - /** - * Properties of an AccessUrls. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @interface IAccessUrls - * @property {string|null} [caCertificateAccessUrl] AccessUrls caCertificateAccessUrl - * @property {string|null} [crlAccessUrl] AccessUrls crlAccessUrl - */ - - /** - * Constructs a new AccessUrls. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @classdesc Represents an AccessUrls. - * @implements IAccessUrls - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls=} [properties] Properties to set - */ - function AccessUrls(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]]; - } - - /** - * AccessUrls caCertificateAccessUrl. - * @member {string} caCertificateAccessUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @instance - */ - AccessUrls.prototype.caCertificateAccessUrl = ""; - - /** - * AccessUrls crlAccessUrl. - * @member {string} crlAccessUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @instance - */ - AccessUrls.prototype.crlAccessUrl = ""; - - /** - * Creates a new AccessUrls instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls} AccessUrls instance - */ - AccessUrls.create = function create(properties) { - return new AccessUrls(properties); - }; - - /** - * Encodes the specified AccessUrls message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls} message AccessUrls message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessUrls.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.caCertificateAccessUrl != null && Object.hasOwnProperty.call(message, "caCertificateAccessUrl")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.caCertificateAccessUrl); - if (message.crlAccessUrl != null && Object.hasOwnProperty.call(message, "crlAccessUrl")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.crlAccessUrl); - return writer; - }; - - /** - * Encodes the specified AccessUrls message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IAccessUrls} message AccessUrls message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessUrls.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AccessUrls message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls} AccessUrls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessUrls.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.caCertificateAccessUrl = reader.string(); - break; - } - case 2: { - message.crlAccessUrl = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AccessUrls message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls} AccessUrls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessUrls.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AccessUrls message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AccessUrls.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.caCertificateAccessUrl != null && message.hasOwnProperty("caCertificateAccessUrl")) - if (!$util.isString(message.caCertificateAccessUrl)) - return "caCertificateAccessUrl: string expected"; - if (message.crlAccessUrl != null && message.hasOwnProperty("crlAccessUrl")) - if (!$util.isString(message.crlAccessUrl)) - return "crlAccessUrl: string expected"; - return null; - }; - - /** - * Creates an AccessUrls message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls} AccessUrls - */ - AccessUrls.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls(); - if (object.caCertificateAccessUrl != null) - message.caCertificateAccessUrl = String(object.caCertificateAccessUrl); - if (object.crlAccessUrl != null) - message.crlAccessUrl = String(object.crlAccessUrl); - return message; - }; - - /** - * Creates a plain object from an AccessUrls message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls} message AccessUrls - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AccessUrls.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.caCertificateAccessUrl = ""; - object.crlAccessUrl = ""; - } - if (message.caCertificateAccessUrl != null && message.hasOwnProperty("caCertificateAccessUrl")) - object.caCertificateAccessUrl = message.caCertificateAccessUrl; - if (message.crlAccessUrl != null && message.hasOwnProperty("crlAccessUrl")) - object.crlAccessUrl = message.crlAccessUrl; - return object; - }; - - /** - * Converts this AccessUrls to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @instance - * @returns {Object.} JSON object - */ - AccessUrls.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AccessUrls - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AccessUrls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls"; - }; - - return AccessUrls; - })(); - - CertificateAuthority.KeyVersionSpec = (function() { - - /** - * Properties of a KeyVersionSpec. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @interface IKeyVersionSpec - * @property {string|null} [cloudKmsKeyVersion] KeyVersionSpec cloudKmsKeyVersion - * @property {google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|null} [algorithm] KeyVersionSpec algorithm - */ - - /** - * Constructs a new KeyVersionSpec. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority - * @classdesc Represents a KeyVersionSpec. - * @implements IKeyVersionSpec - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec=} [properties] Properties to set - */ - function KeyVersionSpec(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]]; - } - - /** - * KeyVersionSpec cloudKmsKeyVersion. - * @member {string|null|undefined} cloudKmsKeyVersion - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @instance - */ - KeyVersionSpec.prototype.cloudKmsKeyVersion = null; - - /** - * KeyVersionSpec algorithm. - * @member {google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm|null|undefined} algorithm - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @instance - */ - KeyVersionSpec.prototype.algorithm = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * KeyVersionSpec KeyVersion. - * @member {"cloudKmsKeyVersion"|"algorithm"|undefined} KeyVersion - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @instance - */ - Object.defineProperty(KeyVersionSpec.prototype, "KeyVersion", { - get: $util.oneOfGetter($oneOfFields = ["cloudKmsKeyVersion", "algorithm"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new KeyVersionSpec instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec instance - */ - KeyVersionSpec.create = function create(properties) { - return new KeyVersionSpec(properties); - }; - - /** - * Encodes the specified KeyVersionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec} message KeyVersionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyVersionSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cloudKmsKeyVersion != null && Object.hasOwnProperty.call(message, "cloudKmsKeyVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudKmsKeyVersion); - if (message.algorithm != null && Object.hasOwnProperty.call(message, "algorithm")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.algorithm); - return writer; - }; - - /** - * Encodes the specified KeyVersionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.IKeyVersionSpec} message KeyVersionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyVersionSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyVersionSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyVersionSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cloudKmsKeyVersion = reader.string(); - break; - } - case 2: { - message.algorithm = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyVersionSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyVersionSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyVersionSpec message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyVersionSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cloudKmsKeyVersion != null && message.hasOwnProperty("cloudKmsKeyVersion")) { - properties.KeyVersion = 1; - if (!$util.isString(message.cloudKmsKeyVersion)) - return "cloudKmsKeyVersion: string expected"; - } - if (message.algorithm != null && message.hasOwnProperty("algorithm")) { - if (properties.KeyVersion === 1) - return "KeyVersion: multiple values"; - properties.KeyVersion = 1; - switch (message.algorithm) { - default: - return "algorithm: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 6: - case 7: - case 8: - case 4: - case 5: - break; - } - } - return null; - }; - - /** - * Creates a KeyVersionSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec} KeyVersionSpec - */ - KeyVersionSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec(); - if (object.cloudKmsKeyVersion != null) - message.cloudKmsKeyVersion = String(object.cloudKmsKeyVersion); - switch (object.algorithm) { - default: - if (typeof object.algorithm === "number") { - message.algorithm = object.algorithm; - break; - } - break; - case "SIGN_HASH_ALGORITHM_UNSPECIFIED": - case 0: - message.algorithm = 0; - break; - case "RSA_PSS_2048_SHA256": - case 1: - message.algorithm = 1; - break; - case "RSA_PSS_3072_SHA256": - case 2: - message.algorithm = 2; - break; - case "RSA_PSS_4096_SHA256": - case 3: - message.algorithm = 3; - break; - case "RSA_PKCS1_2048_SHA256": - case 6: - message.algorithm = 6; - break; - case "RSA_PKCS1_3072_SHA256": - case 7: - message.algorithm = 7; - break; - case "RSA_PKCS1_4096_SHA256": - case 8: - message.algorithm = 8; - break; - case "EC_P256_SHA256": - case 4: - message.algorithm = 4; - break; - case "EC_P384_SHA384": - case 5: - message.algorithm = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from a KeyVersionSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec} message KeyVersionSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyVersionSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.cloudKmsKeyVersion != null && message.hasOwnProperty("cloudKmsKeyVersion")) { - object.cloudKmsKeyVersion = message.cloudKmsKeyVersion; - if (options.oneofs) - object.KeyVersion = "cloudKmsKeyVersion"; - } - if (message.algorithm != null && message.hasOwnProperty("algorithm")) { - object.algorithm = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm[message.algorithm] === undefined ? message.algorithm : $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm[message.algorithm] : message.algorithm; - if (options.oneofs) - object.KeyVersion = "algorithm"; - } - return object; - }; - - /** - * Converts this KeyVersionSpec to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @instance - * @returns {Object.} JSON object - */ - KeyVersionSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyVersionSpec - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyVersionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec"; - }; - - return KeyVersionSpec; - })(); - - /** - * Type enum. - * @name google.cloud.security.privateca.v1beta1.CertificateAuthority.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} SELF_SIGNED=1 SELF_SIGNED value - * @property {number} SUBORDINATE=2 SUBORDINATE value - */ - CertificateAuthority.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SELF_SIGNED"] = 1; - values[valuesById[2] = "SUBORDINATE"] = 2; - return values; - })(); - - /** - * Tier enum. - * @name google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier - * @enum {number} - * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value - * @property {number} ENTERPRISE=1 ENTERPRISE value - * @property {number} DEVOPS=2 DEVOPS value - */ - CertificateAuthority.Tier = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENTERPRISE"] = 1; - values[valuesById[2] = "DEVOPS"] = 2; - return values; - })(); - - /** - * State enum. - * @name google.cloud.security.privateca.v1beta1.CertificateAuthority.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ENABLED=1 ENABLED value - * @property {number} DISABLED=2 DISABLED value - * @property {number} PENDING_ACTIVATION=3 PENDING_ACTIVATION value - * @property {number} PENDING_DELETION=4 PENDING_DELETION value - */ - CertificateAuthority.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENABLED"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - values[valuesById[3] = "PENDING_ACTIVATION"] = 3; - values[valuesById[4] = "PENDING_DELETION"] = 4; - return values; - })(); - - /** - * SignHashAlgorithm enum. - * @name google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm - * @enum {number} - * @property {number} SIGN_HASH_ALGORITHM_UNSPECIFIED=0 SIGN_HASH_ALGORITHM_UNSPECIFIED value - * @property {number} RSA_PSS_2048_SHA256=1 RSA_PSS_2048_SHA256 value - * @property {number} RSA_PSS_3072_SHA256=2 RSA_PSS_3072_SHA256 value - * @property {number} RSA_PSS_4096_SHA256=3 RSA_PSS_4096_SHA256 value - * @property {number} RSA_PKCS1_2048_SHA256=6 RSA_PKCS1_2048_SHA256 value - * @property {number} RSA_PKCS1_3072_SHA256=7 RSA_PKCS1_3072_SHA256 value - * @property {number} RSA_PKCS1_4096_SHA256=8 RSA_PKCS1_4096_SHA256 value - * @property {number} EC_P256_SHA256=4 EC_P256_SHA256 value - * @property {number} EC_P384_SHA384=5 EC_P384_SHA384 value - */ - CertificateAuthority.SignHashAlgorithm = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SIGN_HASH_ALGORITHM_UNSPECIFIED"] = 0; - values[valuesById[1] = "RSA_PSS_2048_SHA256"] = 1; - values[valuesById[2] = "RSA_PSS_3072_SHA256"] = 2; - values[valuesById[3] = "RSA_PSS_4096_SHA256"] = 3; - values[valuesById[6] = "RSA_PKCS1_2048_SHA256"] = 6; - values[valuesById[7] = "RSA_PKCS1_3072_SHA256"] = 7; - values[valuesById[8] = "RSA_PKCS1_4096_SHA256"] = 8; - values[valuesById[4] = "EC_P256_SHA256"] = 4; - values[valuesById[5] = "EC_P384_SHA384"] = 5; - return values; - })(); - - return CertificateAuthority; - })(); - - v1beta1.CertificateRevocationList = (function() { - - /** - * Properties of a CertificateRevocationList. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface ICertificateRevocationList - * @property {string|null} [name] CertificateRevocationList name - * @property {number|Long|null} [sequenceNumber] CertificateRevocationList sequenceNumber - * @property {Array.|null} [revokedCertificates] CertificateRevocationList revokedCertificates - * @property {string|null} [pemCrl] CertificateRevocationList pemCrl - * @property {string|null} [accessUrl] CertificateRevocationList accessUrl - * @property {google.cloud.security.privateca.v1beta1.CertificateRevocationList.State|null} [state] CertificateRevocationList state - * @property {google.protobuf.ITimestamp|null} [createTime] CertificateRevocationList createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateRevocationList updateTime - * @property {Object.|null} [labels] CertificateRevocationList labels - */ - - /** - * Constructs a new CertificateRevocationList. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a CertificateRevocationList. - * @implements ICertificateRevocationList - * @constructor - * @param {google.cloud.security.privateca.v1beta1.ICertificateRevocationList=} [properties] Properties to set - */ - function CertificateRevocationList(properties) { - this.revokedCertificates = []; - 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]]; - } - - /** - * CertificateRevocationList name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.name = ""; - - /** - * CertificateRevocationList sequenceNumber. - * @member {number|Long} sequenceNumber - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * CertificateRevocationList revokedCertificates. - * @member {Array.} revokedCertificates - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.revokedCertificates = $util.emptyArray; - - /** - * CertificateRevocationList pemCrl. - * @member {string} pemCrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.pemCrl = ""; - - /** - * CertificateRevocationList accessUrl. - * @member {string} accessUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.accessUrl = ""; - - /** - * CertificateRevocationList state. - * @member {google.cloud.security.privateca.v1beta1.CertificateRevocationList.State} state - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.state = 0; - - /** - * CertificateRevocationList createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.createTime = null; - - /** - * CertificateRevocationList updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.updateTime = null; - - /** - * CertificateRevocationList labels. - * @member {Object.} labels - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @instance - */ - CertificateRevocationList.prototype.labels = $util.emptyObject; - - /** - * Creates a new CertificateRevocationList instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateRevocationList=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList} CertificateRevocationList instance - */ - CertificateRevocationList.create = function create(properties) { - return new CertificateRevocationList(properties); - }; - - /** - * Encodes the specified CertificateRevocationList message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateRevocationList} message CertificateRevocationList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateRevocationList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sequenceNumber); - if (message.revokedCertificates != null && message.revokedCertificates.length) - for (var i = 0; i < message.revokedCertificates.length; ++i) - $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.encode(message.revokedCertificates[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.pemCrl != null && Object.hasOwnProperty.call(message, "pemCrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pemCrl); - if (message.accessUrl != null && Object.hasOwnProperty.call(message, "accessUrl")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.accessUrl); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified CertificateRevocationList message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateRevocationList} message CertificateRevocationList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateRevocationList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateRevocationList message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList} CertificateRevocationList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateRevocationList.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.sequenceNumber = reader.int64(); - break; - } - case 3: { - if (!(message.revokedCertificates && message.revokedCertificates.length)) - message.revokedCertificates = []; - message.revokedCertificates.push($root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.decode(reader, reader.uint32())); - break; - } - case 4: { - message.pemCrl = reader.string(); - break; - } - case 5: { - message.accessUrl = reader.string(); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateRevocationList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList} CertificateRevocationList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateRevocationList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateRevocationList message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateRevocationList.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.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) - if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) - return "sequenceNumber: integer|Long expected"; - if (message.revokedCertificates != null && message.hasOwnProperty("revokedCertificates")) { - if (!Array.isArray(message.revokedCertificates)) - return "revokedCertificates: array expected"; - for (var i = 0; i < message.revokedCertificates.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.verify(message.revokedCertificates[i]); - if (error) - return "revokedCertificates." + error; - } - } - if (message.pemCrl != null && message.hasOwnProperty("pemCrl")) - if (!$util.isString(message.pemCrl)) - return "pemCrl: string expected"; - if (message.accessUrl != null && message.hasOwnProperty("accessUrl")) - if (!$util.isString(message.accessUrl)) - return "accessUrl: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a CertificateRevocationList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList} CertificateRevocationList - */ - CertificateRevocationList.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList(); - if (object.name != null) - message.name = String(object.name); - if (object.sequenceNumber != null) - if ($util.Long) - (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; - else if (typeof object.sequenceNumber === "string") - message.sequenceNumber = parseInt(object.sequenceNumber, 10); - else if (typeof object.sequenceNumber === "number") - message.sequenceNumber = object.sequenceNumber; - else if (typeof object.sequenceNumber === "object") - message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); - if (object.revokedCertificates) { - if (!Array.isArray(object.revokedCertificates)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateRevocationList.revokedCertificates: array expected"); - message.revokedCertificates = []; - for (var i = 0; i < object.revokedCertificates.length; ++i) { - if (typeof object.revokedCertificates[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateRevocationList.revokedCertificates: object expected"); - message.revokedCertificates[i] = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.fromObject(object.revokedCertificates[i]); - } - } - if (object.pemCrl != null) - message.pemCrl = String(object.pemCrl); - if (object.accessUrl != null) - message.accessUrl = String(object.accessUrl); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "SUPERSEDED": - case 2: - message.state = 2; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateRevocationList.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateRevocationList.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateRevocationList.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 CertificateRevocationList message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList} message CertificateRevocationList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateRevocationList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.revokedCertificates = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequenceNumber = options.longs === String ? "0" : 0; - object.pemCrl = ""; - object.accessUrl = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) - if (typeof message.sequenceNumber === "number") - object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; - else - object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; - if (message.revokedCertificates && message.revokedCertificates.length) { - object.revokedCertificates = []; - for (var j = 0; j < message.revokedCertificates.length; ++j) - object.revokedCertificates[j] = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.toObject(message.revokedCertificates[j], options); - } - if (message.pemCrl != null && message.hasOwnProperty("pemCrl")) - object.pemCrl = message.pemCrl; - if (message.accessUrl != null && message.hasOwnProperty("accessUrl")) - object.accessUrl = message.accessUrl; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.State[message.state] === undefined ? message.state : $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - return object; - }; - - /** - * Converts this CertificateRevocationList to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @instance - * @returns {Object.} JSON object - */ - CertificateRevocationList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateRevocationList - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateRevocationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateRevocationList"; - }; - - CertificateRevocationList.RevokedCertificate = (function() { - - /** - * Properties of a RevokedCertificate. - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @interface IRevokedCertificate - * @property {string|null} [certificate] RevokedCertificate certificate - * @property {string|null} [hexSerialNumber] RevokedCertificate hexSerialNumber - * @property {google.cloud.security.privateca.v1beta1.RevocationReason|null} [revocationReason] RevokedCertificate revocationReason - */ - - /** - * Constructs a new RevokedCertificate. - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList - * @classdesc Represents a RevokedCertificate. - * @implements IRevokedCertificate - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate=} [properties] Properties to set - */ - function RevokedCertificate(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]]; - } - - /** - * RevokedCertificate certificate. - * @member {string} certificate - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @instance - */ - RevokedCertificate.prototype.certificate = ""; - - /** - * RevokedCertificate hexSerialNumber. - * @member {string} hexSerialNumber - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @instance - */ - RevokedCertificate.prototype.hexSerialNumber = ""; - - /** - * RevokedCertificate revocationReason. - * @member {google.cloud.security.privateca.v1beta1.RevocationReason} revocationReason - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @instance - */ - RevokedCertificate.prototype.revocationReason = 0; - - /** - * Creates a new RevokedCertificate instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate} RevokedCertificate instance - */ - RevokedCertificate.create = function create(properties) { - return new RevokedCertificate(properties); - }; - - /** - * Encodes the specified RevokedCertificate message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate} message RevokedCertificate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevokedCertificate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificate); - if (message.hexSerialNumber != null && Object.hasOwnProperty.call(message, "hexSerialNumber")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.hexSerialNumber); - if (message.revocationReason != null && Object.hasOwnProperty.call(message, "revocationReason")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.revocationReason); - return writer; - }; - - /** - * Encodes the specified RevokedCertificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList.IRevokedCertificate} message RevokedCertificate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevokedCertificate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevokedCertificate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate} RevokedCertificate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevokedCertificate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.certificate = reader.string(); - break; - } - case 2: { - message.hexSerialNumber = reader.string(); - break; - } - case 3: { - message.revocationReason = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevokedCertificate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate} RevokedCertificate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevokedCertificate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevokedCertificate message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevokedCertificate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificate != null && message.hasOwnProperty("certificate")) - if (!$util.isString(message.certificate)) - return "certificate: string expected"; - if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) - if (!$util.isString(message.hexSerialNumber)) - return "hexSerialNumber: string expected"; - if (message.revocationReason != null && message.hasOwnProperty("revocationReason")) - switch (message.revocationReason) { - default: - return "revocationReason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - return null; - }; - - /** - * Creates a RevokedCertificate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate} RevokedCertificate - */ - RevokedCertificate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate(); - if (object.certificate != null) - message.certificate = String(object.certificate); - if (object.hexSerialNumber != null) - message.hexSerialNumber = String(object.hexSerialNumber); - switch (object.revocationReason) { - default: - if (typeof object.revocationReason === "number") { - message.revocationReason = object.revocationReason; - break; - } - break; - case "REVOCATION_REASON_UNSPECIFIED": - case 0: - message.revocationReason = 0; - break; - case "KEY_COMPROMISE": - case 1: - message.revocationReason = 1; - break; - case "CERTIFICATE_AUTHORITY_COMPROMISE": - case 2: - message.revocationReason = 2; - break; - case "AFFILIATION_CHANGED": - case 3: - message.revocationReason = 3; - break; - case "SUPERSEDED": - case 4: - message.revocationReason = 4; - break; - case "CESSATION_OF_OPERATION": - case 5: - message.revocationReason = 5; - break; - case "CERTIFICATE_HOLD": - case 6: - message.revocationReason = 6; - break; - case "PRIVILEGE_WITHDRAWN": - case 7: - message.revocationReason = 7; - break; - case "ATTRIBUTE_AUTHORITY_COMPROMISE": - case 8: - message.revocationReason = 8; - break; - } - return message; - }; - - /** - * Creates a plain object from a RevokedCertificate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate} message RevokedCertificate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevokedCertificate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.certificate = ""; - object.hexSerialNumber = ""; - object.revocationReason = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; - } - if (message.certificate != null && message.hasOwnProperty("certificate")) - object.certificate = message.certificate; - if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) - object.hexSerialNumber = message.hexSerialNumber; - if (message.revocationReason != null && message.hasOwnProperty("revocationReason")) - object.revocationReason = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.revocationReason] === undefined ? message.revocationReason : $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.revocationReason] : message.revocationReason; - return object; - }; - - /** - * Converts this RevokedCertificate to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @instance - * @returns {Object.} JSON object - */ - RevokedCertificate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevokedCertificate - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevokedCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate"; - }; - - return RevokedCertificate; - })(); - - /** - * State enum. - * @name google.cloud.security.privateca.v1beta1.CertificateRevocationList.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} SUPERSEDED=2 SUPERSEDED value - */ - CertificateRevocationList.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "SUPERSEDED"] = 2; - return values; - })(); - - return CertificateRevocationList; - })(); - - v1beta1.Certificate = (function() { - - /** - * Properties of a Certificate. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface ICertificate - * @property {string|null} [name] Certificate name - * @property {string|null} [pemCsr] Certificate pemCsr - * @property {google.cloud.security.privateca.v1beta1.ICertificateConfig|null} [config] Certificate config - * @property {google.protobuf.IDuration|null} [lifetime] Certificate lifetime - * @property {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails|null} [revocationDetails] Certificate revocationDetails - * @property {string|null} [pemCertificate] Certificate pemCertificate - * @property {google.cloud.security.privateca.v1beta1.ICertificateDescription|null} [certificateDescription] Certificate certificateDescription - * @property {Array.|null} [pemCertificateChain] Certificate pemCertificateChain - * @property {google.protobuf.ITimestamp|null} [createTime] Certificate createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Certificate updateTime - * @property {Object.|null} [labels] Certificate labels - */ - - /** - * Constructs a new Certificate. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a Certificate. - * @implements ICertificate - * @constructor - * @param {google.cloud.security.privateca.v1beta1.ICertificate=} [properties] Properties to set - */ - function Certificate(properties) { - this.pemCertificateChain = []; - 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]]; - } - - /** - * Certificate name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Certificate.prototype.name = ""; - - /** - * Certificate pemCsr. - * @member {string|null|undefined} pemCsr - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Certificate.prototype.pemCsr = null; - - /** - * Certificate config. - * @member {google.cloud.security.privateca.v1beta1.ICertificateConfig|null|undefined} config - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Certificate.prototype.config = null; - - /** - * Certificate lifetime. - * @member {google.protobuf.IDuration|null|undefined} lifetime - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Certificate.prototype.lifetime = null; - - /** - * Certificate revocationDetails. - * @member {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails|null|undefined} revocationDetails - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Certificate.prototype.revocationDetails = null; - - /** - * Certificate pemCertificate. - * @member {string} pemCertificate - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Certificate.prototype.pemCertificate = ""; - - /** - * Certificate certificateDescription. - * @member {google.cloud.security.privateca.v1beta1.ICertificateDescription|null|undefined} certificateDescription - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Certificate.prototype.certificateDescription = null; - - /** - * Certificate pemCertificateChain. - * @member {Array.} pemCertificateChain - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Certificate.prototype.pemCertificateChain = $util.emptyArray; - - /** - * Certificate createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Certificate.prototype.createTime = null; - - /** - * Certificate updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Certificate.prototype.updateTime = null; - - /** - * Certificate labels. - * @member {Object.} labels - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Certificate.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Certificate certificateConfig. - * @member {"pemCsr"|"config"|undefined} certificateConfig - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - */ - Object.defineProperty(Certificate.prototype, "certificateConfig", { - get: $util.oneOfGetter($oneOfFields = ["pemCsr", "config"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Certificate instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificate=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.Certificate} Certificate instance - */ - Certificate.create = function create(properties) { - return new Certificate(properties); - }; - - /** - * Encodes the specified Certificate message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificate} message Certificate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Certificate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCsr); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.security.privateca.v1beta1.CertificateConfig.encode(message.config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) - $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.revocationDetails != null && Object.hasOwnProperty.call(message, "revocationDetails")) - $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.encode(message.revocationDetails, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pemCertificate); - if (message.certificateDescription != null && Object.hasOwnProperty.call(message, "certificateDescription")) - $root.google.cloud.security.privateca.v1beta1.CertificateDescription.encode(message.certificateDescription, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.pemCertificateChain != null && message.pemCertificateChain.length) - for (var i = 0; i < message.pemCertificateChain.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pemCertificateChain[i]); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified Certificate message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificate} message Certificate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Certificate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Certificate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.Certificate} Certificate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Certificate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.Certificate(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.pemCsr = reader.string(); - break; - } - case 3: { - message.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.revocationDetails = $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.decode(reader, reader.uint32()); - break; - } - case 6: { - message.pemCertificate = reader.string(); - break; - } - case 7: { - message.certificateDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.decode(reader, reader.uint32()); - break; - } - case 8: { - if (!(message.pemCertificateChain && message.pemCertificateChain.length)) - message.pemCertificateChain = []; - message.pemCertificateChain.push(reader.string()); - break; - } - case 9: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Certificate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.Certificate} Certificate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Certificate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Certificate message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Certificate.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.pemCsr != null && message.hasOwnProperty("pemCsr")) { - properties.certificateConfig = 1; - if (!$util.isString(message.pemCsr)) - return "pemCsr: string expected"; - } - if (message.config != null && message.hasOwnProperty("config")) { - if (properties.certificateConfig === 1) - return "certificateConfig: multiple values"; - properties.certificateConfig = 1; - { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.verify(message.config); - if (error) - return "config." + error; - } - } - if (message.lifetime != null && message.hasOwnProperty("lifetime")) { - var error = $root.google.protobuf.Duration.verify(message.lifetime); - if (error) - return "lifetime." + error; - } - if (message.revocationDetails != null && message.hasOwnProperty("revocationDetails")) { - var error = $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.verify(message.revocationDetails); - if (error) - return "revocationDetails." + error; - } - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - if (!$util.isString(message.pemCertificate)) - return "pemCertificate: string expected"; - if (message.certificateDescription != null && message.hasOwnProperty("certificateDescription")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.verify(message.certificateDescription); - if (error) - return "certificateDescription." + error; - } - if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { - if (!Array.isArray(message.pemCertificateChain)) - return "pemCertificateChain: array expected"; - for (var i = 0; i < message.pemCertificateChain.length; ++i) - if (!$util.isString(message.pemCertificateChain[i])) - return "pemCertificateChain: string[] expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.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 Certificate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.Certificate} Certificate - */ - Certificate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.Certificate) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.Certificate(); - if (object.name != null) - message.name = String(object.name); - if (object.pemCsr != null) - message.pemCsr = String(object.pemCsr); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.config: object expected"); - message.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.fromObject(object.config); - } - if (object.lifetime != null) { - if (typeof object.lifetime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.lifetime: object expected"); - message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); - } - if (object.revocationDetails != null) { - if (typeof object.revocationDetails !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.revocationDetails: object expected"); - message.revocationDetails = $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.fromObject(object.revocationDetails); - } - if (object.pemCertificate != null) - message.pemCertificate = String(object.pemCertificate); - if (object.certificateDescription != null) { - if (typeof object.certificateDescription !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.certificateDescription: object expected"); - message.certificateDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.fromObject(object.certificateDescription); - } - if (object.pemCertificateChain) { - if (!Array.isArray(object.pemCertificateChain)) - throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.pemCertificateChain: array expected"); - message.pemCertificateChain = []; - for (var i = 0; i < object.pemCertificateChain.length; ++i) - message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.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 Certificate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @static - * @param {google.cloud.security.privateca.v1beta1.Certificate} message Certificate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Certificate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pemCertificateChain = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.lifetime = null; - object.revocationDetails = null; - object.pemCertificate = ""; - object.certificateDescription = null; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) { - object.pemCsr = message.pemCsr; - if (options.oneofs) - object.certificateConfig = "pemCsr"; - } - if (message.config != null && message.hasOwnProperty("config")) { - object.config = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.toObject(message.config, options); - if (options.oneofs) - object.certificateConfig = "config"; - } - if (message.lifetime != null && message.hasOwnProperty("lifetime")) - object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); - if (message.revocationDetails != null && message.hasOwnProperty("revocationDetails")) - object.revocationDetails = $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.toObject(message.revocationDetails, options); - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - object.pemCertificate = message.pemCertificate; - if (message.certificateDescription != null && message.hasOwnProperty("certificateDescription")) - object.certificateDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.toObject(message.certificateDescription, options); - if (message.pemCertificateChain && message.pemCertificateChain.length) { - object.pemCertificateChain = []; - for (var j = 0; j < message.pemCertificateChain.length; ++j) - object.pemCertificateChain[j] = message.pemCertificateChain[j]; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - return object; - }; - - /** - * Converts this Certificate to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @instance - * @returns {Object.} JSON object - */ - Certificate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Certificate - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Certificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.Certificate"; - }; - - Certificate.RevocationDetails = (function() { - - /** - * Properties of a RevocationDetails. - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @interface IRevocationDetails - * @property {google.cloud.security.privateca.v1beta1.RevocationReason|null} [revocationState] RevocationDetails revocationState - * @property {google.protobuf.ITimestamp|null} [revocationTime] RevocationDetails revocationTime - */ - - /** - * Constructs a new RevocationDetails. - * @memberof google.cloud.security.privateca.v1beta1.Certificate - * @classdesc Represents a RevocationDetails. - * @implements IRevocationDetails - * @constructor - * @param {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails=} [properties] Properties to set - */ - function RevocationDetails(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]]; - } - - /** - * RevocationDetails revocationState. - * @member {google.cloud.security.privateca.v1beta1.RevocationReason} revocationState - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @instance - */ - RevocationDetails.prototype.revocationState = 0; - - /** - * RevocationDetails revocationTime. - * @member {google.protobuf.ITimestamp|null|undefined} revocationTime - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @instance - */ - RevocationDetails.prototype.revocationTime = null; - - /** - * Creates a new RevocationDetails instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @static - * @param {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails} RevocationDetails instance - */ - RevocationDetails.create = function create(properties) { - return new RevocationDetails(properties); - }; - - /** - * Encodes the specified RevocationDetails message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @static - * @param {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails} message RevocationDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevocationDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revocationState != null && Object.hasOwnProperty.call(message, "revocationState")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revocationState); - if (message.revocationTime != null && Object.hasOwnProperty.call(message, "revocationTime")) - $root.google.protobuf.Timestamp.encode(message.revocationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RevocationDetails message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @static - * @param {google.cloud.security.privateca.v1beta1.Certificate.IRevocationDetails} message RevocationDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevocationDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevocationDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails} RevocationDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevocationDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revocationState = reader.int32(); - break; - } - case 2: { - message.revocationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevocationDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails} RevocationDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevocationDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevocationDetails message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevocationDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revocationState != null && message.hasOwnProperty("revocationState")) - switch (message.revocationState) { - default: - return "revocationState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.revocationTime != null && message.hasOwnProperty("revocationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.revocationTime); - if (error) - return "revocationTime." + error; - } - return null; - }; - - /** - * Creates a RevocationDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails} RevocationDetails - */ - RevocationDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails(); - switch (object.revocationState) { - default: - if (typeof object.revocationState === "number") { - message.revocationState = object.revocationState; - break; - } - break; - case "REVOCATION_REASON_UNSPECIFIED": - case 0: - message.revocationState = 0; - break; - case "KEY_COMPROMISE": - case 1: - message.revocationState = 1; - break; - case "CERTIFICATE_AUTHORITY_COMPROMISE": - case 2: - message.revocationState = 2; - break; - case "AFFILIATION_CHANGED": - case 3: - message.revocationState = 3; - break; - case "SUPERSEDED": - case 4: - message.revocationState = 4; - break; - case "CESSATION_OF_OPERATION": - case 5: - message.revocationState = 5; - break; - case "CERTIFICATE_HOLD": - case 6: - message.revocationState = 6; - break; - case "PRIVILEGE_WITHDRAWN": - case 7: - message.revocationState = 7; - break; - case "ATTRIBUTE_AUTHORITY_COMPROMISE": - case 8: - message.revocationState = 8; - break; - } - if (object.revocationTime != null) { - if (typeof object.revocationTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails.revocationTime: object expected"); - message.revocationTime = $root.google.protobuf.Timestamp.fromObject(object.revocationTime); - } - return message; - }; - - /** - * Creates a plain object from a RevocationDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @static - * @param {google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails} message RevocationDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevocationDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.revocationState = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; - object.revocationTime = null; - } - if (message.revocationState != null && message.hasOwnProperty("revocationState")) - object.revocationState = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.revocationState] === undefined ? message.revocationState : $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.revocationState] : message.revocationState; - if (message.revocationTime != null && message.hasOwnProperty("revocationTime")) - object.revocationTime = $root.google.protobuf.Timestamp.toObject(message.revocationTime, options); - return object; - }; - - /** - * Converts this RevocationDetails to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @instance - * @returns {Object.} JSON object - */ - RevocationDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevocationDetails - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevocationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails"; - }; - - return RevocationDetails; - })(); - - return Certificate; - })(); - - v1beta1.ReusableConfig = (function() { - - /** - * Properties of a ReusableConfig. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IReusableConfig - * @property {string|null} [name] ReusableConfig name - * @property {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null} [values] ReusableConfig values - * @property {string|null} [description] ReusableConfig description - * @property {google.protobuf.ITimestamp|null} [createTime] ReusableConfig createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ReusableConfig updateTime - * @property {Object.|null} [labels] ReusableConfig labels - */ - - /** - * Constructs a new ReusableConfig. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ReusableConfig. - * @implements IReusableConfig - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IReusableConfig=} [properties] Properties to set - */ - function ReusableConfig(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]]; - } - - /** - * ReusableConfig name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @instance - */ - ReusableConfig.prototype.name = ""; - - /** - * ReusableConfig values. - * @member {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null|undefined} values - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @instance - */ - ReusableConfig.prototype.values = null; - - /** - * ReusableConfig description. - * @member {string} description - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @instance - */ - ReusableConfig.prototype.description = ""; - - /** - * ReusableConfig createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @instance - */ - ReusableConfig.prototype.createTime = null; - - /** - * ReusableConfig updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @instance - */ - ReusableConfig.prototype.updateTime = null; - - /** - * ReusableConfig labels. - * @member {Object.} labels - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @instance - */ - ReusableConfig.prototype.labels = $util.emptyObject; - - /** - * Creates a new ReusableConfig instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.IReusableConfig=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfig} ReusableConfig instance - */ - ReusableConfig.create = function create(properties) { - return new ReusableConfig(properties); - }; - - /** - * Encodes the specified ReusableConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.IReusableConfig} message ReusableConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReusableConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.values != null && Object.hasOwnProperty.call(message, "values")) - $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.encode(message.values, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReusableConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.IReusableConfig} message ReusableConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReusableConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReusableConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfig} ReusableConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReusableConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.values = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.decode(reader, reader.uint32()); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReusableConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfig} ReusableConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReusableConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReusableConfig message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReusableConfig.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.values != null && message.hasOwnProperty("values")) { - var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify(message.values); - if (error) - return "values." + error; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.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 ReusableConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfig} ReusableConfig - */ - ReusableConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ReusableConfig) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfig(); - if (object.name != null) - message.name = String(object.name); - if (object.values != null) { - if (typeof object.values !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfig.values: object expected"); - message.values = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.fromObject(object.values); - } - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfig.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfig.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfig.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 ReusableConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.ReusableConfig} message ReusableConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReusableConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.values = null; - object.description = ""; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.values != null && message.hasOwnProperty("values")) - object.values = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.toObject(message.values, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - 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]]; - } - return object; - }; - - /** - * Converts this ReusableConfig to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @instance - * @returns {Object.} JSON object - */ - ReusableConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReusableConfig - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReusableConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ReusableConfig"; - }; - - return ReusableConfig; - })(); - - v1beta1.ReusableConfigValues = (function() { - - /** - * Properties of a ReusableConfigValues. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IReusableConfigValues - * @property {google.cloud.security.privateca.v1beta1.IKeyUsage|null} [keyUsage] ReusableConfigValues keyUsage - * @property {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions|null} [caOptions] ReusableConfigValues caOptions - * @property {Array.|null} [policyIds] ReusableConfigValues policyIds - * @property {Array.|null} [aiaOcspServers] ReusableConfigValues aiaOcspServers - * @property {Array.|null} [additionalExtensions] ReusableConfigValues additionalExtensions - */ - - /** - * Constructs a new ReusableConfigValues. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ReusableConfigValues. - * @implements IReusableConfigValues - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IReusableConfigValues=} [properties] Properties to set - */ - function ReusableConfigValues(properties) { - this.policyIds = []; - this.aiaOcspServers = []; - this.additionalExtensions = []; - 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]]; - } - - /** - * ReusableConfigValues keyUsage. - * @member {google.cloud.security.privateca.v1beta1.IKeyUsage|null|undefined} keyUsage - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @instance - */ - ReusableConfigValues.prototype.keyUsage = null; - - /** - * ReusableConfigValues caOptions. - * @member {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions|null|undefined} caOptions - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @instance - */ - ReusableConfigValues.prototype.caOptions = null; - - /** - * ReusableConfigValues policyIds. - * @member {Array.} policyIds - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @instance - */ - ReusableConfigValues.prototype.policyIds = $util.emptyArray; - - /** - * ReusableConfigValues aiaOcspServers. - * @member {Array.} aiaOcspServers - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @instance - */ - ReusableConfigValues.prototype.aiaOcspServers = $util.emptyArray; - - /** - * ReusableConfigValues additionalExtensions. - * @member {Array.} additionalExtensions - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @instance - */ - ReusableConfigValues.prototype.additionalExtensions = $util.emptyArray; - - /** - * Creates a new ReusableConfigValues instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @static - * @param {google.cloud.security.privateca.v1beta1.IReusableConfigValues=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues} ReusableConfigValues instance - */ - ReusableConfigValues.create = function create(properties) { - return new ReusableConfigValues(properties); - }; - - /** - * Encodes the specified ReusableConfigValues message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @static - * @param {google.cloud.security.privateca.v1beta1.IReusableConfigValues} message ReusableConfigValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReusableConfigValues.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyUsage != null && Object.hasOwnProperty.call(message, "keyUsage")) - $root.google.cloud.security.privateca.v1beta1.KeyUsage.encode(message.keyUsage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.caOptions != null && Object.hasOwnProperty.call(message, "caOptions")) - $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.encode(message.caOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.policyIds != null && message.policyIds.length) - for (var i = 0; i < message.policyIds.length; ++i) - $root.google.cloud.security.privateca.v1beta1.ObjectId.encode(message.policyIds[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.aiaOcspServers != null && message.aiaOcspServers.length) - for (var i = 0; i < message.aiaOcspServers.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.aiaOcspServers[i]); - if (message.additionalExtensions != null && message.additionalExtensions.length) - for (var i = 0; i < message.additionalExtensions.length; ++i) - $root.google.cloud.security.privateca.v1beta1.X509Extension.encode(message.additionalExtensions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReusableConfigValues message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @static - * @param {google.cloud.security.privateca.v1beta1.IReusableConfigValues} message ReusableConfigValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReusableConfigValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReusableConfigValues message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues} ReusableConfigValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReusableConfigValues.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.keyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.decode(reader, reader.uint32()); - break; - } - case 2: { - message.caOptions = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.policyIds && message.policyIds.length)) - message.policyIds = []; - message.policyIds.push($root.google.cloud.security.privateca.v1beta1.ObjectId.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.aiaOcspServers && message.aiaOcspServers.length)) - message.aiaOcspServers = []; - message.aiaOcspServers.push(reader.string()); - break; - } - case 5: { - if (!(message.additionalExtensions && message.additionalExtensions.length)) - message.additionalExtensions = []; - message.additionalExtensions.push($root.google.cloud.security.privateca.v1beta1.X509Extension.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReusableConfigValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues} ReusableConfigValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReusableConfigValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReusableConfigValues message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReusableConfigValues.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyUsage != null && message.hasOwnProperty("keyUsage")) { - var error = $root.google.cloud.security.privateca.v1beta1.KeyUsage.verify(message.keyUsage); - if (error) - return "keyUsage." + error; - } - if (message.caOptions != null && message.hasOwnProperty("caOptions")) { - var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.verify(message.caOptions); - if (error) - return "caOptions." + error; - } - if (message.policyIds != null && message.hasOwnProperty("policyIds")) { - if (!Array.isArray(message.policyIds)) - return "policyIds: array expected"; - for (var i = 0; i < message.policyIds.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.ObjectId.verify(message.policyIds[i]); - if (error) - return "policyIds." + error; - } - } - if (message.aiaOcspServers != null && message.hasOwnProperty("aiaOcspServers")) { - if (!Array.isArray(message.aiaOcspServers)) - return "aiaOcspServers: array expected"; - for (var i = 0; i < message.aiaOcspServers.length; ++i) - if (!$util.isString(message.aiaOcspServers[i])) - return "aiaOcspServers: string[] expected"; - } - if (message.additionalExtensions != null && message.hasOwnProperty("additionalExtensions")) { - if (!Array.isArray(message.additionalExtensions)) - return "additionalExtensions: array expected"; - for (var i = 0; i < message.additionalExtensions.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.X509Extension.verify(message.additionalExtensions[i]); - if (error) - return "additionalExtensions." + error; - } - } - return null; - }; - - /** - * Creates a ReusableConfigValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues} ReusableConfigValues - */ - ReusableConfigValues.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues(); - if (object.keyUsage != null) { - if (typeof object.keyUsage !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.keyUsage: object expected"); - message.keyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.fromObject(object.keyUsage); - } - if (object.caOptions != null) { - if (typeof object.caOptions !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.caOptions: object expected"); - message.caOptions = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.fromObject(object.caOptions); - } - if (object.policyIds) { - if (!Array.isArray(object.policyIds)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.policyIds: array expected"); - message.policyIds = []; - for (var i = 0; i < object.policyIds.length; ++i) { - if (typeof object.policyIds[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.policyIds: object expected"); - message.policyIds[i] = $root.google.cloud.security.privateca.v1beta1.ObjectId.fromObject(object.policyIds[i]); - } - } - if (object.aiaOcspServers) { - if (!Array.isArray(object.aiaOcspServers)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.aiaOcspServers: array expected"); - message.aiaOcspServers = []; - for (var i = 0; i < object.aiaOcspServers.length; ++i) - message.aiaOcspServers[i] = String(object.aiaOcspServers[i]); - } - if (object.additionalExtensions) { - if (!Array.isArray(object.additionalExtensions)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.additionalExtensions: array expected"); - message.additionalExtensions = []; - for (var i = 0; i < object.additionalExtensions.length; ++i) { - if (typeof object.additionalExtensions[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.additionalExtensions: object expected"); - message.additionalExtensions[i] = $root.google.cloud.security.privateca.v1beta1.X509Extension.fromObject(object.additionalExtensions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ReusableConfigValues message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @static - * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues} message ReusableConfigValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReusableConfigValues.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.policyIds = []; - object.aiaOcspServers = []; - object.additionalExtensions = []; - } - if (options.defaults) { - object.keyUsage = null; - object.caOptions = null; - } - if (message.keyUsage != null && message.hasOwnProperty("keyUsage")) - object.keyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.toObject(message.keyUsage, options); - if (message.caOptions != null && message.hasOwnProperty("caOptions")) - object.caOptions = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.toObject(message.caOptions, options); - if (message.policyIds && message.policyIds.length) { - object.policyIds = []; - for (var j = 0; j < message.policyIds.length; ++j) - object.policyIds[j] = $root.google.cloud.security.privateca.v1beta1.ObjectId.toObject(message.policyIds[j], options); - } - if (message.aiaOcspServers && message.aiaOcspServers.length) { - object.aiaOcspServers = []; - for (var j = 0; j < message.aiaOcspServers.length; ++j) - object.aiaOcspServers[j] = message.aiaOcspServers[j]; - } - if (message.additionalExtensions && message.additionalExtensions.length) { - object.additionalExtensions = []; - for (var j = 0; j < message.additionalExtensions.length; ++j) - object.additionalExtensions[j] = $root.google.cloud.security.privateca.v1beta1.X509Extension.toObject(message.additionalExtensions[j], options); - } - return object; - }; - - /** - * Converts this ReusableConfigValues to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @instance - * @returns {Object.} JSON object - */ - ReusableConfigValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReusableConfigValues - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReusableConfigValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ReusableConfigValues"; - }; - - ReusableConfigValues.CaOptions = (function() { - - /** - * Properties of a CaOptions. - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @interface ICaOptions - * @property {google.protobuf.IBoolValue|null} [isCa] CaOptions isCa - * @property {google.protobuf.IInt32Value|null} [maxIssuerPathLength] CaOptions maxIssuerPathLength - */ - - /** - * Constructs a new CaOptions. - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues - * @classdesc Represents a CaOptions. - * @implements ICaOptions - * @constructor - * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions=} [properties] Properties to set - */ - function CaOptions(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]]; - } - - /** - * CaOptions isCa. - * @member {google.protobuf.IBoolValue|null|undefined} isCa - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @instance - */ - CaOptions.prototype.isCa = null; - - /** - * CaOptions maxIssuerPathLength. - * @member {google.protobuf.IInt32Value|null|undefined} maxIssuerPathLength - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @instance - */ - CaOptions.prototype.maxIssuerPathLength = null; - - /** - * Creates a new CaOptions instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions} CaOptions instance - */ - CaOptions.create = function create(properties) { - return new CaOptions(properties); - }; - - /** - * Encodes the specified CaOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions} message CaOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.isCa != null && Object.hasOwnProperty.call(message, "isCa")) - $root.google.protobuf.BoolValue.encode(message.isCa, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.maxIssuerPathLength != null && Object.hasOwnProperty.call(message, "maxIssuerPathLength")) - $root.google.protobuf.Int32Value.encode(message.maxIssuerPathLength, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CaOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues.ICaOptions} message CaOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CaOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions} CaOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.isCa = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; - } - case 2: { - message.maxIssuerPathLength = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CaOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions} CaOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CaOptions message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CaOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.isCa != null && message.hasOwnProperty("isCa")) { - var error = $root.google.protobuf.BoolValue.verify(message.isCa); - if (error) - return "isCa." + error; - } - if (message.maxIssuerPathLength != null && message.hasOwnProperty("maxIssuerPathLength")) { - var error = $root.google.protobuf.Int32Value.verify(message.maxIssuerPathLength); - if (error) - return "maxIssuerPathLength." + error; - } - return null; - }; - - /** - * Creates a CaOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions} CaOptions - */ - CaOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions(); - if (object.isCa != null) { - if (typeof object.isCa !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.isCa: object expected"); - message.isCa = $root.google.protobuf.BoolValue.fromObject(object.isCa); - } - if (object.maxIssuerPathLength != null) { - if (typeof object.maxIssuerPathLength !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions.maxIssuerPathLength: object expected"); - message.maxIssuerPathLength = $root.google.protobuf.Int32Value.fromObject(object.maxIssuerPathLength); - } - return message; - }; - - /** - * Creates a plain object from a CaOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions} message CaOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CaOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.isCa = null; - object.maxIssuerPathLength = null; - } - if (message.isCa != null && message.hasOwnProperty("isCa")) - object.isCa = $root.google.protobuf.BoolValue.toObject(message.isCa, options); - if (message.maxIssuerPathLength != null && message.hasOwnProperty("maxIssuerPathLength")) - object.maxIssuerPathLength = $root.google.protobuf.Int32Value.toObject(message.maxIssuerPathLength, options); - return object; - }; - - /** - * Converts this CaOptions to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @instance - * @returns {Object.} JSON object - */ - CaOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CaOptions - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CaOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions"; - }; - - return CaOptions; - })(); - - return ReusableConfigValues; - })(); - - v1beta1.ReusableConfigWrapper = (function() { - - /** - * Properties of a ReusableConfigWrapper. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IReusableConfigWrapper - * @property {string|null} [reusableConfig] ReusableConfigWrapper reusableConfig - * @property {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null} [reusableConfigValues] ReusableConfigWrapper reusableConfigValues - */ - - /** - * Constructs a new ReusableConfigWrapper. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ReusableConfigWrapper. - * @implements IReusableConfigWrapper - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper=} [properties] Properties to set - */ - function ReusableConfigWrapper(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]]; - } - - /** - * ReusableConfigWrapper reusableConfig. - * @member {string|null|undefined} reusableConfig - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @instance - */ - ReusableConfigWrapper.prototype.reusableConfig = null; - - /** - * ReusableConfigWrapper reusableConfigValues. - * @member {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null|undefined} reusableConfigValues - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @instance - */ - ReusableConfigWrapper.prototype.reusableConfigValues = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReusableConfigWrapper configValues. - * @member {"reusableConfig"|"reusableConfigValues"|undefined} configValues - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @instance - */ - Object.defineProperty(ReusableConfigWrapper.prototype, "configValues", { - get: $util.oneOfGetter($oneOfFields = ["reusableConfig", "reusableConfigValues"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ReusableConfigWrapper instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @static - * @param {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigWrapper} ReusableConfigWrapper instance - */ - ReusableConfigWrapper.create = function create(properties) { - return new ReusableConfigWrapper(properties); - }; - - /** - * Encodes the specified ReusableConfigWrapper message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @static - * @param {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper} message ReusableConfigWrapper message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReusableConfigWrapper.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.reusableConfig != null && Object.hasOwnProperty.call(message, "reusableConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.reusableConfig); - if (message.reusableConfigValues != null && Object.hasOwnProperty.call(message, "reusableConfigValues")) - $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.encode(message.reusableConfigValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReusableConfigWrapper message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @static - * @param {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper} message ReusableConfigWrapper message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReusableConfigWrapper.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReusableConfigWrapper message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigWrapper} ReusableConfigWrapper - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReusableConfigWrapper.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.reusableConfig = reader.string(); - break; - } - case 2: { - message.reusableConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReusableConfigWrapper message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigWrapper} ReusableConfigWrapper - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReusableConfigWrapper.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReusableConfigWrapper message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReusableConfigWrapper.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.reusableConfig != null && message.hasOwnProperty("reusableConfig")) { - properties.configValues = 1; - if (!$util.isString(message.reusableConfig)) - return "reusableConfig: string expected"; - } - if (message.reusableConfigValues != null && message.hasOwnProperty("reusableConfigValues")) { - if (properties.configValues === 1) - return "configValues: multiple values"; - properties.configValues = 1; - { - var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify(message.reusableConfigValues); - if (error) - return "reusableConfigValues." + error; - } - } - return null; - }; - - /** - * Creates a ReusableConfigWrapper message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ReusableConfigWrapper} ReusableConfigWrapper - */ - ReusableConfigWrapper.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper(); - if (object.reusableConfig != null) - message.reusableConfig = String(object.reusableConfig); - if (object.reusableConfigValues != null) { - if (typeof object.reusableConfigValues !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.reusableConfigValues: object expected"); - message.reusableConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.fromObject(object.reusableConfigValues); - } - return message; - }; - - /** - * Creates a plain object from a ReusableConfigWrapper message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @static - * @param {google.cloud.security.privateca.v1beta1.ReusableConfigWrapper} message ReusableConfigWrapper - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReusableConfigWrapper.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.reusableConfig != null && message.hasOwnProperty("reusableConfig")) { - object.reusableConfig = message.reusableConfig; - if (options.oneofs) - object.configValues = "reusableConfig"; - } - if (message.reusableConfigValues != null && message.hasOwnProperty("reusableConfigValues")) { - object.reusableConfigValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.toObject(message.reusableConfigValues, options); - if (options.oneofs) - object.configValues = "reusableConfigValues"; - } - return object; - }; - - /** - * Converts this ReusableConfigWrapper to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @instance - * @returns {Object.} JSON object - */ - ReusableConfigWrapper.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReusableConfigWrapper - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ReusableConfigWrapper - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReusableConfigWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ReusableConfigWrapper"; - }; - - return ReusableConfigWrapper; - })(); - - v1beta1.SubordinateConfig = (function() { - - /** - * Properties of a SubordinateConfig. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface ISubordinateConfig - * @property {string|null} [certificateAuthority] SubordinateConfig certificateAuthority - * @property {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain|null} [pemIssuerChain] SubordinateConfig pemIssuerChain - */ - - /** - * Constructs a new SubordinateConfig. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a SubordinateConfig. - * @implements ISubordinateConfig - * @constructor - * @param {google.cloud.security.privateca.v1beta1.ISubordinateConfig=} [properties] Properties to set - */ - function SubordinateConfig(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]]; - } - - /** - * SubordinateConfig certificateAuthority. - * @member {string|null|undefined} certificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @instance - */ - SubordinateConfig.prototype.certificateAuthority = null; - - /** - * SubordinateConfig pemIssuerChain. - * @member {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain|null|undefined} pemIssuerChain - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @instance - */ - SubordinateConfig.prototype.pemIssuerChain = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SubordinateConfig subordinateConfig. - * @member {"certificateAuthority"|"pemIssuerChain"|undefined} subordinateConfig - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @instance - */ - Object.defineProperty(SubordinateConfig.prototype, "subordinateConfig", { - get: $util.oneOfGetter($oneOfFields = ["certificateAuthority", "pemIssuerChain"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SubordinateConfig instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.ISubordinateConfig=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig} SubordinateConfig instance - */ - SubordinateConfig.create = function create(properties) { - return new SubordinateConfig(properties); - }; - - /** - * Encodes the specified SubordinateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.ISubordinateConfig} message SubordinateConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubordinateConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificateAuthority); - if (message.pemIssuerChain != null && Object.hasOwnProperty.call(message, "pemIssuerChain")) - $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.encode(message.pemIssuerChain, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SubordinateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.ISubordinateConfig} message SubordinateConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubordinateConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubordinateConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig} SubordinateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubordinateConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.SubordinateConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.certificateAuthority = reader.string(); - break; - } - case 2: { - message.pemIssuerChain = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubordinateConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig} SubordinateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubordinateConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubordinateConfig message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubordinateConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { - properties.subordinateConfig = 1; - if (!$util.isString(message.certificateAuthority)) - return "certificateAuthority: string expected"; - } - if (message.pemIssuerChain != null && message.hasOwnProperty("pemIssuerChain")) { - if (properties.subordinateConfig === 1) - return "subordinateConfig: multiple values"; - properties.subordinateConfig = 1; - { - var error = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.verify(message.pemIssuerChain); - if (error) - return "pemIssuerChain." + error; - } - } - return null; - }; - - /** - * Creates a SubordinateConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig} SubordinateConfig - */ - SubordinateConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.SubordinateConfig) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.SubordinateConfig(); - if (object.certificateAuthority != null) - message.certificateAuthority = String(object.certificateAuthority); - if (object.pemIssuerChain != null) { - if (typeof object.pemIssuerChain !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.SubordinateConfig.pemIssuerChain: object expected"); - message.pemIssuerChain = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.fromObject(object.pemIssuerChain); - } - return message; - }; - - /** - * Creates a plain object from a SubordinateConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig} message SubordinateConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubordinateConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { - object.certificateAuthority = message.certificateAuthority; - if (options.oneofs) - object.subordinateConfig = "certificateAuthority"; - } - if (message.pemIssuerChain != null && message.hasOwnProperty("pemIssuerChain")) { - object.pemIssuerChain = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.toObject(message.pemIssuerChain, options); - if (options.oneofs) - object.subordinateConfig = "pemIssuerChain"; - } - return object; - }; - - /** - * Converts this SubordinateConfig to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @instance - * @returns {Object.} JSON object - */ - SubordinateConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubordinateConfig - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubordinateConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.SubordinateConfig"; - }; - - SubordinateConfig.SubordinateConfigChain = (function() { - - /** - * Properties of a SubordinateConfigChain. - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @interface ISubordinateConfigChain - * @property {Array.|null} [pemCertificates] SubordinateConfigChain pemCertificates - */ - - /** - * Constructs a new SubordinateConfigChain. - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig - * @classdesc Represents a SubordinateConfigChain. - * @implements ISubordinateConfigChain - * @constructor - * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain=} [properties] Properties to set - */ - function SubordinateConfigChain(properties) { - this.pemCertificates = []; - 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]]; - } - - /** - * SubordinateConfigChain pemCertificates. - * @member {Array.} pemCertificates - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain - * @instance - */ - SubordinateConfigChain.prototype.pemCertificates = $util.emptyArray; - - /** - * Creates a new SubordinateConfigChain instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain instance - */ - SubordinateConfigChain.create = function create(properties) { - return new SubordinateConfigChain(properties); - }; - - /** - * Encodes the specified SubordinateConfigChain message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain} message SubordinateConfigChain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubordinateConfigChain.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pemCertificates != null && message.pemCertificates.length) - for (var i = 0; i < message.pemCertificates.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificates[i]); - return writer; - }; - - /** - * Encodes the specified SubordinateConfigChain message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig.ISubordinateConfigChain} message SubordinateConfigChain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubordinateConfigChain.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubordinateConfigChain message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubordinateConfigChain.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.pemCertificates && message.pemCertificates.length)) - message.pemCertificates = []; - message.pemCertificates.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubordinateConfigChain message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubordinateConfigChain.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubordinateConfigChain message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubordinateConfigChain.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pemCertificates != null && message.hasOwnProperty("pemCertificates")) { - if (!Array.isArray(message.pemCertificates)) - return "pemCertificates: array expected"; - for (var i = 0; i < message.pemCertificates.length; ++i) - if (!$util.isString(message.pemCertificates[i])) - return "pemCertificates: string[] expected"; - } - return null; - }; - - /** - * Creates a SubordinateConfigChain message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain} SubordinateConfigChain - */ - SubordinateConfigChain.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain(); - if (object.pemCertificates) { - if (!Array.isArray(object.pemCertificates)) - throw TypeError(".google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain.pemCertificates: array expected"); - message.pemCertificates = []; - for (var i = 0; i < object.pemCertificates.length; ++i) - message.pemCertificates[i] = String(object.pemCertificates[i]); - } - return message; - }; - - /** - * Creates a plain object from a SubordinateConfigChain message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain} message SubordinateConfigChain - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubordinateConfigChain.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pemCertificates = []; - if (message.pemCertificates && message.pemCertificates.length) { - object.pemCertificates = []; - for (var j = 0; j < message.pemCertificates.length; ++j) - object.pemCertificates[j] = message.pemCertificates[j]; - } - return object; - }; - - /** - * Converts this SubordinateConfigChain to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain - * @instance - * @returns {Object.} JSON object - */ - SubordinateConfigChain.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubordinateConfigChain - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubordinateConfigChain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain"; - }; - - return SubordinateConfigChain; - })(); - - return SubordinateConfig; - })(); - - v1beta1.PublicKey = (function() { - - /** - * Properties of a PublicKey. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IPublicKey - * @property {google.cloud.security.privateca.v1beta1.PublicKey.KeyType|null} [type] PublicKey type - * @property {Uint8Array|null} [key] PublicKey key - */ - - /** - * Constructs a new PublicKey. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a PublicKey. - * @implements IPublicKey - * @constructor - * @param {google.cloud.security.privateca.v1beta1.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]]; - } - - /** - * PublicKey type. - * @member {google.cloud.security.privateca.v1beta1.PublicKey.KeyType} type - * @memberof google.cloud.security.privateca.v1beta1.PublicKey - * @instance - */ - PublicKey.prototype.type = 0; - - /** - * PublicKey key. - * @member {Uint8Array} key - * @memberof google.cloud.security.privateca.v1beta1.PublicKey - * @instance - */ - PublicKey.prototype.key = $util.newBuffer([]); - - /** - * Creates a new PublicKey instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.PublicKey - * @static - * @param {google.cloud.security.privateca.v1beta1.IPublicKey=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.PublicKey} PublicKey instance - */ - PublicKey.create = function create(properties) { - return new PublicKey(properties); - }; - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.PublicKey.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.PublicKey - * @static - * @param {google.cloud.security.privateca.v1beta1.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.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); - return writer; - }; - - /** - * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.PublicKey.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.PublicKey - * @static - * @param {google.cloud.security.privateca.v1beta1.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(); - }; - - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.PublicKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.key = reader.bytes(); - 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.security.privateca.v1beta1.PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.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()); - }; - - /** - * Verifies a PublicKey message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.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.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - return null; - }; - - /** - * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.PublicKey - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.PublicKey} PublicKey - */ - PublicKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.PublicKey) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.PublicKey(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "KEY_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PEM_RSA_KEY": - case 1: - message.type = 1; - break; - case "PEM_EC_KEY": - case 2: - message.type = 2; - break; - } - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length >= 0) - message.key = object.key; - return message; - }; - - /** - * Creates a plain object from a PublicKey message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.PublicKey - * @static - * @param {google.cloud.security.privateca.v1beta1.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.type = options.enums === String ? "KEY_TYPE_UNSPECIFIED" : 0; - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.PublicKey.KeyType[message.type] === undefined ? message.type : $root.google.cloud.security.privateca.v1beta1.PublicKey.KeyType[message.type] : message.type; - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - return object; - }; - - /** - * Converts this PublicKey to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.PublicKey - * @instance - * @returns {Object.} JSON object - */ - PublicKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PublicKey - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.PublicKey - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PublicKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.PublicKey"; - }; - - /** - * KeyType enum. - * @name google.cloud.security.privateca.v1beta1.PublicKey.KeyType - * @enum {number} - * @property {number} KEY_TYPE_UNSPECIFIED=0 KEY_TYPE_UNSPECIFIED value - * @property {number} PEM_RSA_KEY=1 PEM_RSA_KEY value - * @property {number} PEM_EC_KEY=2 PEM_EC_KEY value - */ - PublicKey.KeyType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KEY_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PEM_RSA_KEY"] = 1; - values[valuesById[2] = "PEM_EC_KEY"] = 2; - return values; - })(); - - return PublicKey; - })(); - - v1beta1.CertificateConfig = (function() { - - /** - * Properties of a CertificateConfig. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface ICertificateConfig - * @property {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig|null} [subjectConfig] CertificateConfig subjectConfig - * @property {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null} [reusableConfig] CertificateConfig reusableConfig - * @property {google.cloud.security.privateca.v1beta1.IPublicKey|null} [publicKey] CertificateConfig publicKey - */ - - /** - * Constructs a new CertificateConfig. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a CertificateConfig. - * @implements ICertificateConfig - * @constructor - * @param {google.cloud.security.privateca.v1beta1.ICertificateConfig=} [properties] Properties to set - */ - function CertificateConfig(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]]; - } - - /** - * CertificateConfig subjectConfig. - * @member {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig|null|undefined} subjectConfig - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @instance - */ - CertificateConfig.prototype.subjectConfig = null; - - /** - * CertificateConfig reusableConfig. - * @member {google.cloud.security.privateca.v1beta1.IReusableConfigWrapper|null|undefined} reusableConfig - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @instance - */ - CertificateConfig.prototype.reusableConfig = null; - - /** - * CertificateConfig publicKey. - * @member {google.cloud.security.privateca.v1beta1.IPublicKey|null|undefined} publicKey - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @instance - */ - CertificateConfig.prototype.publicKey = null; - - /** - * Creates a new CertificateConfig instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateConfig=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig} CertificateConfig instance - */ - CertificateConfig.create = function create(properties) { - return new CertificateConfig(properties); - }; - - /** - * Encodes the specified CertificateConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateConfig} message CertificateConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subjectConfig != null && Object.hasOwnProperty.call(message, "subjectConfig")) - $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.encode(message.subjectConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.reusableConfig != null && Object.hasOwnProperty.call(message, "reusableConfig")) - $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.encode(message.reusableConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) - $root.google.cloud.security.privateca.v1beta1.PublicKey.encode(message.publicKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CertificateConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateConfig} message CertificateConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig} CertificateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.subjectConfig = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.reusableConfig = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.decode(reader, reader.uint32()); - break; - } - case 3: { - message.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig} CertificateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateConfig message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subjectConfig != null && message.hasOwnProperty("subjectConfig")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.verify(message.subjectConfig); - if (error) - return "subjectConfig." + error; - } - if (message.reusableConfig != null && message.hasOwnProperty("reusableConfig")) { - var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.verify(message.reusableConfig); - if (error) - return "reusableConfig." + error; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) { - var error = $root.google.cloud.security.privateca.v1beta1.PublicKey.verify(message.publicKey); - if (error) - return "publicKey." + error; - } - return null; - }; - - /** - * Creates a CertificateConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig} CertificateConfig - */ - CertificateConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateConfig) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateConfig(); - if (object.subjectConfig != null) { - if (typeof object.subjectConfig !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateConfig.subjectConfig: object expected"); - message.subjectConfig = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.fromObject(object.subjectConfig); - } - if (object.reusableConfig != null) { - if (typeof object.reusableConfig !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateConfig.reusableConfig: object expected"); - message.reusableConfig = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.fromObject(object.reusableConfig); - } - if (object.publicKey != null) { - if (typeof object.publicKey !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateConfig.publicKey: object expected"); - message.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.fromObject(object.publicKey); - } - return message; - }; - - /** - * Creates a plain object from a CertificateConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateConfig} message CertificateConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subjectConfig = null; - object.reusableConfig = null; - object.publicKey = null; - } - if (message.subjectConfig != null && message.hasOwnProperty("subjectConfig")) - object.subjectConfig = $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.toObject(message.subjectConfig, options); - if (message.reusableConfig != null && message.hasOwnProperty("reusableConfig")) - object.reusableConfig = $root.google.cloud.security.privateca.v1beta1.ReusableConfigWrapper.toObject(message.reusableConfig, options); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.toObject(message.publicKey, options); - return object; - }; - - /** - * Converts this CertificateConfig to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @instance - * @returns {Object.} JSON object - */ - CertificateConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateConfig - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateConfig"; - }; - - CertificateConfig.SubjectConfig = (function() { - - /** - * Properties of a SubjectConfig. - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @interface ISubjectConfig - * @property {google.cloud.security.privateca.v1beta1.ISubject|null} [subject] SubjectConfig subject - * @property {string|null} [commonName] SubjectConfig commonName - * @property {google.cloud.security.privateca.v1beta1.ISubjectAltNames|null} [subjectAltName] SubjectConfig subjectAltName - */ - - /** - * Constructs a new SubjectConfig. - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig - * @classdesc Represents a SubjectConfig. - * @implements ISubjectConfig - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig=} [properties] Properties to set - */ - function SubjectConfig(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]]; - } - - /** - * SubjectConfig subject. - * @member {google.cloud.security.privateca.v1beta1.ISubject|null|undefined} subject - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @instance - */ - SubjectConfig.prototype.subject = null; - - /** - * SubjectConfig commonName. - * @member {string} commonName - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @instance - */ - SubjectConfig.prototype.commonName = ""; - - /** - * SubjectConfig subjectAltName. - * @member {google.cloud.security.privateca.v1beta1.ISubjectAltNames|null|undefined} subjectAltName - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @instance - */ - SubjectConfig.prototype.subjectAltName = null; - - /** - * Creates a new SubjectConfig instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig} SubjectConfig instance - */ - SubjectConfig.create = function create(properties) { - return new SubjectConfig(properties); - }; - - /** - * Encodes the specified SubjectConfig message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig} message SubjectConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) - $root.google.cloud.security.privateca.v1beta1.Subject.encode(message.subject, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.commonName); - if (message.subjectAltName != null && Object.hasOwnProperty.call(message, "subjectAltName")) - $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.encode(message.subjectAltName, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SubjectConfig message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateConfig.ISubjectConfig} message SubjectConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubjectConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig} SubjectConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.subject = $root.google.cloud.security.privateca.v1beta1.Subject.decode(reader, reader.uint32()); - break; - } - case 2: { - message.commonName = reader.string(); - break; - } - case 3: { - message.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubjectConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig} SubjectConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubjectConfig message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubjectConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subject != null && message.hasOwnProperty("subject")) { - var error = $root.google.cloud.security.privateca.v1beta1.Subject.verify(message.subject); - if (error) - return "subject." + error; - } - if (message.commonName != null && message.hasOwnProperty("commonName")) - if (!$util.isString(message.commonName)) - return "commonName: string expected"; - if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) { - var error = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.verify(message.subjectAltName); - if (error) - return "subjectAltName." + error; - } - return null; - }; - - /** - * Creates a SubjectConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig} SubjectConfig - */ - SubjectConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig(); - if (object.subject != null) { - if (typeof object.subject !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.subject: object expected"); - message.subject = $root.google.cloud.security.privateca.v1beta1.Subject.fromObject(object.subject); - } - if (object.commonName != null) - message.commonName = String(object.commonName); - if (object.subjectAltName != null) { - if (typeof object.subjectAltName !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig.subjectAltName: object expected"); - message.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.fromObject(object.subjectAltName); - } - return message; - }; - - /** - * Creates a plain object from a SubjectConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig} message SubjectConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubjectConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subject = null; - object.commonName = ""; - object.subjectAltName = null; - } - if (message.subject != null && message.hasOwnProperty("subject")) - object.subject = $root.google.cloud.security.privateca.v1beta1.Subject.toObject(message.subject, options); - if (message.commonName != null && message.hasOwnProperty("commonName")) - object.commonName = message.commonName; - if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) - object.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.toObject(message.subjectAltName, options); - return object; - }; - - /** - * Converts this SubjectConfig to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @instance - * @returns {Object.} JSON object - */ - SubjectConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubjectConfig - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubjectConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig"; - }; - - return SubjectConfig; - })(); - - return CertificateConfig; - })(); - - v1beta1.CertificateDescription = (function() { - - /** - * Properties of a CertificateDescription. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface ICertificateDescription - * @property {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription|null} [subjectDescription] CertificateDescription subjectDescription - * @property {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null} [configValues] CertificateDescription configValues - * @property {google.cloud.security.privateca.v1beta1.IPublicKey|null} [publicKey] CertificateDescription publicKey - * @property {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null} [subjectKeyId] CertificateDescription subjectKeyId - * @property {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null} [authorityKeyId] CertificateDescription authorityKeyId - * @property {Array.|null} [crlDistributionPoints] CertificateDescription crlDistributionPoints - * @property {Array.|null} [aiaIssuingCertificateUrls] CertificateDescription aiaIssuingCertificateUrls - * @property {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint|null} [certFingerprint] CertificateDescription certFingerprint - */ - - /** - * Constructs a new CertificateDescription. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a CertificateDescription. - * @implements ICertificateDescription - * @constructor - * @param {google.cloud.security.privateca.v1beta1.ICertificateDescription=} [properties] Properties to set - */ - function CertificateDescription(properties) { - this.crlDistributionPoints = []; - this.aiaIssuingCertificateUrls = []; - 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]]; - } - - /** - * CertificateDescription subjectDescription. - * @member {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription|null|undefined} subjectDescription - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.subjectDescription = null; - - /** - * CertificateDescription configValues. - * @member {google.cloud.security.privateca.v1beta1.IReusableConfigValues|null|undefined} configValues - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.configValues = null; - - /** - * CertificateDescription publicKey. - * @member {google.cloud.security.privateca.v1beta1.IPublicKey|null|undefined} publicKey - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.publicKey = null; - - /** - * CertificateDescription subjectKeyId. - * @member {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null|undefined} subjectKeyId - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.subjectKeyId = null; - - /** - * CertificateDescription authorityKeyId. - * @member {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId|null|undefined} authorityKeyId - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.authorityKeyId = null; - - /** - * CertificateDescription crlDistributionPoints. - * @member {Array.} crlDistributionPoints - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.crlDistributionPoints = $util.emptyArray; - - /** - * CertificateDescription aiaIssuingCertificateUrls. - * @member {Array.} aiaIssuingCertificateUrls - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.aiaIssuingCertificateUrls = $util.emptyArray; - - /** - * CertificateDescription certFingerprint. - * @member {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint|null|undefined} certFingerprint - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @instance - */ - CertificateDescription.prototype.certFingerprint = null; - - /** - * Creates a new CertificateDescription instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateDescription=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription} CertificateDescription instance - */ - CertificateDescription.create = function create(properties) { - return new CertificateDescription(properties); - }; - - /** - * Encodes the specified CertificateDescription message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateDescription} message CertificateDescription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateDescription.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subjectDescription != null && Object.hasOwnProperty.call(message, "subjectDescription")) - $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.encode(message.subjectDescription, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.configValues != null && Object.hasOwnProperty.call(message, "configValues")) - $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.encode(message.configValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) - $root.google.cloud.security.privateca.v1beta1.PublicKey.encode(message.publicKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.subjectKeyId != null && Object.hasOwnProperty.call(message, "subjectKeyId")) - $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.encode(message.subjectKeyId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.authorityKeyId != null && Object.hasOwnProperty.call(message, "authorityKeyId")) - $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.encode(message.authorityKeyId, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.crlDistributionPoints != null && message.crlDistributionPoints.length) - for (var i = 0; i < message.crlDistributionPoints.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.crlDistributionPoints[i]); - if (message.aiaIssuingCertificateUrls != null && message.aiaIssuingCertificateUrls.length) - for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.aiaIssuingCertificateUrls[i]); - if (message.certFingerprint != null && Object.hasOwnProperty.call(message, "certFingerprint")) - $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.encode(message.certFingerprint, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CertificateDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @static - * @param {google.cloud.security.privateca.v1beta1.ICertificateDescription} message CertificateDescription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateDescription.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateDescription message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription} CertificateDescription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateDescription.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.subjectDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.decode(reader, reader.uint32()); - break; - } - case 2: { - message.configValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.decode(reader, reader.uint32()); - break; - } - case 3: { - message.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.decode(reader, reader.uint32()); - break; - } - case 4: { - message.subjectKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.decode(reader, reader.uint32()); - break; - } - case 5: { - message.authorityKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.crlDistributionPoints && message.crlDistributionPoints.length)) - message.crlDistributionPoints = []; - message.crlDistributionPoints.push(reader.string()); - break; - } - case 7: { - if (!(message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length)) - message.aiaIssuingCertificateUrls = []; - message.aiaIssuingCertificateUrls.push(reader.string()); - break; - } - case 8: { - message.certFingerprint = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateDescription message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription} CertificateDescription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateDescription.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateDescription message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateDescription.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subjectDescription != null && message.hasOwnProperty("subjectDescription")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.verify(message.subjectDescription); - if (error) - return "subjectDescription." + error; - } - if (message.configValues != null && message.hasOwnProperty("configValues")) { - var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.verify(message.configValues); - if (error) - return "configValues." + error; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) { - var error = $root.google.cloud.security.privateca.v1beta1.PublicKey.verify(message.publicKey); - if (error) - return "publicKey." + error; - } - if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify(message.subjectKeyId); - if (error) - return "subjectKeyId." + error; - } - if (message.authorityKeyId != null && message.hasOwnProperty("authorityKeyId")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify(message.authorityKeyId); - if (error) - return "authorityKeyId." + error; - } - if (message.crlDistributionPoints != null && message.hasOwnProperty("crlDistributionPoints")) { - if (!Array.isArray(message.crlDistributionPoints)) - return "crlDistributionPoints: array expected"; - for (var i = 0; i < message.crlDistributionPoints.length; ++i) - if (!$util.isString(message.crlDistributionPoints[i])) - return "crlDistributionPoints: string[] expected"; - } - if (message.aiaIssuingCertificateUrls != null && message.hasOwnProperty("aiaIssuingCertificateUrls")) { - if (!Array.isArray(message.aiaIssuingCertificateUrls)) - return "aiaIssuingCertificateUrls: array expected"; - for (var i = 0; i < message.aiaIssuingCertificateUrls.length; ++i) - if (!$util.isString(message.aiaIssuingCertificateUrls[i])) - return "aiaIssuingCertificateUrls: string[] expected"; - } - if (message.certFingerprint != null && message.hasOwnProperty("certFingerprint")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.verify(message.certFingerprint); - if (error) - return "certFingerprint." + error; - } - return null; - }; - - /** - * Creates a CertificateDescription message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription} CertificateDescription - */ - CertificateDescription.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateDescription) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription(); - if (object.subjectDescription != null) { - if (typeof object.subjectDescription !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.subjectDescription: object expected"); - message.subjectDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.fromObject(object.subjectDescription); - } - if (object.configValues != null) { - if (typeof object.configValues !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.configValues: object expected"); - message.configValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.fromObject(object.configValues); - } - if (object.publicKey != null) { - if (typeof object.publicKey !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.publicKey: object expected"); - message.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.fromObject(object.publicKey); - } - if (object.subjectKeyId != null) { - if (typeof object.subjectKeyId !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.subjectKeyId: object expected"); - message.subjectKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.fromObject(object.subjectKeyId); - } - if (object.authorityKeyId != null) { - if (typeof object.authorityKeyId !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.authorityKeyId: object expected"); - message.authorityKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.fromObject(object.authorityKeyId); - } - if (object.crlDistributionPoints) { - if (!Array.isArray(object.crlDistributionPoints)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.crlDistributionPoints: array expected"); - message.crlDistributionPoints = []; - for (var i = 0; i < object.crlDistributionPoints.length; ++i) - message.crlDistributionPoints[i] = String(object.crlDistributionPoints[i]); - } - if (object.aiaIssuingCertificateUrls) { - if (!Array.isArray(object.aiaIssuingCertificateUrls)) - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.aiaIssuingCertificateUrls: array expected"); - message.aiaIssuingCertificateUrls = []; - for (var i = 0; i < object.aiaIssuingCertificateUrls.length; ++i) - message.aiaIssuingCertificateUrls[i] = String(object.aiaIssuingCertificateUrls[i]); - } - if (object.certFingerprint != null) { - if (typeof object.certFingerprint !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.certFingerprint: object expected"); - message.certFingerprint = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.fromObject(object.certFingerprint); - } - return message; - }; - - /** - * Creates a plain object from a CertificateDescription message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription} message CertificateDescription - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateDescription.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.crlDistributionPoints = []; - object.aiaIssuingCertificateUrls = []; - } - if (options.defaults) { - object.subjectDescription = null; - object.configValues = null; - object.publicKey = null; - object.subjectKeyId = null; - object.authorityKeyId = null; - object.certFingerprint = null; - } - if (message.subjectDescription != null && message.hasOwnProperty("subjectDescription")) - object.subjectDescription = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.toObject(message.subjectDescription, options); - if (message.configValues != null && message.hasOwnProperty("configValues")) - object.configValues = $root.google.cloud.security.privateca.v1beta1.ReusableConfigValues.toObject(message.configValues, options); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = $root.google.cloud.security.privateca.v1beta1.PublicKey.toObject(message.publicKey, options); - if (message.subjectKeyId != null && message.hasOwnProperty("subjectKeyId")) - object.subjectKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.toObject(message.subjectKeyId, options); - if (message.authorityKeyId != null && message.hasOwnProperty("authorityKeyId")) - object.authorityKeyId = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.toObject(message.authorityKeyId, options); - if (message.crlDistributionPoints && message.crlDistributionPoints.length) { - object.crlDistributionPoints = []; - for (var j = 0; j < message.crlDistributionPoints.length; ++j) - object.crlDistributionPoints[j] = message.crlDistributionPoints[j]; - } - if (message.aiaIssuingCertificateUrls && message.aiaIssuingCertificateUrls.length) { - object.aiaIssuingCertificateUrls = []; - for (var j = 0; j < message.aiaIssuingCertificateUrls.length; ++j) - object.aiaIssuingCertificateUrls[j] = message.aiaIssuingCertificateUrls[j]; - } - if (message.certFingerprint != null && message.hasOwnProperty("certFingerprint")) - object.certFingerprint = $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.toObject(message.certFingerprint, options); - return object; - }; - - /** - * Converts this CertificateDescription to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @instance - * @returns {Object.} JSON object - */ - CertificateDescription.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateDescription - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateDescription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateDescription"; - }; - - CertificateDescription.SubjectDescription = (function() { - - /** - * Properties of a SubjectDescription. - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @interface ISubjectDescription - * @property {google.cloud.security.privateca.v1beta1.ISubject|null} [subject] SubjectDescription subject - * @property {string|null} [commonName] SubjectDescription commonName - * @property {google.cloud.security.privateca.v1beta1.ISubjectAltNames|null} [subjectAltName] SubjectDescription subjectAltName - * @property {string|null} [hexSerialNumber] SubjectDescription hexSerialNumber - * @property {google.protobuf.IDuration|null} [lifetime] SubjectDescription lifetime - * @property {google.protobuf.ITimestamp|null} [notBeforeTime] SubjectDescription notBeforeTime - * @property {google.protobuf.ITimestamp|null} [notAfterTime] SubjectDescription notAfterTime - */ - - /** - * Constructs a new SubjectDescription. - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @classdesc Represents a SubjectDescription. - * @implements ISubjectDescription - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription=} [properties] Properties to set - */ - function SubjectDescription(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]]; - } - - /** - * SubjectDescription subject. - * @member {google.cloud.security.privateca.v1beta1.ISubject|null|undefined} subject - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.subject = null; - - /** - * SubjectDescription commonName. - * @member {string} commonName - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.commonName = ""; - - /** - * SubjectDescription subjectAltName. - * @member {google.cloud.security.privateca.v1beta1.ISubjectAltNames|null|undefined} subjectAltName - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.subjectAltName = null; - - /** - * SubjectDescription hexSerialNumber. - * @member {string} hexSerialNumber - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.hexSerialNumber = ""; - - /** - * SubjectDescription lifetime. - * @member {google.protobuf.IDuration|null|undefined} lifetime - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.lifetime = null; - - /** - * SubjectDescription notBeforeTime. - * @member {google.protobuf.ITimestamp|null|undefined} notBeforeTime - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.notBeforeTime = null; - - /** - * SubjectDescription notAfterTime. - * @member {google.protobuf.ITimestamp|null|undefined} notAfterTime - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @instance - */ - SubjectDescription.prototype.notAfterTime = null; - - /** - * Creates a new SubjectDescription instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription} SubjectDescription instance - */ - SubjectDescription.create = function create(properties) { - return new SubjectDescription(properties); - }; - - /** - * Encodes the specified SubjectDescription message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription} message SubjectDescription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectDescription.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) - $root.google.cloud.security.privateca.v1beta1.Subject.encode(message.subject, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.commonName); - if (message.subjectAltName != null && Object.hasOwnProperty.call(message, "subjectAltName")) - $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.encode(message.subjectAltName, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hexSerialNumber != null && Object.hasOwnProperty.call(message, "hexSerialNumber")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.hexSerialNumber); - if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) - $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.notBeforeTime != null && Object.hasOwnProperty.call(message, "notBeforeTime")) - $root.google.protobuf.Timestamp.encode(message.notBeforeTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.notAfterTime != null && Object.hasOwnProperty.call(message, "notAfterTime")) - $root.google.protobuf.Timestamp.encode(message.notAfterTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SubjectDescription message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ISubjectDescription} message SubjectDescription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectDescription.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubjectDescription message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription} SubjectDescription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectDescription.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.subject = $root.google.cloud.security.privateca.v1beta1.Subject.decode(reader, reader.uint32()); - break; - } - case 2: { - message.commonName = reader.string(); - break; - } - case 3: { - message.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.decode(reader, reader.uint32()); - break; - } - case 4: { - message.hexSerialNumber = reader.string(); - break; - } - case 5: { - message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.notBeforeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.notAfterTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubjectDescription message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription} SubjectDescription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectDescription.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubjectDescription message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubjectDescription.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subject != null && message.hasOwnProperty("subject")) { - var error = $root.google.cloud.security.privateca.v1beta1.Subject.verify(message.subject); - if (error) - return "subject." + error; - } - if (message.commonName != null && message.hasOwnProperty("commonName")) - if (!$util.isString(message.commonName)) - return "commonName: string expected"; - if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) { - var error = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.verify(message.subjectAltName); - if (error) - return "subjectAltName." + error; - } - if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) - if (!$util.isString(message.hexSerialNumber)) - return "hexSerialNumber: string expected"; - if (message.lifetime != null && message.hasOwnProperty("lifetime")) { - var error = $root.google.protobuf.Duration.verify(message.lifetime); - if (error) - return "lifetime." + error; - } - if (message.notBeforeTime != null && message.hasOwnProperty("notBeforeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.notBeforeTime); - if (error) - return "notBeforeTime." + error; - } - if (message.notAfterTime != null && message.hasOwnProperty("notAfterTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.notAfterTime); - if (error) - return "notAfterTime." + error; - } - return null; - }; - - /** - * Creates a SubjectDescription message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription} SubjectDescription - */ - SubjectDescription.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription(); - if (object.subject != null) { - if (typeof object.subject !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.subject: object expected"); - message.subject = $root.google.cloud.security.privateca.v1beta1.Subject.fromObject(object.subject); - } - if (object.commonName != null) - message.commonName = String(object.commonName); - if (object.subjectAltName != null) { - if (typeof object.subjectAltName !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.subjectAltName: object expected"); - message.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.fromObject(object.subjectAltName); - } - if (object.hexSerialNumber != null) - message.hexSerialNumber = String(object.hexSerialNumber); - if (object.lifetime != null) { - if (typeof object.lifetime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.lifetime: object expected"); - message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); - } - if (object.notBeforeTime != null) { - if (typeof object.notBeforeTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.notBeforeTime: object expected"); - message.notBeforeTime = $root.google.protobuf.Timestamp.fromObject(object.notBeforeTime); - } - if (object.notAfterTime != null) { - if (typeof object.notAfterTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription.notAfterTime: object expected"); - message.notAfterTime = $root.google.protobuf.Timestamp.fromObject(object.notAfterTime); - } - return message; - }; - - /** - * Creates a plain object from a SubjectDescription message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription} message SubjectDescription - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubjectDescription.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subject = null; - object.commonName = ""; - object.subjectAltName = null; - object.hexSerialNumber = ""; - object.lifetime = null; - object.notBeforeTime = null; - object.notAfterTime = null; - } - if (message.subject != null && message.hasOwnProperty("subject")) - object.subject = $root.google.cloud.security.privateca.v1beta1.Subject.toObject(message.subject, options); - if (message.commonName != null && message.hasOwnProperty("commonName")) - object.commonName = message.commonName; - if (message.subjectAltName != null && message.hasOwnProperty("subjectAltName")) - object.subjectAltName = $root.google.cloud.security.privateca.v1beta1.SubjectAltNames.toObject(message.subjectAltName, options); - if (message.hexSerialNumber != null && message.hasOwnProperty("hexSerialNumber")) - object.hexSerialNumber = message.hexSerialNumber; - if (message.lifetime != null && message.hasOwnProperty("lifetime")) - object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); - if (message.notBeforeTime != null && message.hasOwnProperty("notBeforeTime")) - object.notBeforeTime = $root.google.protobuf.Timestamp.toObject(message.notBeforeTime, options); - if (message.notAfterTime != null && message.hasOwnProperty("notAfterTime")) - object.notAfterTime = $root.google.protobuf.Timestamp.toObject(message.notAfterTime, options); - return object; - }; - - /** - * Converts this SubjectDescription to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @instance - * @returns {Object.} JSON object - */ - SubjectDescription.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubjectDescription - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubjectDescription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription"; - }; - - return SubjectDescription; - })(); - - CertificateDescription.KeyId = (function() { - - /** - * Properties of a KeyId. - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @interface IKeyId - * @property {string|null} [keyId] KeyId keyId - */ - - /** - * Constructs a new KeyId. - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @classdesc Represents a KeyId. - * @implements IKeyId - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId=} [properties] Properties to set - */ - function KeyId(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]]; - } - - /** - * KeyId keyId. - * @member {string} keyId - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId - * @instance - */ - KeyId.prototype.keyId = ""; - - /** - * Creates a new KeyId instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId} KeyId instance - */ - KeyId.create = function create(properties) { - return new KeyId(properties); - }; - - /** - * Encodes the specified KeyId message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId} message KeyId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyId); - return writer; - }; - - /** - * Encodes the specified KeyId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.IKeyId} message KeyId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyId message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId} KeyId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyId.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.keyId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId} KeyId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyId message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyId != null && message.hasOwnProperty("keyId")) - if (!$util.isString(message.keyId)) - return "keyId: string expected"; - return null; - }; - - /** - * Creates a KeyId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId} KeyId - */ - KeyId.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId(); - if (object.keyId != null) - message.keyId = String(object.keyId); - return message; - }; - - /** - * Creates a plain object from a KeyId message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId} message KeyId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyId.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.keyId = ""; - if (message.keyId != null && message.hasOwnProperty("keyId")) - object.keyId = message.keyId; - return object; - }; - - /** - * Converts this KeyId to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId - * @instance - * @returns {Object.} JSON object - */ - KeyId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyId - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId"; - }; - - return KeyId; - })(); - - CertificateDescription.CertificateFingerprint = (function() { - - /** - * Properties of a CertificateFingerprint. - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @interface ICertificateFingerprint - * @property {string|null} [sha256Hash] CertificateFingerprint sha256Hash - */ - - /** - * Constructs a new CertificateFingerprint. - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription - * @classdesc Represents a CertificateFingerprint. - * @implements ICertificateFingerprint - * @constructor - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint=} [properties] Properties to set - */ - function CertificateFingerprint(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]]; - } - - /** - * CertificateFingerprint sha256Hash. - * @member {string} sha256Hash - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint - * @instance - */ - CertificateFingerprint.prototype.sha256Hash = ""; - - /** - * Creates a new CertificateFingerprint instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint} CertificateFingerprint instance - */ - CertificateFingerprint.create = function create(properties) { - return new CertificateFingerprint(properties); - }; - - /** - * Encodes the specified CertificateFingerprint message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint} message CertificateFingerprint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateFingerprint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sha256Hash != null && Object.hasOwnProperty.call(message, "sha256Hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sha256Hash); - return writer; - }; - - /** - * Encodes the specified CertificateFingerprint message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.ICertificateFingerprint} message CertificateFingerprint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CertificateFingerprint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CertificateFingerprint message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint} CertificateFingerprint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateFingerprint.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sha256Hash = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CertificateFingerprint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint} CertificateFingerprint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CertificateFingerprint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CertificateFingerprint message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CertificateFingerprint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash")) - if (!$util.isString(message.sha256Hash)) - return "sha256Hash: string expected"; - return null; - }; - - /** - * Creates a CertificateFingerprint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint} CertificateFingerprint - */ - CertificateFingerprint.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint(); - if (object.sha256Hash != null) - message.sha256Hash = String(object.sha256Hash); - return message; - }; - - /** - * Creates a plain object from a CertificateFingerprint message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint - * @static - * @param {google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint} message CertificateFingerprint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CertificateFingerprint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.sha256Hash = ""; - if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash")) - object.sha256Hash = message.sha256Hash; - return object; - }; - - /** - * Converts this CertificateFingerprint to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint - * @instance - * @returns {Object.} JSON object - */ - CertificateFingerprint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CertificateFingerprint - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CertificateFingerprint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint"; - }; - - return CertificateFingerprint; - })(); - - return CertificateDescription; - })(); - - v1beta1.ObjectId = (function() { - - /** - * Properties of an ObjectId. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IObjectId - * @property {Array.|null} [objectIdPath] ObjectId objectIdPath - */ - - /** - * Constructs a new ObjectId. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents an ObjectId. - * @implements IObjectId - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IObjectId=} [properties] Properties to set - */ - function ObjectId(properties) { - this.objectIdPath = []; - 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]]; - } - - /** - * ObjectId objectIdPath. - * @member {Array.} objectIdPath - * @memberof google.cloud.security.privateca.v1beta1.ObjectId - * @instance - */ - ObjectId.prototype.objectIdPath = $util.emptyArray; - - /** - * Creates a new ObjectId instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ObjectId - * @static - * @param {google.cloud.security.privateca.v1beta1.IObjectId=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ObjectId} ObjectId instance - */ - ObjectId.create = function create(properties) { - return new ObjectId(properties); - }; - - /** - * Encodes the specified ObjectId message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ObjectId.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ObjectId - * @static - * @param {google.cloud.security.privateca.v1beta1.IObjectId} message ObjectId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObjectId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.objectIdPath != null && message.objectIdPath.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.objectIdPath.length; ++i) - writer.int32(message.objectIdPath[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ObjectId message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ObjectId.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ObjectId - * @static - * @param {google.cloud.security.privateca.v1beta1.IObjectId} message ObjectId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObjectId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ObjectId message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ObjectId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ObjectId} ObjectId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObjectId.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ObjectId(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.objectIdPath && message.objectIdPath.length)) - message.objectIdPath = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.objectIdPath.push(reader.int32()); - } else - message.objectIdPath.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ObjectId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ObjectId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ObjectId} ObjectId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObjectId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ObjectId message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ObjectId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ObjectId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.objectIdPath != null && message.hasOwnProperty("objectIdPath")) { - if (!Array.isArray(message.objectIdPath)) - return "objectIdPath: array expected"; - for (var i = 0; i < message.objectIdPath.length; ++i) - if (!$util.isInteger(message.objectIdPath[i])) - return "objectIdPath: integer[] expected"; - } - return null; - }; - - /** - * Creates an ObjectId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ObjectId - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ObjectId} ObjectId - */ - ObjectId.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ObjectId) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ObjectId(); - if (object.objectIdPath) { - if (!Array.isArray(object.objectIdPath)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ObjectId.objectIdPath: array expected"); - message.objectIdPath = []; - for (var i = 0; i < object.objectIdPath.length; ++i) - message.objectIdPath[i] = object.objectIdPath[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from an ObjectId message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ObjectId - * @static - * @param {google.cloud.security.privateca.v1beta1.ObjectId} message ObjectId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ObjectId.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.objectIdPath = []; - if (message.objectIdPath && message.objectIdPath.length) { - object.objectIdPath = []; - for (var j = 0; j < message.objectIdPath.length; ++j) - object.objectIdPath[j] = message.objectIdPath[j]; - } - return object; - }; - - /** - * Converts this ObjectId to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ObjectId - * @instance - * @returns {Object.} JSON object - */ - ObjectId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ObjectId - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ObjectId - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ObjectId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ObjectId"; - }; - - return ObjectId; - })(); - - v1beta1.X509Extension = (function() { - - /** - * Properties of a X509Extension. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IX509Extension - * @property {google.cloud.security.privateca.v1beta1.IObjectId|null} [objectId] X509Extension objectId - * @property {boolean|null} [critical] X509Extension critical - * @property {Uint8Array|null} [value] X509Extension value - */ - - /** - * Constructs a new X509Extension. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a X509Extension. - * @implements IX509Extension - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IX509Extension=} [properties] Properties to set - */ - function X509Extension(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]]; - } - - /** - * X509Extension objectId. - * @member {google.cloud.security.privateca.v1beta1.IObjectId|null|undefined} objectId - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @instance - */ - X509Extension.prototype.objectId = null; - - /** - * X509Extension critical. - * @member {boolean} critical - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @instance - */ - X509Extension.prototype.critical = false; - - /** - * X509Extension value. - * @member {Uint8Array} value - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @instance - */ - X509Extension.prototype.value = $util.newBuffer([]); - - /** - * Creates a new X509Extension instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @static - * @param {google.cloud.security.privateca.v1beta1.IX509Extension=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.X509Extension} X509Extension instance - */ - X509Extension.create = function create(properties) { - return new X509Extension(properties); - }; - - /** - * Encodes the specified X509Extension message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.X509Extension.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @static - * @param {google.cloud.security.privateca.v1beta1.IX509Extension} message X509Extension message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - X509Extension.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.objectId != null && Object.hasOwnProperty.call(message, "objectId")) - $root.google.cloud.security.privateca.v1beta1.ObjectId.encode(message.objectId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.critical != null && Object.hasOwnProperty.call(message, "critical")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.critical); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified X509Extension message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.X509Extension.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @static - * @param {google.cloud.security.privateca.v1beta1.IX509Extension} message X509Extension message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - X509Extension.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a X509Extension message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.X509Extension} X509Extension - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - X509Extension.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.X509Extension(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.objectId = $root.google.cloud.security.privateca.v1beta1.ObjectId.decode(reader, reader.uint32()); - break; - } - case 2: { - message.critical = reader.bool(); - break; - } - case 3: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a X509Extension message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.X509Extension} X509Extension - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - X509Extension.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a X509Extension message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - X509Extension.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.objectId != null && message.hasOwnProperty("objectId")) { - var error = $root.google.cloud.security.privateca.v1beta1.ObjectId.verify(message.objectId); - if (error) - return "objectId." + error; - } - if (message.critical != null && message.hasOwnProperty("critical")) - if (typeof message.critical !== "boolean") - return "critical: boolean expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a X509Extension message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.X509Extension} X509Extension - */ - X509Extension.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.X509Extension) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.X509Extension(); - if (object.objectId != null) { - if (typeof object.objectId !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.X509Extension.objectId: object expected"); - message.objectId = $root.google.cloud.security.privateca.v1beta1.ObjectId.fromObject(object.objectId); - } - if (object.critical != null) - message.critical = Boolean(object.critical); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a X509Extension message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @static - * @param {google.cloud.security.privateca.v1beta1.X509Extension} message X509Extension - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - X509Extension.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.objectId = null; - object.critical = false; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.objectId != null && message.hasOwnProperty("objectId")) - object.objectId = $root.google.cloud.security.privateca.v1beta1.ObjectId.toObject(message.objectId, options); - if (message.critical != null && message.hasOwnProperty("critical")) - object.critical = message.critical; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this X509Extension to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @instance - * @returns {Object.} JSON object - */ - X509Extension.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for X509Extension - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.X509Extension - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - X509Extension.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.X509Extension"; - }; - - return X509Extension; - })(); - - v1beta1.KeyUsage = (function() { - - /** - * Properties of a KeyUsage. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IKeyUsage - * @property {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions|null} [baseKeyUsage] KeyUsage baseKeyUsage - * @property {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions|null} [extendedKeyUsage] KeyUsage extendedKeyUsage - * @property {Array.|null} [unknownExtendedKeyUsages] KeyUsage unknownExtendedKeyUsages - */ - - /** - * Constructs a new KeyUsage. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a KeyUsage. - * @implements IKeyUsage - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IKeyUsage=} [properties] Properties to set - */ - function KeyUsage(properties) { - this.unknownExtendedKeyUsages = []; - 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]]; - } - - /** - * KeyUsage baseKeyUsage. - * @member {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions|null|undefined} baseKeyUsage - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @instance - */ - KeyUsage.prototype.baseKeyUsage = null; - - /** - * KeyUsage extendedKeyUsage. - * @member {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions|null|undefined} extendedKeyUsage - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @instance - */ - KeyUsage.prototype.extendedKeyUsage = null; - - /** - * KeyUsage unknownExtendedKeyUsages. - * @member {Array.} unknownExtendedKeyUsages - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @instance - */ - KeyUsage.prototype.unknownExtendedKeyUsages = $util.emptyArray; - - /** - * Creates a new KeyUsage instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @static - * @param {google.cloud.security.privateca.v1beta1.IKeyUsage=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage} KeyUsage instance - */ - KeyUsage.create = function create(properties) { - return new KeyUsage(properties); - }; - - /** - * Encodes the specified KeyUsage message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @static - * @param {google.cloud.security.privateca.v1beta1.IKeyUsage} message KeyUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyUsage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.baseKeyUsage != null && Object.hasOwnProperty.call(message, "baseKeyUsage")) - $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.encode(message.baseKeyUsage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.extendedKeyUsage != null && Object.hasOwnProperty.call(message, "extendedKeyUsage")) - $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.encode(message.extendedKeyUsage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.unknownExtendedKeyUsages != null && message.unknownExtendedKeyUsages.length) - for (var i = 0; i < message.unknownExtendedKeyUsages.length; ++i) - $root.google.cloud.security.privateca.v1beta1.ObjectId.encode(message.unknownExtendedKeyUsages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified KeyUsage message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @static - * @param {google.cloud.security.privateca.v1beta1.IKeyUsage} message KeyUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyUsage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyUsage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage} KeyUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyUsage.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.baseKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.decode(reader, reader.uint32()); - break; - } - case 2: { - message.extendedKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.unknownExtendedKeyUsages && message.unknownExtendedKeyUsages.length)) - message.unknownExtendedKeyUsages = []; - message.unknownExtendedKeyUsages.push($root.google.cloud.security.privateca.v1beta1.ObjectId.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyUsage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage} KeyUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyUsage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyUsage message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyUsage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.baseKeyUsage != null && message.hasOwnProperty("baseKeyUsage")) { - var error = $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.verify(message.baseKeyUsage); - if (error) - return "baseKeyUsage." + error; - } - if (message.extendedKeyUsage != null && message.hasOwnProperty("extendedKeyUsage")) { - var error = $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.verify(message.extendedKeyUsage); - if (error) - return "extendedKeyUsage." + error; - } - if (message.unknownExtendedKeyUsages != null && message.hasOwnProperty("unknownExtendedKeyUsages")) { - if (!Array.isArray(message.unknownExtendedKeyUsages)) - return "unknownExtendedKeyUsages: array expected"; - for (var i = 0; i < message.unknownExtendedKeyUsages.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.ObjectId.verify(message.unknownExtendedKeyUsages[i]); - if (error) - return "unknownExtendedKeyUsages." + error; - } - } - return null; - }; - - /** - * Creates a KeyUsage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage} KeyUsage - */ - KeyUsage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.KeyUsage) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage(); - if (object.baseKeyUsage != null) { - if (typeof object.baseKeyUsage !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.KeyUsage.baseKeyUsage: object expected"); - message.baseKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.fromObject(object.baseKeyUsage); - } - if (object.extendedKeyUsage != null) { - if (typeof object.extendedKeyUsage !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.KeyUsage.extendedKeyUsage: object expected"); - message.extendedKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.fromObject(object.extendedKeyUsage); - } - if (object.unknownExtendedKeyUsages) { - if (!Array.isArray(object.unknownExtendedKeyUsages)) - throw TypeError(".google.cloud.security.privateca.v1beta1.KeyUsage.unknownExtendedKeyUsages: array expected"); - message.unknownExtendedKeyUsages = []; - for (var i = 0; i < object.unknownExtendedKeyUsages.length; ++i) { - if (typeof object.unknownExtendedKeyUsages[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.KeyUsage.unknownExtendedKeyUsages: object expected"); - message.unknownExtendedKeyUsages[i] = $root.google.cloud.security.privateca.v1beta1.ObjectId.fromObject(object.unknownExtendedKeyUsages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a KeyUsage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @static - * @param {google.cloud.security.privateca.v1beta1.KeyUsage} message KeyUsage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyUsage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.unknownExtendedKeyUsages = []; - if (options.defaults) { - object.baseKeyUsage = null; - object.extendedKeyUsage = null; - } - if (message.baseKeyUsage != null && message.hasOwnProperty("baseKeyUsage")) - object.baseKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.toObject(message.baseKeyUsage, options); - if (message.extendedKeyUsage != null && message.hasOwnProperty("extendedKeyUsage")) - object.extendedKeyUsage = $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.toObject(message.extendedKeyUsage, options); - if (message.unknownExtendedKeyUsages && message.unknownExtendedKeyUsages.length) { - object.unknownExtendedKeyUsages = []; - for (var j = 0; j < message.unknownExtendedKeyUsages.length; ++j) - object.unknownExtendedKeyUsages[j] = $root.google.cloud.security.privateca.v1beta1.ObjectId.toObject(message.unknownExtendedKeyUsages[j], options); - } - return object; - }; - - /** - * Converts this KeyUsage to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @instance - * @returns {Object.} JSON object - */ - KeyUsage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyUsage - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.KeyUsage"; - }; - - KeyUsage.KeyUsageOptions = (function() { - - /** - * Properties of a KeyUsageOptions. - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @interface IKeyUsageOptions - * @property {boolean|null} [digitalSignature] KeyUsageOptions digitalSignature - * @property {boolean|null} [contentCommitment] KeyUsageOptions contentCommitment - * @property {boolean|null} [keyEncipherment] KeyUsageOptions keyEncipherment - * @property {boolean|null} [dataEncipherment] KeyUsageOptions dataEncipherment - * @property {boolean|null} [keyAgreement] KeyUsageOptions keyAgreement - * @property {boolean|null} [certSign] KeyUsageOptions certSign - * @property {boolean|null} [crlSign] KeyUsageOptions crlSign - * @property {boolean|null} [encipherOnly] KeyUsageOptions encipherOnly - * @property {boolean|null} [decipherOnly] KeyUsageOptions decipherOnly - */ - - /** - * Constructs a new KeyUsageOptions. - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @classdesc Represents a KeyUsageOptions. - * @implements IKeyUsageOptions - * @constructor - * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions=} [properties] Properties to set - */ - function KeyUsageOptions(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]]; - } - - /** - * KeyUsageOptions digitalSignature. - * @member {boolean} digitalSignature - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.digitalSignature = false; - - /** - * KeyUsageOptions contentCommitment. - * @member {boolean} contentCommitment - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.contentCommitment = false; - - /** - * KeyUsageOptions keyEncipherment. - * @member {boolean} keyEncipherment - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.keyEncipherment = false; - - /** - * KeyUsageOptions dataEncipherment. - * @member {boolean} dataEncipherment - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.dataEncipherment = false; - - /** - * KeyUsageOptions keyAgreement. - * @member {boolean} keyAgreement - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.keyAgreement = false; - - /** - * KeyUsageOptions certSign. - * @member {boolean} certSign - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.certSign = false; - - /** - * KeyUsageOptions crlSign. - * @member {boolean} crlSign - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.crlSign = false; - - /** - * KeyUsageOptions encipherOnly. - * @member {boolean} encipherOnly - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.encipherOnly = false; - - /** - * KeyUsageOptions decipherOnly. - * @member {boolean} decipherOnly - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @instance - */ - KeyUsageOptions.prototype.decipherOnly = false; - - /** - * Creates a new KeyUsageOptions instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions} KeyUsageOptions instance - */ - KeyUsageOptions.create = function create(properties) { - return new KeyUsageOptions(properties); - }; - - /** - * Encodes the specified KeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions} message KeyUsageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyUsageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.digitalSignature != null && Object.hasOwnProperty.call(message, "digitalSignature")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.digitalSignature); - if (message.contentCommitment != null && Object.hasOwnProperty.call(message, "contentCommitment")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.contentCommitment); - if (message.keyEncipherment != null && Object.hasOwnProperty.call(message, "keyEncipherment")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.keyEncipherment); - if (message.dataEncipherment != null && Object.hasOwnProperty.call(message, "dataEncipherment")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.dataEncipherment); - if (message.keyAgreement != null && Object.hasOwnProperty.call(message, "keyAgreement")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.keyAgreement); - if (message.certSign != null && Object.hasOwnProperty.call(message, "certSign")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.certSign); - if (message.crlSign != null && Object.hasOwnProperty.call(message, "crlSign")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.crlSign); - if (message.encipherOnly != null && Object.hasOwnProperty.call(message, "encipherOnly")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.encipherOnly); - if (message.decipherOnly != null && Object.hasOwnProperty.call(message, "decipherOnly")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.decipherOnly); - return writer; - }; - - /** - * Encodes the specified KeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IKeyUsageOptions} message KeyUsageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyUsageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyUsageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions} KeyUsageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyUsageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.digitalSignature = reader.bool(); - break; - } - case 2: { - message.contentCommitment = reader.bool(); - break; - } - case 3: { - message.keyEncipherment = reader.bool(); - break; - } - case 4: { - message.dataEncipherment = reader.bool(); - break; - } - case 5: { - message.keyAgreement = reader.bool(); - break; - } - case 6: { - message.certSign = reader.bool(); - break; - } - case 7: { - message.crlSign = reader.bool(); - break; - } - case 8: { - message.encipherOnly = reader.bool(); - break; - } - case 9: { - message.decipherOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyUsageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions} KeyUsageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyUsageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyUsageOptions message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyUsageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.digitalSignature != null && message.hasOwnProperty("digitalSignature")) - if (typeof message.digitalSignature !== "boolean") - return "digitalSignature: boolean expected"; - if (message.contentCommitment != null && message.hasOwnProperty("contentCommitment")) - if (typeof message.contentCommitment !== "boolean") - return "contentCommitment: boolean expected"; - if (message.keyEncipherment != null && message.hasOwnProperty("keyEncipherment")) - if (typeof message.keyEncipherment !== "boolean") - return "keyEncipherment: boolean expected"; - if (message.dataEncipherment != null && message.hasOwnProperty("dataEncipherment")) - if (typeof message.dataEncipherment !== "boolean") - return "dataEncipherment: boolean expected"; - if (message.keyAgreement != null && message.hasOwnProperty("keyAgreement")) - if (typeof message.keyAgreement !== "boolean") - return "keyAgreement: boolean expected"; - if (message.certSign != null && message.hasOwnProperty("certSign")) - if (typeof message.certSign !== "boolean") - return "certSign: boolean expected"; - if (message.crlSign != null && message.hasOwnProperty("crlSign")) - if (typeof message.crlSign !== "boolean") - return "crlSign: boolean expected"; - if (message.encipherOnly != null && message.hasOwnProperty("encipherOnly")) - if (typeof message.encipherOnly !== "boolean") - return "encipherOnly: boolean expected"; - if (message.decipherOnly != null && message.hasOwnProperty("decipherOnly")) - if (typeof message.decipherOnly !== "boolean") - return "decipherOnly: boolean expected"; - return null; - }; - - /** - * Creates a KeyUsageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions} KeyUsageOptions - */ - KeyUsageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions(); - if (object.digitalSignature != null) - message.digitalSignature = Boolean(object.digitalSignature); - if (object.contentCommitment != null) - message.contentCommitment = Boolean(object.contentCommitment); - if (object.keyEncipherment != null) - message.keyEncipherment = Boolean(object.keyEncipherment); - if (object.dataEncipherment != null) - message.dataEncipherment = Boolean(object.dataEncipherment); - if (object.keyAgreement != null) - message.keyAgreement = Boolean(object.keyAgreement); - if (object.certSign != null) - message.certSign = Boolean(object.certSign); - if (object.crlSign != null) - message.crlSign = Boolean(object.crlSign); - if (object.encipherOnly != null) - message.encipherOnly = Boolean(object.encipherOnly); - if (object.decipherOnly != null) - message.decipherOnly = Boolean(object.decipherOnly); - return message; - }; - - /** - * Creates a plain object from a KeyUsageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions} message KeyUsageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyUsageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.digitalSignature = false; - object.contentCommitment = false; - object.keyEncipherment = false; - object.dataEncipherment = false; - object.keyAgreement = false; - object.certSign = false; - object.crlSign = false; - object.encipherOnly = false; - object.decipherOnly = false; - } - if (message.digitalSignature != null && message.hasOwnProperty("digitalSignature")) - object.digitalSignature = message.digitalSignature; - if (message.contentCommitment != null && message.hasOwnProperty("contentCommitment")) - object.contentCommitment = message.contentCommitment; - if (message.keyEncipherment != null && message.hasOwnProperty("keyEncipherment")) - object.keyEncipherment = message.keyEncipherment; - if (message.dataEncipherment != null && message.hasOwnProperty("dataEncipherment")) - object.dataEncipherment = message.dataEncipherment; - if (message.keyAgreement != null && message.hasOwnProperty("keyAgreement")) - object.keyAgreement = message.keyAgreement; - if (message.certSign != null && message.hasOwnProperty("certSign")) - object.certSign = message.certSign; - if (message.crlSign != null && message.hasOwnProperty("crlSign")) - object.crlSign = message.crlSign; - if (message.encipherOnly != null && message.hasOwnProperty("encipherOnly")) - object.encipherOnly = message.encipherOnly; - if (message.decipherOnly != null && message.hasOwnProperty("decipherOnly")) - object.decipherOnly = message.decipherOnly; - return object; - }; - - /** - * Converts this KeyUsageOptions to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @instance - * @returns {Object.} JSON object - */ - KeyUsageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KeyUsageOptions - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyUsageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions"; - }; - - return KeyUsageOptions; - })(); - - KeyUsage.ExtendedKeyUsageOptions = (function() { - - /** - * Properties of an ExtendedKeyUsageOptions. - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @interface IExtendedKeyUsageOptions - * @property {boolean|null} [serverAuth] ExtendedKeyUsageOptions serverAuth - * @property {boolean|null} [clientAuth] ExtendedKeyUsageOptions clientAuth - * @property {boolean|null} [codeSigning] ExtendedKeyUsageOptions codeSigning - * @property {boolean|null} [emailProtection] ExtendedKeyUsageOptions emailProtection - * @property {boolean|null} [timeStamping] ExtendedKeyUsageOptions timeStamping - * @property {boolean|null} [ocspSigning] ExtendedKeyUsageOptions ocspSigning - */ - - /** - * Constructs a new ExtendedKeyUsageOptions. - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage - * @classdesc Represents an ExtendedKeyUsageOptions. - * @implements IExtendedKeyUsageOptions - * @constructor - * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions=} [properties] Properties to set - */ - function ExtendedKeyUsageOptions(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]]; - } - - /** - * ExtendedKeyUsageOptions serverAuth. - * @member {boolean} serverAuth - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.serverAuth = false; - - /** - * ExtendedKeyUsageOptions clientAuth. - * @member {boolean} clientAuth - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.clientAuth = false; - - /** - * ExtendedKeyUsageOptions codeSigning. - * @member {boolean} codeSigning - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.codeSigning = false; - - /** - * ExtendedKeyUsageOptions emailProtection. - * @member {boolean} emailProtection - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.emailProtection = false; - - /** - * ExtendedKeyUsageOptions timeStamping. - * @member {boolean} timeStamping - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.timeStamping = false; - - /** - * ExtendedKeyUsageOptions ocspSigning. - * @member {boolean} ocspSigning - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @instance - */ - ExtendedKeyUsageOptions.prototype.ocspSigning = false; - - /** - * Creates a new ExtendedKeyUsageOptions instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions instance - */ - ExtendedKeyUsageOptions.create = function create(properties) { - return new ExtendedKeyUsageOptions(properties); - }; - - /** - * Encodes the specified ExtendedKeyUsageOptions message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions} message ExtendedKeyUsageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtendedKeyUsageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serverAuth != null && Object.hasOwnProperty.call(message, "serverAuth")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.serverAuth); - if (message.clientAuth != null && Object.hasOwnProperty.call(message, "clientAuth")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.clientAuth); - if (message.codeSigning != null && Object.hasOwnProperty.call(message, "codeSigning")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.codeSigning); - if (message.emailProtection != null && Object.hasOwnProperty.call(message, "emailProtection")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.emailProtection); - if (message.timeStamping != null && Object.hasOwnProperty.call(message, "timeStamping")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.timeStamping); - if (message.ocspSigning != null && Object.hasOwnProperty.call(message, "ocspSigning")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.ocspSigning); - return writer; - }; - - /** - * Encodes the specified ExtendedKeyUsageOptions message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.KeyUsage.IExtendedKeyUsageOptions} message ExtendedKeyUsageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtendedKeyUsageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtendedKeyUsageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.serverAuth = reader.bool(); - break; - } - case 2: { - message.clientAuth = reader.bool(); - break; - } - case 3: { - message.codeSigning = reader.bool(); - break; - } - case 4: { - message.emailProtection = reader.bool(); - break; - } - case 5: { - message.timeStamping = reader.bool(); - break; - } - case 6: { - message.ocspSigning = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtendedKeyUsageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtendedKeyUsageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtendedKeyUsageOptions message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtendedKeyUsageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serverAuth != null && message.hasOwnProperty("serverAuth")) - if (typeof message.serverAuth !== "boolean") - return "serverAuth: boolean expected"; - if (message.clientAuth != null && message.hasOwnProperty("clientAuth")) - if (typeof message.clientAuth !== "boolean") - return "clientAuth: boolean expected"; - if (message.codeSigning != null && message.hasOwnProperty("codeSigning")) - if (typeof message.codeSigning !== "boolean") - return "codeSigning: boolean expected"; - if (message.emailProtection != null && message.hasOwnProperty("emailProtection")) - if (typeof message.emailProtection !== "boolean") - return "emailProtection: boolean expected"; - if (message.timeStamping != null && message.hasOwnProperty("timeStamping")) - if (typeof message.timeStamping !== "boolean") - return "timeStamping: boolean expected"; - if (message.ocspSigning != null && message.hasOwnProperty("ocspSigning")) - if (typeof message.ocspSigning !== "boolean") - return "ocspSigning: boolean expected"; - return null; - }; - - /** - * Creates an ExtendedKeyUsageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions} ExtendedKeyUsageOptions - */ - ExtendedKeyUsageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions(); - if (object.serverAuth != null) - message.serverAuth = Boolean(object.serverAuth); - if (object.clientAuth != null) - message.clientAuth = Boolean(object.clientAuth); - if (object.codeSigning != null) - message.codeSigning = Boolean(object.codeSigning); - if (object.emailProtection != null) - message.emailProtection = Boolean(object.emailProtection); - if (object.timeStamping != null) - message.timeStamping = Boolean(object.timeStamping); - if (object.ocspSigning != null) - message.ocspSigning = Boolean(object.ocspSigning); - return message; - }; - - /** - * Creates a plain object from an ExtendedKeyUsageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions} message ExtendedKeyUsageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtendedKeyUsageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serverAuth = false; - object.clientAuth = false; - object.codeSigning = false; - object.emailProtection = false; - object.timeStamping = false; - object.ocspSigning = false; - } - if (message.serverAuth != null && message.hasOwnProperty("serverAuth")) - object.serverAuth = message.serverAuth; - if (message.clientAuth != null && message.hasOwnProperty("clientAuth")) - object.clientAuth = message.clientAuth; - if (message.codeSigning != null && message.hasOwnProperty("codeSigning")) - object.codeSigning = message.codeSigning; - if (message.emailProtection != null && message.hasOwnProperty("emailProtection")) - object.emailProtection = message.emailProtection; - if (message.timeStamping != null && message.hasOwnProperty("timeStamping")) - object.timeStamping = message.timeStamping; - if (message.ocspSigning != null && message.hasOwnProperty("ocspSigning")) - object.ocspSigning = message.ocspSigning; - return object; - }; - - /** - * Converts this ExtendedKeyUsageOptions to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @instance - * @returns {Object.} JSON object - */ - ExtendedKeyUsageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtendedKeyUsageOptions - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtendedKeyUsageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions"; - }; - - return ExtendedKeyUsageOptions; - })(); - - return KeyUsage; - })(); - - v1beta1.Subject = (function() { - - /** - * Properties of a Subject. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface ISubject - * @property {string|null} [countryCode] Subject countryCode - * @property {string|null} [organization] Subject organization - * @property {string|null} [organizationalUnit] Subject organizationalUnit - * @property {string|null} [locality] Subject locality - * @property {string|null} [province] Subject province - * @property {string|null} [streetAddress] Subject streetAddress - * @property {string|null} [postalCode] Subject postalCode - */ - - /** - * Constructs a new Subject. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a Subject. - * @implements ISubject - * @constructor - * @param {google.cloud.security.privateca.v1beta1.ISubject=} [properties] Properties to set - */ - function Subject(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]]; - } - - /** - * Subject countryCode. - * @member {string} countryCode - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @instance - */ - Subject.prototype.countryCode = ""; - - /** - * Subject organization. - * @member {string} organization - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @instance - */ - Subject.prototype.organization = ""; - - /** - * Subject organizationalUnit. - * @member {string} organizationalUnit - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @instance - */ - Subject.prototype.organizationalUnit = ""; - - /** - * Subject locality. - * @member {string} locality - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @instance - */ - Subject.prototype.locality = ""; - - /** - * Subject province. - * @member {string} province - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @instance - */ - Subject.prototype.province = ""; - - /** - * Subject streetAddress. - * @member {string} streetAddress - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @instance - */ - Subject.prototype.streetAddress = ""; - - /** - * Subject postalCode. - * @member {string} postalCode - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @instance - */ - Subject.prototype.postalCode = ""; - - /** - * Creates a new Subject instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @static - * @param {google.cloud.security.privateca.v1beta1.ISubject=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.Subject} Subject instance - */ - Subject.create = function create(properties) { - return new Subject(properties); - }; - - /** - * Encodes the specified Subject message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Subject.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @static - * @param {google.cloud.security.privateca.v1beta1.ISubject} message Subject message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Subject.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.countryCode != null && Object.hasOwnProperty.call(message, "countryCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.countryCode); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.organization); - if (message.organizationalUnit != null && Object.hasOwnProperty.call(message, "organizationalUnit")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.organizationalUnit); - if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.locality); - if (message.province != null && Object.hasOwnProperty.call(message, "province")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.province); - if (message.streetAddress != null && Object.hasOwnProperty.call(message, "streetAddress")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.streetAddress); - if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.postalCode); - return writer; - }; - - /** - * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.Subject.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @static - * @param {google.cloud.security.privateca.v1beta1.ISubject} message Subject message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Subject.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Subject message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.Subject} Subject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Subject.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.Subject(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.countryCode = reader.string(); - break; - } - case 2: { - message.organization = reader.string(); - break; - } - case 3: { - message.organizationalUnit = reader.string(); - break; - } - case 4: { - message.locality = reader.string(); - break; - } - case 5: { - message.province = reader.string(); - break; - } - case 6: { - message.streetAddress = reader.string(); - break; - } - case 7: { - message.postalCode = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Subject message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.Subject} Subject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Subject.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Subject message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Subject.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.countryCode != null && message.hasOwnProperty("countryCode")) - if (!$util.isString(message.countryCode)) - return "countryCode: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - if (!$util.isString(message.organization)) - return "organization: string expected"; - if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) - if (!$util.isString(message.organizationalUnit)) - return "organizationalUnit: string expected"; - if (message.locality != null && message.hasOwnProperty("locality")) - if (!$util.isString(message.locality)) - return "locality: string expected"; - if (message.province != null && message.hasOwnProperty("province")) - if (!$util.isString(message.province)) - return "province: string expected"; - if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) - if (!$util.isString(message.streetAddress)) - return "streetAddress: string expected"; - if (message.postalCode != null && message.hasOwnProperty("postalCode")) - if (!$util.isString(message.postalCode)) - return "postalCode: string expected"; - return null; - }; - - /** - * Creates a Subject message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.Subject} Subject - */ - Subject.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.Subject) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.Subject(); - if (object.countryCode != null) - message.countryCode = String(object.countryCode); - if (object.organization != null) - message.organization = String(object.organization); - if (object.organizationalUnit != null) - message.organizationalUnit = String(object.organizationalUnit); - if (object.locality != null) - message.locality = String(object.locality); - if (object.province != null) - message.province = String(object.province); - if (object.streetAddress != null) - message.streetAddress = String(object.streetAddress); - if (object.postalCode != null) - message.postalCode = String(object.postalCode); - return message; - }; - - /** - * Creates a plain object from a Subject message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @static - * @param {google.cloud.security.privateca.v1beta1.Subject} message Subject - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Subject.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.countryCode = ""; - object.organization = ""; - object.organizationalUnit = ""; - object.locality = ""; - object.province = ""; - object.streetAddress = ""; - object.postalCode = ""; - } - if (message.countryCode != null && message.hasOwnProperty("countryCode")) - object.countryCode = message.countryCode; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = message.organization; - if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) - object.organizationalUnit = message.organizationalUnit; - if (message.locality != null && message.hasOwnProperty("locality")) - object.locality = message.locality; - if (message.province != null && message.hasOwnProperty("province")) - object.province = message.province; - if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) - object.streetAddress = message.streetAddress; - if (message.postalCode != null && message.hasOwnProperty("postalCode")) - object.postalCode = message.postalCode; - return object; - }; - - /** - * Converts this Subject to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @instance - * @returns {Object.} JSON object - */ - Subject.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Subject - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.Subject - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Subject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.Subject"; - }; - - return Subject; - })(); - - v1beta1.SubjectAltNames = (function() { - - /** - * Properties of a SubjectAltNames. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface ISubjectAltNames - * @property {Array.|null} [dnsNames] SubjectAltNames dnsNames - * @property {Array.|null} [uris] SubjectAltNames uris - * @property {Array.|null} [emailAddresses] SubjectAltNames emailAddresses - * @property {Array.|null} [ipAddresses] SubjectAltNames ipAddresses - * @property {Array.|null} [customSans] SubjectAltNames customSans - */ - - /** - * Constructs a new SubjectAltNames. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a SubjectAltNames. - * @implements ISubjectAltNames - * @constructor - * @param {google.cloud.security.privateca.v1beta1.ISubjectAltNames=} [properties] Properties to set - */ - function SubjectAltNames(properties) { - this.dnsNames = []; - this.uris = []; - this.emailAddresses = []; - this.ipAddresses = []; - this.customSans = []; - 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]]; - } - - /** - * SubjectAltNames dnsNames. - * @member {Array.} dnsNames - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @instance - */ - SubjectAltNames.prototype.dnsNames = $util.emptyArray; - - /** - * SubjectAltNames uris. - * @member {Array.} uris - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @instance - */ - SubjectAltNames.prototype.uris = $util.emptyArray; - - /** - * SubjectAltNames emailAddresses. - * @member {Array.} emailAddresses - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @instance - */ - SubjectAltNames.prototype.emailAddresses = $util.emptyArray; - - /** - * SubjectAltNames ipAddresses. - * @member {Array.} ipAddresses - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @instance - */ - SubjectAltNames.prototype.ipAddresses = $util.emptyArray; - - /** - * SubjectAltNames customSans. - * @member {Array.} customSans - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @instance - */ - SubjectAltNames.prototype.customSans = $util.emptyArray; - - /** - * Creates a new SubjectAltNames instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1beta1.ISubjectAltNames=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.SubjectAltNames} SubjectAltNames instance - */ - SubjectAltNames.create = function create(properties) { - return new SubjectAltNames(properties); - }; - - /** - * Encodes the specified SubjectAltNames message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubjectAltNames.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1beta1.ISubjectAltNames} message SubjectAltNames message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectAltNames.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dnsNames != null && message.dnsNames.length) - for (var i = 0; i < message.dnsNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dnsNames[i]); - if (message.uris != null && message.uris.length) - for (var i = 0; i < message.uris.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uris[i]); - if (message.emailAddresses != null && message.emailAddresses.length) - for (var i = 0; i < message.emailAddresses.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.emailAddresses[i]); - if (message.ipAddresses != null && message.ipAddresses.length) - for (var i = 0; i < message.ipAddresses.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ipAddresses[i]); - if (message.customSans != null && message.customSans.length) - for (var i = 0; i < message.customSans.length; ++i) - $root.google.cloud.security.privateca.v1beta1.X509Extension.encode(message.customSans[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SubjectAltNames message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.SubjectAltNames.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1beta1.ISubjectAltNames} message SubjectAltNames message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubjectAltNames.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubjectAltNames message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.SubjectAltNames} SubjectAltNames - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectAltNames.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.SubjectAltNames(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.dnsNames && message.dnsNames.length)) - message.dnsNames = []; - message.dnsNames.push(reader.string()); - break; - } - case 2: { - if (!(message.uris && message.uris.length)) - message.uris = []; - message.uris.push(reader.string()); - break; - } - case 3: { - if (!(message.emailAddresses && message.emailAddresses.length)) - message.emailAddresses = []; - message.emailAddresses.push(reader.string()); - break; - } - case 4: { - if (!(message.ipAddresses && message.ipAddresses.length)) - message.ipAddresses = []; - message.ipAddresses.push(reader.string()); - break; - } - case 5: { - if (!(message.customSans && message.customSans.length)) - message.customSans = []; - message.customSans.push($root.google.cloud.security.privateca.v1beta1.X509Extension.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubjectAltNames message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.SubjectAltNames} SubjectAltNames - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubjectAltNames.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubjectAltNames message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubjectAltNames.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { - if (!Array.isArray(message.dnsNames)) - return "dnsNames: array expected"; - for (var i = 0; i < message.dnsNames.length; ++i) - if (!$util.isString(message.dnsNames[i])) - return "dnsNames: string[] expected"; - } - if (message.uris != null && message.hasOwnProperty("uris")) { - if (!Array.isArray(message.uris)) - return "uris: array expected"; - for (var i = 0; i < message.uris.length; ++i) - if (!$util.isString(message.uris[i])) - return "uris: string[] expected"; - } - if (message.emailAddresses != null && message.hasOwnProperty("emailAddresses")) { - if (!Array.isArray(message.emailAddresses)) - return "emailAddresses: array expected"; - for (var i = 0; i < message.emailAddresses.length; ++i) - if (!$util.isString(message.emailAddresses[i])) - return "emailAddresses: string[] expected"; - } - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { - if (!Array.isArray(message.ipAddresses)) - return "ipAddresses: array expected"; - for (var i = 0; i < message.ipAddresses.length; ++i) - if (!$util.isString(message.ipAddresses[i])) - return "ipAddresses: string[] expected"; - } - if (message.customSans != null && message.hasOwnProperty("customSans")) { - if (!Array.isArray(message.customSans)) - return "customSans: array expected"; - for (var i = 0; i < message.customSans.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.X509Extension.verify(message.customSans[i]); - if (error) - return "customSans." + error; - } - } - return null; - }; - - /** - * Creates a SubjectAltNames message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.SubjectAltNames} SubjectAltNames - */ - SubjectAltNames.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.SubjectAltNames) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.SubjectAltNames(); - if (object.dnsNames) { - if (!Array.isArray(object.dnsNames)) - throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.dnsNames: array expected"); - message.dnsNames = []; - for (var i = 0; i < object.dnsNames.length; ++i) - message.dnsNames[i] = String(object.dnsNames[i]); - } - if (object.uris) { - if (!Array.isArray(object.uris)) - throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.uris: array expected"); - message.uris = []; - for (var i = 0; i < object.uris.length; ++i) - message.uris[i] = String(object.uris[i]); - } - if (object.emailAddresses) { - if (!Array.isArray(object.emailAddresses)) - throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.emailAddresses: array expected"); - message.emailAddresses = []; - for (var i = 0; i < object.emailAddresses.length; ++i) - message.emailAddresses[i] = String(object.emailAddresses[i]); - } - if (object.ipAddresses) { - if (!Array.isArray(object.ipAddresses)) - throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.ipAddresses: array expected"); - message.ipAddresses = []; - for (var i = 0; i < object.ipAddresses.length; ++i) - message.ipAddresses[i] = String(object.ipAddresses[i]); - } - if (object.customSans) { - if (!Array.isArray(object.customSans)) - throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.customSans: array expected"); - message.customSans = []; - for (var i = 0; i < object.customSans.length; ++i) { - if (typeof object.customSans[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.SubjectAltNames.customSans: object expected"); - message.customSans[i] = $root.google.cloud.security.privateca.v1beta1.X509Extension.fromObject(object.customSans[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SubjectAltNames message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @static - * @param {google.cloud.security.privateca.v1beta1.SubjectAltNames} message SubjectAltNames - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubjectAltNames.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dnsNames = []; - object.uris = []; - object.emailAddresses = []; - object.ipAddresses = []; - object.customSans = []; - } - if (message.dnsNames && message.dnsNames.length) { - object.dnsNames = []; - for (var j = 0; j < message.dnsNames.length; ++j) - object.dnsNames[j] = message.dnsNames[j]; - } - if (message.uris && message.uris.length) { - object.uris = []; - for (var j = 0; j < message.uris.length; ++j) - object.uris[j] = message.uris[j]; - } - if (message.emailAddresses && message.emailAddresses.length) { - object.emailAddresses = []; - for (var j = 0; j < message.emailAddresses.length; ++j) - object.emailAddresses[j] = message.emailAddresses[j]; - } - if (message.ipAddresses && message.ipAddresses.length) { - object.ipAddresses = []; - for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = message.ipAddresses[j]; - } - if (message.customSans && message.customSans.length) { - object.customSans = []; - for (var j = 0; j < message.customSans.length; ++j) - object.customSans[j] = $root.google.cloud.security.privateca.v1beta1.X509Extension.toObject(message.customSans[j], options); - } - return object; - }; - - /** - * Converts this SubjectAltNames to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @instance - * @returns {Object.} JSON object - */ - SubjectAltNames.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubjectAltNames - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.SubjectAltNames - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubjectAltNames.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.SubjectAltNames"; - }; - - return SubjectAltNames; - })(); - - /** - * RevocationReason enum. - * @name google.cloud.security.privateca.v1beta1.RevocationReason - * @enum {number} - * @property {number} REVOCATION_REASON_UNSPECIFIED=0 REVOCATION_REASON_UNSPECIFIED value - * @property {number} KEY_COMPROMISE=1 KEY_COMPROMISE value - * @property {number} CERTIFICATE_AUTHORITY_COMPROMISE=2 CERTIFICATE_AUTHORITY_COMPROMISE value - * @property {number} AFFILIATION_CHANGED=3 AFFILIATION_CHANGED value - * @property {number} SUPERSEDED=4 SUPERSEDED value - * @property {number} CESSATION_OF_OPERATION=5 CESSATION_OF_OPERATION value - * @property {number} CERTIFICATE_HOLD=6 CERTIFICATE_HOLD value - * @property {number} PRIVILEGE_WITHDRAWN=7 PRIVILEGE_WITHDRAWN value - * @property {number} ATTRIBUTE_AUTHORITY_COMPROMISE=8 ATTRIBUTE_AUTHORITY_COMPROMISE value - */ - v1beta1.RevocationReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REVOCATION_REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "KEY_COMPROMISE"] = 1; - values[valuesById[2] = "CERTIFICATE_AUTHORITY_COMPROMISE"] = 2; - values[valuesById[3] = "AFFILIATION_CHANGED"] = 3; - values[valuesById[4] = "SUPERSEDED"] = 4; - values[valuesById[5] = "CESSATION_OF_OPERATION"] = 5; - values[valuesById[6] = "CERTIFICATE_HOLD"] = 6; - values[valuesById[7] = "PRIVILEGE_WITHDRAWN"] = 7; - values[valuesById[8] = "ATTRIBUTE_AUTHORITY_COMPROMISE"] = 8; - return values; - })(); - - v1beta1.CertificateAuthorityService = (function() { - - /** - * Constructs a new CertificateAuthorityService service. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a CertificateAuthorityService - * @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 CertificateAuthorityService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CertificateAuthorityService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CertificateAuthorityService; - - /** - * Creates new CertificateAuthorityService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @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 {CertificateAuthorityService} RPC service. Useful where requests and/or responses are streamed. - */ - CertificateAuthorityService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|createCertificate}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef CreateCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.Certificate} [response] Certificate - */ - - /** - * Calls CreateCertificate. - * @function createCertificate - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest} request CreateCertificateRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateCallback} callback Node-style callback called with the error, if any, and Certificate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.createCertificate = function createCertificate(request, callback) { - return this.rpcCall(createCertificate, $root.google.cloud.security.privateca.v1beta1.CreateCertificateRequest, $root.google.cloud.security.privateca.v1beta1.Certificate, request, callback); - }, "name", { value: "CreateCertificate" }); - - /** - * Calls CreateCertificate. - * @function createCertificate - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest} request CreateCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificate}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef GetCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.Certificate} [response] Certificate - */ - - /** - * Calls GetCertificate. - * @function getCertificate - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest} request GetCertificateRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateCallback} callback Node-style callback called with the error, if any, and Certificate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.getCertificate = function getCertificate(request, callback) { - return this.rpcCall(getCertificate, $root.google.cloud.security.privateca.v1beta1.GetCertificateRequest, $root.google.cloud.security.privateca.v1beta1.Certificate, request, callback); - }, "name", { value: "GetCertificate" }); - - /** - * Calls GetCertificate. - * @function getCertificate - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest} request GetCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificates}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef ListCertificatesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} [response] ListCertificatesResponse - */ - - /** - * Calls ListCertificates. - * @function listCertificates - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest} request ListCertificatesRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificatesCallback} callback Node-style callback called with the error, if any, and ListCertificatesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.listCertificates = function listCertificates(request, callback) { - return this.rpcCall(listCertificates, $root.google.cloud.security.privateca.v1beta1.ListCertificatesRequest, $root.google.cloud.security.privateca.v1beta1.ListCertificatesResponse, request, callback); - }, "name", { value: "ListCertificates" }); - - /** - * Calls ListCertificates. - * @function listCertificates - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest} request ListCertificatesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|revokeCertificate}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef RevokeCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.Certificate} [response] Certificate - */ - - /** - * Calls RevokeCertificate. - * @function revokeCertificate - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest} request RevokeCertificateRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificateCallback} callback Node-style callback called with the error, if any, and Certificate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.revokeCertificate = function revokeCertificate(request, callback) { - return this.rpcCall(revokeCertificate, $root.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest, $root.google.cloud.security.privateca.v1beta1.Certificate, request, callback); - }, "name", { value: "RevokeCertificate" }); - - /** - * Calls RevokeCertificate. - * @function revokeCertificate - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest} request RevokeCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificate}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef UpdateCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.Certificate} [response] Certificate - */ - - /** - * Calls UpdateCertificate. - * @function updateCertificate - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest} request UpdateCertificateRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateCallback} callback Node-style callback called with the error, if any, and Certificate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.updateCertificate = function updateCertificate(request, callback) { - return this.rpcCall(updateCertificate, $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest, $root.google.cloud.security.privateca.v1beta1.Certificate, request, callback); - }, "name", { value: "UpdateCertificate" }); - - /** - * Calls UpdateCertificate. - * @function updateCertificate - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest} request UpdateCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|activateCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef ActivateCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ActivateCertificateAuthority. - * @function activateCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest} request ActivateCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.activateCertificateAuthority = function activateCertificateAuthority(request, callback) { - return this.rpcCall(activateCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ActivateCertificateAuthority" }); - - /** - * Calls ActivateCertificateAuthority. - * @function activateCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest} request ActivateCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|createCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef CreateCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateCertificateAuthority. - * @function createCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest} request CreateCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.createCertificateAuthority = function createCertificateAuthority(request, callback) { - return this.rpcCall(createCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCertificateAuthority" }); - - /** - * Calls CreateCertificateAuthority. - * @function createCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest} request CreateCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|disableCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef DisableCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DisableCertificateAuthority. - * @function disableCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest} request DisableCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.disableCertificateAuthority = function disableCertificateAuthority(request, callback) { - return this.rpcCall(disableCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DisableCertificateAuthority" }); - - /** - * Calls DisableCertificateAuthority. - * @function disableCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest} request DisableCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|enableCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef EnableCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls EnableCertificateAuthority. - * @function enableCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest} request EnableCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.enableCertificateAuthority = function enableCertificateAuthority(request, callback) { - return this.rpcCall(enableCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "EnableCertificateAuthority" }); - - /** - * Calls EnableCertificateAuthority. - * @function enableCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest} request EnableCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|fetchCertificateAuthorityCsr}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef FetchCertificateAuthorityCsrCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} [response] FetchCertificateAuthorityCsrResponse - */ - - /** - * Calls FetchCertificateAuthorityCsr. - * @function fetchCertificateAuthorityCsr - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest} request FetchCertificateAuthorityCsrRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsrCallback} callback Node-style callback called with the error, if any, and FetchCertificateAuthorityCsrResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.fetchCertificateAuthorityCsr = function fetchCertificateAuthorityCsr(request, callback) { - return this.rpcCall(fetchCertificateAuthorityCsr, $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest, $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse, request, callback); - }, "name", { value: "FetchCertificateAuthorityCsr" }); - - /** - * Calls FetchCertificateAuthorityCsr. - * @function fetchCertificateAuthorityCsr - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest} request FetchCertificateAuthorityCsrRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef GetCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority} [response] CertificateAuthority - */ - - /** - * Calls GetCertificateAuthority. - * @function getCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest} request GetCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and CertificateAuthority - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.getCertificateAuthority = function getCertificateAuthority(request, callback) { - return this.rpcCall(getCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest, $root.google.cloud.security.privateca.v1beta1.CertificateAuthority, request, callback); - }, "name", { value: "GetCertificateAuthority" }); - - /** - * Calls GetCertificateAuthority. - * @function getCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest} request GetCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificateAuthorities}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef ListCertificateAuthoritiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} [response] ListCertificateAuthoritiesResponse - */ - - /** - * Calls ListCertificateAuthorities. - * @function listCertificateAuthorities - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest} request ListCertificateAuthoritiesRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthoritiesCallback} callback Node-style callback called with the error, if any, and ListCertificateAuthoritiesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.listCertificateAuthorities = function listCertificateAuthorities(request, callback) { - return this.rpcCall(listCertificateAuthorities, $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest, $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse, request, callback); - }, "name", { value: "ListCertificateAuthorities" }); - - /** - * Calls ListCertificateAuthorities. - * @function listCertificateAuthorities - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest} request ListCertificateAuthoritiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|restoreCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef RestoreCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreCertificateAuthority. - * @function restoreCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest} request RestoreCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.restoreCertificateAuthority = function restoreCertificateAuthority(request, callback) { - return this.rpcCall(restoreCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreCertificateAuthority" }); - - /** - * Calls RestoreCertificateAuthority. - * @function restoreCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest} request RestoreCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|scheduleDeleteCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef ScheduleDeleteCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ScheduleDeleteCertificateAuthority. - * @function scheduleDeleteCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest} request ScheduleDeleteCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.scheduleDeleteCertificateAuthority = function scheduleDeleteCertificateAuthority(request, callback) { - return this.rpcCall(scheduleDeleteCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ScheduleDeleteCertificateAuthority" }); - - /** - * Calls ScheduleDeleteCertificateAuthority. - * @function scheduleDeleteCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest} request ScheduleDeleteCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificateAuthority}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef UpdateCertificateAuthorityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateCertificateAuthority. - * @function updateCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest} request UpdateCertificateAuthorityRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthorityCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.updateCertificateAuthority = function updateCertificateAuthority(request, callback) { - return this.rpcCall(updateCertificateAuthority, $root.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCertificateAuthority" }); - - /** - * Calls UpdateCertificateAuthority. - * @function updateCertificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest} request UpdateCertificateAuthorityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getCertificateRevocationList}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef GetCertificateRevocationListCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList} [response] CertificateRevocationList - */ - - /** - * Calls GetCertificateRevocationList. - * @function getCertificateRevocationList - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest} request GetCertificateRevocationListRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationListCallback} callback Node-style callback called with the error, if any, and CertificateRevocationList - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.getCertificateRevocationList = function getCertificateRevocationList(request, callback) { - return this.rpcCall(getCertificateRevocationList, $root.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest, $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList, request, callback); - }, "name", { value: "GetCertificateRevocationList" }); - - /** - * Calls GetCertificateRevocationList. - * @function getCertificateRevocationList - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest} request GetCertificateRevocationListRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listCertificateRevocationLists}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef ListCertificateRevocationListsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} [response] ListCertificateRevocationListsResponse - */ - - /** - * Calls ListCertificateRevocationLists. - * @function listCertificateRevocationLists - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest} request ListCertificateRevocationListsRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationListsCallback} callback Node-style callback called with the error, if any, and ListCertificateRevocationListsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.listCertificateRevocationLists = function listCertificateRevocationLists(request, callback) { - return this.rpcCall(listCertificateRevocationLists, $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest, $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse, request, callback); - }, "name", { value: "ListCertificateRevocationLists" }); - - /** - * Calls ListCertificateRevocationLists. - * @function listCertificateRevocationLists - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest} request ListCertificateRevocationListsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|updateCertificateRevocationList}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef UpdateCertificateRevocationListCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateCertificateRevocationList. - * @function updateCertificateRevocationList - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest} request UpdateCertificateRevocationListRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationListCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.updateCertificateRevocationList = function updateCertificateRevocationList(request, callback) { - return this.rpcCall(updateCertificateRevocationList, $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCertificateRevocationList" }); - - /** - * Calls UpdateCertificateRevocationList. - * @function updateCertificateRevocationList - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest} request UpdateCertificateRevocationListRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|getReusableConfig}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef GetReusableConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.ReusableConfig} [response] ReusableConfig - */ - - /** - * Calls GetReusableConfig. - * @function getReusableConfig - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest} request GetReusableConfigRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfigCallback} callback Node-style callback called with the error, if any, and ReusableConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.getReusableConfig = function getReusableConfig(request, callback) { - return this.rpcCall(getReusableConfig, $root.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest, $root.google.cloud.security.privateca.v1beta1.ReusableConfig, request, callback); - }, "name", { value: "GetReusableConfig" }); - - /** - * Calls GetReusableConfig. - * @function getReusableConfig - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest} request GetReusableConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.security.privateca.v1beta1.CertificateAuthorityService|listReusableConfigs}. - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @typedef ListReusableConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} [response] ListReusableConfigsResponse - */ - - /** - * Calls ListReusableConfigs. - * @function listReusableConfigs - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest} request ListReusableConfigsRequest message or plain object - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigsCallback} callback Node-style callback called with the error, if any, and ListReusableConfigsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CertificateAuthorityService.prototype.listReusableConfigs = function listReusableConfigs(request, callback) { - return this.rpcCall(listReusableConfigs, $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest, $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse, request, callback); - }, "name", { value: "ListReusableConfigs" }); - - /** - * Calls ListReusableConfigs. - * @function listReusableConfigs - * @memberof google.cloud.security.privateca.v1beta1.CertificateAuthorityService - * @instance - * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest} request ListReusableConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CertificateAuthorityService; - })(); - - v1beta1.CreateCertificateRequest = (function() { - - /** - * Properties of a CreateCertificateRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface ICreateCertificateRequest - * @property {string|null} [parent] CreateCertificateRequest parent - * @property {string|null} [certificateId] CreateCertificateRequest certificateId - * @property {google.cloud.security.privateca.v1beta1.ICertificate|null} [certificate] CreateCertificateRequest certificate - * @property {string|null} [requestId] CreateCertificateRequest requestId - */ - - /** - * Constructs a new CreateCertificateRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a CreateCertificateRequest. - * @implements ICreateCertificateRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest=} [properties] Properties to set - */ - function CreateCertificateRequest(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]]; - } - - /** - * CreateCertificateRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @instance - */ - CreateCertificateRequest.prototype.parent = ""; - - /** - * CreateCertificateRequest certificateId. - * @member {string} certificateId - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @instance - */ - CreateCertificateRequest.prototype.certificateId = ""; - - /** - * CreateCertificateRequest certificate. - * @member {google.cloud.security.privateca.v1beta1.ICertificate|null|undefined} certificate - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @instance - */ - CreateCertificateRequest.prototype.certificate = null; - - /** - * CreateCertificateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @instance - */ - CreateCertificateRequest.prototype.requestId = ""; - - /** - * Creates a new CreateCertificateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateRequest} CreateCertificateRequest instance - */ - CreateCertificateRequest.create = function create(properties) { - return new CreateCertificateRequest(properties); - }; - - /** - * Encodes the specified CreateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest} message CreateCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCertificateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.certificateId != null && Object.hasOwnProperty.call(message, "certificateId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateId); - if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) - $root.google.cloud.security.privateca.v1beta1.Certificate.encode(message.certificate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateRequest} message CreateCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCertificateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateRequest} CreateCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCertificateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.certificateId = reader.string(); - break; - } - case 3: { - message.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCertificateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateRequest} CreateCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCertificateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCertificateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCertificateRequest.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.certificateId != null && message.hasOwnProperty("certificateId")) - if (!$util.isString(message.certificateId)) - return "certificateId: string expected"; - if (message.certificate != null && message.hasOwnProperty("certificate")) { - var error = $root.google.cloud.security.privateca.v1beta1.Certificate.verify(message.certificate); - if (error) - return "certificate." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateRequest} CreateCertificateRequest - */ - CreateCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CreateCertificateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.certificateId != null) - message.certificateId = String(object.certificateId); - if (object.certificate != null) { - if (typeof object.certificate !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CreateCertificateRequest.certificate: object expected"); - message.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.fromObject(object.certificate); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateCertificateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.CreateCertificateRequest} message CreateCertificateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCertificateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.certificateId = ""; - object.certificate = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.certificateId != null && message.hasOwnProperty("certificateId")) - object.certificateId = message.certificateId; - if (message.certificate != null && message.hasOwnProperty("certificate")) - object.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.toObject(message.certificate, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateCertificateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCertificateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCertificateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CreateCertificateRequest"; - }; - - return CreateCertificateRequest; - })(); - - v1beta1.GetCertificateRequest = (function() { - - /** - * Properties of a GetCertificateRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IGetCertificateRequest - * @property {string|null} [name] GetCertificateRequest name - */ - - /** - * Constructs a new GetCertificateRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a GetCertificateRequest. - * @implements IGetCertificateRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest=} [properties] Properties to set - */ - function GetCertificateRequest(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]]; - } - - /** - * GetCertificateRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest - * @instance - */ - GetCertificateRequest.prototype.name = ""; - - /** - * Creates a new GetCertificateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRequest} GetCertificateRequest instance - */ - GetCertificateRequest.create = function create(properties) { - return new GetCertificateRequest(properties); - }; - - /** - * Encodes the specified GetCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest} message GetCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRequest} message GetCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCertificateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRequest} GetCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCertificateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRequest} GetCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCertificateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCertificateRequest.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 GetCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRequest} GetCertificateRequest - */ - GetCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.GetCertificateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetCertificateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.GetCertificateRequest} message GetCertificateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCertificateRequest.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 GetCertificateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest - * @instance - * @returns {Object.} JSON object - */ - GetCertificateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCertificateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.GetCertificateRequest"; - }; - - return GetCertificateRequest; - })(); - - v1beta1.ListCertificatesRequest = (function() { - - /** - * Properties of a ListCertificatesRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IListCertificatesRequest - * @property {string|null} [parent] ListCertificatesRequest parent - * @property {number|null} [pageSize] ListCertificatesRequest pageSize - * @property {string|null} [pageToken] ListCertificatesRequest pageToken - * @property {string|null} [filter] ListCertificatesRequest filter - * @property {string|null} [orderBy] ListCertificatesRequest orderBy - */ - - /** - * Constructs a new ListCertificatesRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ListCertificatesRequest. - * @implements IListCertificatesRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest=} [properties] Properties to set - */ - function ListCertificatesRequest(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]]; - } - - /** - * ListCertificatesRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @instance - */ - ListCertificatesRequest.prototype.parent = ""; - - /** - * ListCertificatesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @instance - */ - ListCertificatesRequest.prototype.pageSize = 0; - - /** - * ListCertificatesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @instance - */ - ListCertificatesRequest.prototype.pageToken = ""; - - /** - * ListCertificatesRequest filter. - * @member {string} filter - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @instance - */ - ListCertificatesRequest.prototype.filter = ""; - - /** - * ListCertificatesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @instance - */ - ListCertificatesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListCertificatesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesRequest} ListCertificatesRequest instance - */ - ListCertificatesRequest.create = function create(properties) { - return new ListCertificatesRequest(properties); - }; - - /** - * Encodes the specified ListCertificatesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest} message ListCertificatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificatesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificatesRequest} message ListCertificatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificatesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesRequest} ListCertificatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificatesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListCertificatesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesRequest} ListCertificatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificatesRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificatesRequest.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 ListCertificatesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesRequest} ListCertificatesRequest - */ - ListCertificatesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificatesRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListCertificatesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ListCertificatesRequest} message ListCertificatesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificatesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListCertificatesRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @instance - * @returns {Object.} JSON object - */ - ListCertificatesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificatesRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificatesRequest"; - }; - - return ListCertificatesRequest; - })(); - - v1beta1.ListCertificatesResponse = (function() { - - /** - * Properties of a ListCertificatesResponse. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IListCertificatesResponse - * @property {Array.|null} [certificates] ListCertificatesResponse certificates - * @property {string|null} [nextPageToken] ListCertificatesResponse nextPageToken - * @property {Array.|null} [unreachable] ListCertificatesResponse unreachable - */ - - /** - * Constructs a new ListCertificatesResponse. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ListCertificatesResponse. - * @implements IListCertificatesResponse - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IListCertificatesResponse=} [properties] Properties to set - */ - function ListCertificatesResponse(properties) { - this.certificates = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCertificatesResponse certificates. - * @member {Array.} certificates - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @instance - */ - ListCertificatesResponse.prototype.certificates = $util.emptyArray; - - /** - * ListCertificatesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @instance - */ - ListCertificatesResponse.prototype.nextPageToken = ""; - - /** - * ListCertificatesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @instance - */ - ListCertificatesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListCertificatesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificatesResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} ListCertificatesResponse instance - */ - ListCertificatesResponse.create = function create(properties) { - return new ListCertificatesResponse(properties); - }; - - /** - * Encodes the specified ListCertificatesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificatesResponse} message ListCertificatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificatesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificates != null && message.certificates.length) - for (var i = 0; i < message.certificates.length; ++i) - $root.google.cloud.security.privateca.v1beta1.Certificate.encode(message.certificates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListCertificatesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificatesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificatesResponse} message ListCertificatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificatesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} ListCertificatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificatesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificatesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.certificates && message.certificates.length)) - message.certificates = []; - message.certificates.push($root.google.cloud.security.privateca.v1beta1.Certificate.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCertificatesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} ListCertificatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificatesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificatesResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificatesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificates != null && message.hasOwnProperty("certificates")) { - if (!Array.isArray(message.certificates)) - return "certificates: array expected"; - for (var i = 0; i < message.certificates.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.Certificate.verify(message.certificates[i]); - if (error) - return "certificates." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListCertificatesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} ListCertificatesResponse - */ - ListCertificatesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificatesResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificatesResponse(); - if (object.certificates) { - if (!Array.isArray(object.certificates)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificatesResponse.certificates: array expected"); - message.certificates = []; - for (var i = 0; i < object.certificates.length; ++i) { - if (typeof object.certificates[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificatesResponse.certificates: object expected"); - message.certificates[i] = $root.google.cloud.security.privateca.v1beta1.Certificate.fromObject(object.certificates[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificatesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListCertificatesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.ListCertificatesResponse} message ListCertificatesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificatesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.certificates = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.certificates && message.certificates.length) { - object.certificates = []; - for (var j = 0; j < message.certificates.length; ++j) - object.certificates[j] = $root.google.cloud.security.privateca.v1beta1.Certificate.toObject(message.certificates[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListCertificatesResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @instance - * @returns {Object.} JSON object - */ - ListCertificatesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificatesResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ListCertificatesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificatesResponse"; - }; - - return ListCertificatesResponse; - })(); - - v1beta1.RevokeCertificateRequest = (function() { - - /** - * Properties of a RevokeCertificateRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IRevokeCertificateRequest - * @property {string|null} [name] RevokeCertificateRequest name - * @property {google.cloud.security.privateca.v1beta1.RevocationReason|null} [reason] RevokeCertificateRequest reason - * @property {string|null} [requestId] RevokeCertificateRequest requestId - */ - - /** - * Constructs a new RevokeCertificateRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a RevokeCertificateRequest. - * @implements IRevokeCertificateRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest=} [properties] Properties to set - */ - function RevokeCertificateRequest(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]]; - } - - /** - * RevokeCertificateRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @instance - */ - RevokeCertificateRequest.prototype.name = ""; - - /** - * RevokeCertificateRequest reason. - * @member {google.cloud.security.privateca.v1beta1.RevocationReason} reason - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @instance - */ - RevokeCertificateRequest.prototype.reason = 0; - - /** - * RevokeCertificateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @instance - */ - RevokeCertificateRequest.prototype.requestId = ""; - - /** - * Creates a new RevokeCertificateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.RevokeCertificateRequest} RevokeCertificateRequest instance - */ - RevokeCertificateRequest.create = function create(properties) { - return new RevokeCertificateRequest(properties); - }; - - /** - * Encodes the specified RevokeCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RevokeCertificateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest} message RevokeCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevokeCertificateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified RevokeCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RevokeCertificateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest} message RevokeCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevokeCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevokeCertificateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.RevokeCertificateRequest} RevokeCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevokeCertificateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.reason = reader.int32(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevokeCertificateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.RevokeCertificateRequest} RevokeCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevokeCertificateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevokeCertificateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevokeCertificateRequest.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.reason != null && message.hasOwnProperty("reason")) - switch (message.reason) { - default: - return "reason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a RevokeCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.RevokeCertificateRequest} RevokeCertificateRequest - */ - RevokeCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.reason) { - default: - if (typeof object.reason === "number") { - message.reason = object.reason; - break; - } - break; - case "REVOCATION_REASON_UNSPECIFIED": - case 0: - message.reason = 0; - break; - case "KEY_COMPROMISE": - case 1: - message.reason = 1; - break; - case "CERTIFICATE_AUTHORITY_COMPROMISE": - case 2: - message.reason = 2; - break; - case "AFFILIATION_CHANGED": - case 3: - message.reason = 3; - break; - case "SUPERSEDED": - case 4: - message.reason = 4; - break; - case "CESSATION_OF_OPERATION": - case 5: - message.reason = 5; - break; - case "CERTIFICATE_HOLD": - case 6: - message.reason = 6; - break; - case "PRIVILEGE_WITHDRAWN": - case 7: - message.reason = 7; - break; - case "ATTRIBUTE_AUTHORITY_COMPROMISE": - case 8: - message.reason = 8; - break; - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a RevokeCertificateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.RevokeCertificateRequest} message RevokeCertificateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevokeCertificateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.reason = options.enums === String ? "REVOCATION_REASON_UNSPECIFIED" : 0; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = options.enums === String ? $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.reason] === undefined ? message.reason : $root.google.cloud.security.privateca.v1beta1.RevocationReason[message.reason] : message.reason; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this RevokeCertificateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @instance - * @returns {Object.} JSON object - */ - RevokeCertificateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevokeCertificateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.RevokeCertificateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevokeCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.RevokeCertificateRequest"; - }; - - return RevokeCertificateRequest; - })(); - - v1beta1.UpdateCertificateRequest = (function() { - - /** - * Properties of an UpdateCertificateRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IUpdateCertificateRequest - * @property {google.cloud.security.privateca.v1beta1.ICertificate|null} [certificate] UpdateCertificateRequest certificate - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateRequest updateMask - * @property {string|null} [requestId] UpdateCertificateRequest requestId - */ - - /** - * Constructs a new UpdateCertificateRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents an UpdateCertificateRequest. - * @implements IUpdateCertificateRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest=} [properties] Properties to set - */ - function UpdateCertificateRequest(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]]; - } - - /** - * UpdateCertificateRequest certificate. - * @member {google.cloud.security.privateca.v1beta1.ICertificate|null|undefined} certificate - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @instance - */ - UpdateCertificateRequest.prototype.certificate = null; - - /** - * UpdateCertificateRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @instance - */ - UpdateCertificateRequest.prototype.updateMask = null; - - /** - * UpdateCertificateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @instance - */ - UpdateCertificateRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateCertificateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRequest} UpdateCertificateRequest instance - */ - UpdateCertificateRequest.create = function create(properties) { - return new UpdateCertificateRequest(properties); - }; - - /** - * Encodes the specified UpdateCertificateRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest} message UpdateCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) - $root.google.cloud.security.privateca.v1beta1.Certificate.encode(message.certificate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest} message UpdateCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCertificateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRequest} UpdateCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCertificateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRequest} UpdateCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCertificateRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCertificateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificate != null && message.hasOwnProperty("certificate")) { - var error = $root.google.cloud.security.privateca.v1beta1.Certificate.verify(message.certificate); - if (error) - return "certificate." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRequest} UpdateCertificateRequest - */ - UpdateCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(); - if (object.certificate != null) { - if (typeof object.certificate !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.certificate: object expected"); - message.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.fromObject(object.certificate); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateCertificateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.UpdateCertificateRequest} message UpdateCertificateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCertificateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.certificate = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.certificate != null && message.hasOwnProperty("certificate")) - object.certificate = $root.google.cloud.security.privateca.v1beta1.Certificate.toObject(message.certificate, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateCertificateRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCertificateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCertificateRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.UpdateCertificateRequest"; - }; - - return UpdateCertificateRequest; - })(); - - v1beta1.ActivateCertificateAuthorityRequest = (function() { - - /** - * Properties of an ActivateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IActivateCertificateAuthorityRequest - * @property {string|null} [name] ActivateCertificateAuthorityRequest name - * @property {string|null} [pemCaCertificate] ActivateCertificateAuthorityRequest pemCaCertificate - * @property {google.cloud.security.privateca.v1beta1.ISubordinateConfig|null} [subordinateConfig] ActivateCertificateAuthorityRequest subordinateConfig - * @property {string|null} [requestId] ActivateCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new ActivateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents an ActivateCertificateAuthorityRequest. - * @implements IActivateCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest=} [properties] Properties to set - */ - function ActivateCertificateAuthorityRequest(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]]; - } - - /** - * ActivateCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @instance - */ - ActivateCertificateAuthorityRequest.prototype.name = ""; - - /** - * ActivateCertificateAuthorityRequest pemCaCertificate. - * @member {string} pemCaCertificate - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @instance - */ - ActivateCertificateAuthorityRequest.prototype.pemCaCertificate = ""; - - /** - * ActivateCertificateAuthorityRequest subordinateConfig. - * @member {google.cloud.security.privateca.v1beta1.ISubordinateConfig|null|undefined} subordinateConfig - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @instance - */ - ActivateCertificateAuthorityRequest.prototype.subordinateConfig = null; - - /** - * ActivateCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @instance - */ - ActivateCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new ActivateCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest instance - */ - ActivateCertificateAuthorityRequest.create = function create(properties) { - return new ActivateCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified ActivateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActivateCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.pemCaCertificate != null && Object.hasOwnProperty.call(message, "pemCaCertificate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCaCertificate); - if (message.subordinateConfig != null && Object.hasOwnProperty.call(message, "subordinateConfig")) - $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.encode(message.subordinateConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified ActivateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActivateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActivateCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.pemCaCertificate = reader.string(); - break; - } - case 3: { - message.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ActivateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActivateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ActivateCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ActivateCertificateAuthorityRequest.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.pemCaCertificate != null && message.hasOwnProperty("pemCaCertificate")) - if (!$util.isString(message.pemCaCertificate)) - return "pemCaCertificate: string expected"; - if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) { - var error = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.verify(message.subordinateConfig); - if (error) - return "subordinateConfig." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an ActivateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest} ActivateCertificateAuthorityRequest - */ - ActivateCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.pemCaCertificate != null) - message.pemCaCertificate = String(object.pemCaCertificate); - if (object.subordinateConfig != null) { - if (typeof object.subordinateConfig !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest.subordinateConfig: object expected"); - message.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.fromObject(object.subordinateConfig); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an ActivateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest} message ActivateCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ActivateCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.pemCaCertificate = ""; - object.subordinateConfig = null; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.pemCaCertificate != null && message.hasOwnProperty("pemCaCertificate")) - object.pemCaCertificate = message.pemCaCertificate; - if (message.subordinateConfig != null && message.hasOwnProperty("subordinateConfig")) - object.subordinateConfig = $root.google.cloud.security.privateca.v1beta1.SubordinateConfig.toObject(message.subordinateConfig, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this ActivateCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - ActivateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ActivateCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ActivateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest"; - }; - - return ActivateCertificateAuthorityRequest; - })(); - - v1beta1.CreateCertificateAuthorityRequest = (function() { - - /** - * Properties of a CreateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface ICreateCertificateAuthorityRequest - * @property {string|null} [parent] CreateCertificateAuthorityRequest parent - * @property {string|null} [certificateAuthorityId] CreateCertificateAuthorityRequest certificateAuthorityId - * @property {google.cloud.security.privateca.v1beta1.ICertificateAuthority|null} [certificateAuthority] CreateCertificateAuthorityRequest certificateAuthority - * @property {string|null} [requestId] CreateCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new CreateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a CreateCertificateAuthorityRequest. - * @implements ICreateCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest=} [properties] Properties to set - */ - function CreateCertificateAuthorityRequest(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]]; - } - - /** - * CreateCertificateAuthorityRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @instance - */ - CreateCertificateAuthorityRequest.prototype.parent = ""; - - /** - * CreateCertificateAuthorityRequest certificateAuthorityId. - * @member {string} certificateAuthorityId - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @instance - */ - CreateCertificateAuthorityRequest.prototype.certificateAuthorityId = ""; - - /** - * CreateCertificateAuthorityRequest certificateAuthority. - * @member {google.cloud.security.privateca.v1beta1.ICertificateAuthority|null|undefined} certificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @instance - */ - CreateCertificateAuthorityRequest.prototype.certificateAuthority = null; - - /** - * CreateCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @instance - */ - CreateCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new CreateCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest instance - */ - CreateCertificateAuthorityRequest.create = function create(properties) { - return new CreateCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified CreateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.certificateAuthorityId != null && Object.hasOwnProperty.call(message, "certificateAuthorityId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateAuthorityId); - if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) - $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.encode(message.certificateAuthority, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.certificateAuthorityId = reader.string(); - break; - } - case 3: { - message.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCertificateAuthorityRequest.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.certificateAuthorityId != null && message.hasOwnProperty("certificateAuthorityId")) - if (!$util.isString(message.certificateAuthorityId)) - return "certificateAuthorityId: string expected"; - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.verify(message.certificateAuthority); - if (error) - return "certificateAuthority." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest} CreateCertificateAuthorityRequest - */ - CreateCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.certificateAuthorityId != null) - message.certificateAuthorityId = String(object.certificateAuthorityId); - if (object.certificateAuthority != null) { - if (typeof object.certificateAuthority !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest.certificateAuthority: object expected"); - message.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.fromObject(object.certificateAuthority); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest} message CreateCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.certificateAuthorityId = ""; - object.certificateAuthority = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.certificateAuthorityId != null && message.hasOwnProperty("certificateAuthorityId")) - object.certificateAuthorityId = message.certificateAuthorityId; - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) - object.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.toObject(message.certificateAuthority, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest"; - }; - - return CreateCertificateAuthorityRequest; - })(); - - v1beta1.DisableCertificateAuthorityRequest = (function() { - - /** - * Properties of a DisableCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IDisableCertificateAuthorityRequest - * @property {string|null} [name] DisableCertificateAuthorityRequest name - * @property {string|null} [requestId] DisableCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new DisableCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a DisableCertificateAuthorityRequest. - * @implements IDisableCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest=} [properties] Properties to set - */ - function DisableCertificateAuthorityRequest(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]]; - } - - /** - * DisableCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @instance - */ - DisableCertificateAuthorityRequest.prototype.name = ""; - - /** - * DisableCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @instance - */ - DisableCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new DisableCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest instance - */ - DisableCertificateAuthorityRequest.create = function create(properties) { - return new DisableCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified DisableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified DisableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DisableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisableCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisableCertificateAuthorityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a DisableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest} DisableCertificateAuthorityRequest - */ - DisableCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a DisableCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest} message DisableCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisableCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this DisableCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - DisableCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisableCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisableCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest"; - }; - - return DisableCertificateAuthorityRequest; - })(); - - v1beta1.EnableCertificateAuthorityRequest = (function() { - - /** - * Properties of an EnableCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IEnableCertificateAuthorityRequest - * @property {string|null} [name] EnableCertificateAuthorityRequest name - * @property {string|null} [requestId] EnableCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new EnableCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents an EnableCertificateAuthorityRequest. - * @implements IEnableCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest=} [properties] Properties to set - */ - function EnableCertificateAuthorityRequest(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]]; - } - - /** - * EnableCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @instance - */ - EnableCertificateAuthorityRequest.prototype.name = ""; - - /** - * EnableCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @instance - */ - EnableCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new EnableCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest instance - */ - EnableCertificateAuthorityRequest.create = function create(properties) { - return new EnableCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified EnableCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified EnableCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnableCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnableCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnableCertificateAuthorityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an EnableCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest} EnableCertificateAuthorityRequest - */ - EnableCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an EnableCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest} message EnableCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnableCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this EnableCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - EnableCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnableCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnableCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest"; - }; - - return EnableCertificateAuthorityRequest; - })(); - - v1beta1.FetchCertificateAuthorityCsrRequest = (function() { - - /** - * Properties of a FetchCertificateAuthorityCsrRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IFetchCertificateAuthorityCsrRequest - * @property {string|null} [name] FetchCertificateAuthorityCsrRequest name - */ - - /** - * Constructs a new FetchCertificateAuthorityCsrRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a FetchCertificateAuthorityCsrRequest. - * @implements IFetchCertificateAuthorityCsrRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest=} [properties] Properties to set - */ - function FetchCertificateAuthorityCsrRequest(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]]; - } - - /** - * FetchCertificateAuthorityCsrRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest - * @instance - */ - FetchCertificateAuthorityCsrRequest.prototype.name = ""; - - /** - * Creates a new FetchCertificateAuthorityCsrRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest instance - */ - FetchCertificateAuthorityCsrRequest.create = function create(properties) { - return new FetchCertificateAuthorityCsrRequest(properties); - }; - - /** - * Encodes the specified FetchCertificateAuthorityCsrRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCertificateAuthorityCsrRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified FetchCertificateAuthorityCsrRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCertificateAuthorityCsrRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCertificateAuthorityCsrRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchCertificateAuthorityCsrRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCertificateAuthorityCsrRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchCertificateAuthorityCsrRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchCertificateAuthorityCsrRequest.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 FetchCertificateAuthorityCsrRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest} FetchCertificateAuthorityCsrRequest - */ - FetchCertificateAuthorityCsrRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a FetchCertificateAuthorityCsrRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest} message FetchCertificateAuthorityCsrRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchCertificateAuthorityCsrRequest.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 FetchCertificateAuthorityCsrRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest - * @instance - * @returns {Object.} JSON object - */ - FetchCertificateAuthorityCsrRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchCertificateAuthorityCsrRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchCertificateAuthorityCsrRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest"; - }; - - return FetchCertificateAuthorityCsrRequest; - })(); - - v1beta1.FetchCertificateAuthorityCsrResponse = (function() { - - /** - * Properties of a FetchCertificateAuthorityCsrResponse. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IFetchCertificateAuthorityCsrResponse - * @property {string|null} [pemCsr] FetchCertificateAuthorityCsrResponse pemCsr - */ - - /** - * Constructs a new FetchCertificateAuthorityCsrResponse. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a FetchCertificateAuthorityCsrResponse. - * @implements IFetchCertificateAuthorityCsrResponse - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse=} [properties] Properties to set - */ - function FetchCertificateAuthorityCsrResponse(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]]; - } - - /** - * FetchCertificateAuthorityCsrResponse pemCsr. - * @member {string} pemCsr - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse - * @instance - */ - FetchCertificateAuthorityCsrResponse.prototype.pemCsr = ""; - - /** - * Creates a new FetchCertificateAuthorityCsrResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse instance - */ - FetchCertificateAuthorityCsrResponse.create = function create(properties) { - return new FetchCertificateAuthorityCsrResponse(properties); - }; - - /** - * Encodes the specified FetchCertificateAuthorityCsrResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCertificateAuthorityCsrResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCsr); - return writer; - }; - - /** - * Encodes the specified FetchCertificateAuthorityCsrResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchCertificateAuthorityCsrResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCertificateAuthorityCsrResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pemCsr = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchCertificateAuthorityCsrResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchCertificateAuthorityCsrResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchCertificateAuthorityCsrResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchCertificateAuthorityCsrResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - if (!$util.isString(message.pemCsr)) - return "pemCsr: string expected"; - return null; - }; - - /** - * Creates a FetchCertificateAuthorityCsrResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} FetchCertificateAuthorityCsrResponse - */ - FetchCertificateAuthorityCsrResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse(); - if (object.pemCsr != null) - message.pemCsr = String(object.pemCsr); - return message; - }; - - /** - * Creates a plain object from a FetchCertificateAuthorityCsrResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse} message FetchCertificateAuthorityCsrResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchCertificateAuthorityCsrResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pemCsr = ""; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - object.pemCsr = message.pemCsr; - return object; - }; - - /** - * Converts this FetchCertificateAuthorityCsrResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse - * @instance - * @returns {Object.} JSON object - */ - FetchCertificateAuthorityCsrResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchCertificateAuthorityCsrResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchCertificateAuthorityCsrResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse"; - }; - - return FetchCertificateAuthorityCsrResponse; - })(); - - v1beta1.GetCertificateAuthorityRequest = (function() { - - /** - * Properties of a GetCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IGetCertificateAuthorityRequest - * @property {string|null} [name] GetCertificateAuthorityRequest name - */ - - /** - * Constructs a new GetCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a GetCertificateAuthorityRequest. - * @implements IGetCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest=} [properties] Properties to set - */ - function GetCertificateAuthorityRequest(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]]; - } - - /** - * GetCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest - * @instance - */ - GetCertificateAuthorityRequest.prototype.name = ""; - - /** - * Creates a new GetCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest instance - */ - GetCertificateAuthorityRequest.create = function create(properties) { - return new GetCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified GetCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest} message GetCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest} message GetCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCertificateAuthorityRequest.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 GetCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest} GetCertificateAuthorityRequest - */ - GetCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest} message GetCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCertificateAuthorityRequest.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 GetCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - GetCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest"; - }; - - return GetCertificateAuthorityRequest; - })(); - - v1beta1.ListCertificateAuthoritiesRequest = (function() { - - /** - * Properties of a ListCertificateAuthoritiesRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IListCertificateAuthoritiesRequest - * @property {string|null} [parent] ListCertificateAuthoritiesRequest parent - * @property {number|null} [pageSize] ListCertificateAuthoritiesRequest pageSize - * @property {string|null} [pageToken] ListCertificateAuthoritiesRequest pageToken - * @property {string|null} [filter] ListCertificateAuthoritiesRequest filter - * @property {string|null} [orderBy] ListCertificateAuthoritiesRequest orderBy - */ - - /** - * Constructs a new ListCertificateAuthoritiesRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ListCertificateAuthoritiesRequest. - * @implements IListCertificateAuthoritiesRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest=} [properties] Properties to set - */ - function ListCertificateAuthoritiesRequest(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]]; - } - - /** - * ListCertificateAuthoritiesRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @instance - */ - ListCertificateAuthoritiesRequest.prototype.parent = ""; - - /** - * ListCertificateAuthoritiesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @instance - */ - ListCertificateAuthoritiesRequest.prototype.pageSize = 0; - - /** - * ListCertificateAuthoritiesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @instance - */ - ListCertificateAuthoritiesRequest.prototype.pageToken = ""; - - /** - * ListCertificateAuthoritiesRequest filter. - * @member {string} filter - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @instance - */ - ListCertificateAuthoritiesRequest.prototype.filter = ""; - - /** - * ListCertificateAuthoritiesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @instance - */ - ListCertificateAuthoritiesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListCertificateAuthoritiesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest instance - */ - ListCertificateAuthoritiesRequest.create = function create(properties) { - return new ListCertificateAuthoritiesRequest(properties); - }; - - /** - * Encodes the specified ListCertificateAuthoritiesRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateAuthoritiesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListCertificateAuthoritiesRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateAuthoritiesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificateAuthoritiesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateAuthoritiesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListCertificateAuthoritiesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateAuthoritiesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificateAuthoritiesRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificateAuthoritiesRequest.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 ListCertificateAuthoritiesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest} ListCertificateAuthoritiesRequest - */ - ListCertificateAuthoritiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListCertificateAuthoritiesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest} message ListCertificateAuthoritiesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificateAuthoritiesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListCertificateAuthoritiesRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @instance - * @returns {Object.} JSON object - */ - ListCertificateAuthoritiesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificateAuthoritiesRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificateAuthoritiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest"; - }; - - return ListCertificateAuthoritiesRequest; - })(); - - v1beta1.ListCertificateAuthoritiesResponse = (function() { - - /** - * Properties of a ListCertificateAuthoritiesResponse. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IListCertificateAuthoritiesResponse - * @property {Array.|null} [certificateAuthorities] ListCertificateAuthoritiesResponse certificateAuthorities - * @property {string|null} [nextPageToken] ListCertificateAuthoritiesResponse nextPageToken - * @property {Array.|null} [unreachable] ListCertificateAuthoritiesResponse unreachable - */ - - /** - * Constructs a new ListCertificateAuthoritiesResponse. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ListCertificateAuthoritiesResponse. - * @implements IListCertificateAuthoritiesResponse - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse=} [properties] Properties to set - */ - function ListCertificateAuthoritiesResponse(properties) { - this.certificateAuthorities = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCertificateAuthoritiesResponse certificateAuthorities. - * @member {Array.} certificateAuthorities - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @instance - */ - ListCertificateAuthoritiesResponse.prototype.certificateAuthorities = $util.emptyArray; - - /** - * ListCertificateAuthoritiesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @instance - */ - ListCertificateAuthoritiesResponse.prototype.nextPageToken = ""; - - /** - * ListCertificateAuthoritiesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @instance - */ - ListCertificateAuthoritiesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListCertificateAuthoritiesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse instance - */ - ListCertificateAuthoritiesResponse.create = function create(properties) { - return new ListCertificateAuthoritiesResponse(properties); - }; - - /** - * Encodes the specified ListCertificateAuthoritiesResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateAuthoritiesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateAuthorities != null && message.certificateAuthorities.length) - for (var i = 0; i < message.certificateAuthorities.length; ++i) - $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.encode(message.certificateAuthorities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListCertificateAuthoritiesResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateAuthoritiesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateAuthoritiesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.certificateAuthorities && message.certificateAuthorities.length)) - message.certificateAuthorities = []; - message.certificateAuthorities.push($root.google.cloud.security.privateca.v1beta1.CertificateAuthority.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCertificateAuthoritiesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateAuthoritiesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificateAuthoritiesResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificateAuthoritiesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificateAuthorities != null && message.hasOwnProperty("certificateAuthorities")) { - if (!Array.isArray(message.certificateAuthorities)) - return "certificateAuthorities: array expected"; - for (var i = 0; i < message.certificateAuthorities.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.verify(message.certificateAuthorities[i]); - if (error) - return "certificateAuthorities." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListCertificateAuthoritiesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} ListCertificateAuthoritiesResponse - */ - ListCertificateAuthoritiesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse(); - if (object.certificateAuthorities) { - if (!Array.isArray(object.certificateAuthorities)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.certificateAuthorities: array expected"); - message.certificateAuthorities = []; - for (var i = 0; i < object.certificateAuthorities.length; ++i) { - if (typeof object.certificateAuthorities[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.certificateAuthorities: object expected"); - message.certificateAuthorities[i] = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.fromObject(object.certificateAuthorities[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListCertificateAuthoritiesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse} message ListCertificateAuthoritiesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificateAuthoritiesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.certificateAuthorities = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.certificateAuthorities && message.certificateAuthorities.length) { - object.certificateAuthorities = []; - for (var j = 0; j < message.certificateAuthorities.length; ++j) - object.certificateAuthorities[j] = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.toObject(message.certificateAuthorities[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListCertificateAuthoritiesResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @instance - * @returns {Object.} JSON object - */ - ListCertificateAuthoritiesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificateAuthoritiesResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificateAuthoritiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse"; - }; - - return ListCertificateAuthoritiesResponse; - })(); - - v1beta1.RestoreCertificateAuthorityRequest = (function() { - - /** - * Properties of a RestoreCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IRestoreCertificateAuthorityRequest - * @property {string|null} [name] RestoreCertificateAuthorityRequest name - * @property {string|null} [requestId] RestoreCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new RestoreCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a RestoreCertificateAuthorityRequest. - * @implements IRestoreCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest=} [properties] Properties to set - */ - function RestoreCertificateAuthorityRequest(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]]; - } - - /** - * RestoreCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @instance - */ - RestoreCertificateAuthorityRequest.prototype.name = ""; - - /** - * RestoreCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @instance - */ - RestoreCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new RestoreCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest} RestoreCertificateAuthorityRequest instance - */ - RestoreCertificateAuthorityRequest.create = function create(properties) { - return new RestoreCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified RestoreCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest} message RestoreCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified RestoreCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest} message RestoreCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest} RestoreCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest} RestoreCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreCertificateAuthorityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a RestoreCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest} RestoreCertificateAuthorityRequest - */ - RestoreCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a RestoreCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest} message RestoreCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this RestoreCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest"; - }; - - return RestoreCertificateAuthorityRequest; - })(); - - v1beta1.ScheduleDeleteCertificateAuthorityRequest = (function() { - - /** - * Properties of a ScheduleDeleteCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IScheduleDeleteCertificateAuthorityRequest - * @property {string|null} [name] ScheduleDeleteCertificateAuthorityRequest name - * @property {string|null} [requestId] ScheduleDeleteCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new ScheduleDeleteCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ScheduleDeleteCertificateAuthorityRequest. - * @implements IScheduleDeleteCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest=} [properties] Properties to set - */ - function ScheduleDeleteCertificateAuthorityRequest(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]]; - } - - /** - * ScheduleDeleteCertificateAuthorityRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @instance - */ - ScheduleDeleteCertificateAuthorityRequest.prototype.name = ""; - - /** - * ScheduleDeleteCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @instance - */ - ScheduleDeleteCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new ScheduleDeleteCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest} ScheduleDeleteCertificateAuthorityRequest instance - */ - ScheduleDeleteCertificateAuthorityRequest.create = function create(properties) { - return new ScheduleDeleteCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified ScheduleDeleteCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest} message ScheduleDeleteCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScheduleDeleteCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified ScheduleDeleteCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest} message ScheduleDeleteCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScheduleDeleteCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ScheduleDeleteCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest} ScheduleDeleteCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScheduleDeleteCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ScheduleDeleteCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest} ScheduleDeleteCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScheduleDeleteCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ScheduleDeleteCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScheduleDeleteCertificateAuthorityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a ScheduleDeleteCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest} ScheduleDeleteCertificateAuthorityRequest - */ - ScheduleDeleteCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a ScheduleDeleteCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest} message ScheduleDeleteCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScheduleDeleteCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this ScheduleDeleteCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - ScheduleDeleteCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ScheduleDeleteCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScheduleDeleteCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest"; - }; - - return ScheduleDeleteCertificateAuthorityRequest; - })(); - - v1beta1.UpdateCertificateAuthorityRequest = (function() { - - /** - * Properties of an UpdateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IUpdateCertificateAuthorityRequest - * @property {google.cloud.security.privateca.v1beta1.ICertificateAuthority|null} [certificateAuthority] UpdateCertificateAuthorityRequest certificateAuthority - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateAuthorityRequest updateMask - * @property {string|null} [requestId] UpdateCertificateAuthorityRequest requestId - */ - - /** - * Constructs a new UpdateCertificateAuthorityRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents an UpdateCertificateAuthorityRequest. - * @implements IUpdateCertificateAuthorityRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest=} [properties] Properties to set - */ - function UpdateCertificateAuthorityRequest(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]]; - } - - /** - * UpdateCertificateAuthorityRequest certificateAuthority. - * @member {google.cloud.security.privateca.v1beta1.ICertificateAuthority|null|undefined} certificateAuthority - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @instance - */ - UpdateCertificateAuthorityRequest.prototype.certificateAuthority = null; - - /** - * UpdateCertificateAuthorityRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @instance - */ - UpdateCertificateAuthorityRequest.prototype.updateMask = null; - - /** - * UpdateCertificateAuthorityRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @instance - */ - UpdateCertificateAuthorityRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateCertificateAuthorityRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest instance - */ - UpdateCertificateAuthorityRequest.create = function create(properties) { - return new UpdateCertificateAuthorityRequest(properties); - }; - - /** - * Encodes the specified UpdateCertificateAuthorityRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateAuthorityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateAuthority != null && Object.hasOwnProperty.call(message, "certificateAuthority")) - $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.encode(message.certificateAuthority, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateCertificateAuthorityRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateAuthorityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateAuthorityRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCertificateAuthorityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateAuthorityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCertificateAuthorityRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCertificateAuthorityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.verify(message.certificateAuthority); - if (error) - return "certificateAuthority." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateCertificateAuthorityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest} UpdateCertificateAuthorityRequest - */ - UpdateCertificateAuthorityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(); - if (object.certificateAuthority != null) { - if (typeof object.certificateAuthority !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.certificateAuthority: object expected"); - message.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.fromObject(object.certificateAuthority); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateCertificateAuthorityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest} message UpdateCertificateAuthorityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCertificateAuthorityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.certificateAuthority = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.certificateAuthority != null && message.hasOwnProperty("certificateAuthority")) - object.certificateAuthority = $root.google.cloud.security.privateca.v1beta1.CertificateAuthority.toObject(message.certificateAuthority, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateCertificateAuthorityRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCertificateAuthorityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCertificateAuthorityRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCertificateAuthorityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest"; - }; - - return UpdateCertificateAuthorityRequest; - })(); - - v1beta1.GetCertificateRevocationListRequest = (function() { - - /** - * Properties of a GetCertificateRevocationListRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IGetCertificateRevocationListRequest - * @property {string|null} [name] GetCertificateRevocationListRequest name - */ - - /** - * Constructs a new GetCertificateRevocationListRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a GetCertificateRevocationListRequest. - * @implements IGetCertificateRevocationListRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest=} [properties] Properties to set - */ - function GetCertificateRevocationListRequest(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]]; - } - - /** - * GetCertificateRevocationListRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest - * @instance - */ - GetCertificateRevocationListRequest.prototype.name = ""; - - /** - * Creates a new GetCertificateRevocationListRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest instance - */ - GetCertificateRevocationListRequest.create = function create(properties) { - return new GetCertificateRevocationListRequest(properties); - }; - - /** - * Encodes the specified GetCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest} message GetCertificateRevocationListRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateRevocationListRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest} message GetCertificateRevocationListRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCertificateRevocationListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateRevocationListRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCertificateRevocationListRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCertificateRevocationListRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCertificateRevocationListRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCertificateRevocationListRequest.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 GetCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest} GetCertificateRevocationListRequest - */ - GetCertificateRevocationListRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetCertificateRevocationListRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest} message GetCertificateRevocationListRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCertificateRevocationListRequest.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 GetCertificateRevocationListRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest - * @instance - * @returns {Object.} JSON object - */ - GetCertificateRevocationListRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCertificateRevocationListRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCertificateRevocationListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest"; - }; - - return GetCertificateRevocationListRequest; - })(); - - v1beta1.ListCertificateRevocationListsRequest = (function() { - - /** - * Properties of a ListCertificateRevocationListsRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IListCertificateRevocationListsRequest - * @property {string|null} [parent] ListCertificateRevocationListsRequest parent - * @property {number|null} [pageSize] ListCertificateRevocationListsRequest pageSize - * @property {string|null} [pageToken] ListCertificateRevocationListsRequest pageToken - * @property {string|null} [filter] ListCertificateRevocationListsRequest filter - * @property {string|null} [orderBy] ListCertificateRevocationListsRequest orderBy - */ - - /** - * Constructs a new ListCertificateRevocationListsRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ListCertificateRevocationListsRequest. - * @implements IListCertificateRevocationListsRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest=} [properties] Properties to set - */ - function ListCertificateRevocationListsRequest(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]]; - } - - /** - * ListCertificateRevocationListsRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @instance - */ - ListCertificateRevocationListsRequest.prototype.parent = ""; - - /** - * ListCertificateRevocationListsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @instance - */ - ListCertificateRevocationListsRequest.prototype.pageSize = 0; - - /** - * ListCertificateRevocationListsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @instance - */ - ListCertificateRevocationListsRequest.prototype.pageToken = ""; - - /** - * ListCertificateRevocationListsRequest filter. - * @member {string} filter - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @instance - */ - ListCertificateRevocationListsRequest.prototype.filter = ""; - - /** - * ListCertificateRevocationListsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @instance - */ - ListCertificateRevocationListsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListCertificateRevocationListsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest instance - */ - ListCertificateRevocationListsRequest.create = function create(properties) { - return new ListCertificateRevocationListsRequest(properties); - }; - - /** - * Encodes the specified ListCertificateRevocationListsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateRevocationListsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListCertificateRevocationListsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateRevocationListsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificateRevocationListsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateRevocationListsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListCertificateRevocationListsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateRevocationListsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificateRevocationListsRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificateRevocationListsRequest.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 ListCertificateRevocationListsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest} ListCertificateRevocationListsRequest - */ - ListCertificateRevocationListsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListCertificateRevocationListsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest} message ListCertificateRevocationListsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificateRevocationListsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListCertificateRevocationListsRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @instance - * @returns {Object.} JSON object - */ - ListCertificateRevocationListsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificateRevocationListsRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificateRevocationListsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest"; - }; - - return ListCertificateRevocationListsRequest; - })(); - - v1beta1.ListCertificateRevocationListsResponse = (function() { - - /** - * Properties of a ListCertificateRevocationListsResponse. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IListCertificateRevocationListsResponse - * @property {Array.|null} [certificateRevocationLists] ListCertificateRevocationListsResponse certificateRevocationLists - * @property {string|null} [nextPageToken] ListCertificateRevocationListsResponse nextPageToken - * @property {Array.|null} [unreachable] ListCertificateRevocationListsResponse unreachable - */ - - /** - * Constructs a new ListCertificateRevocationListsResponse. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ListCertificateRevocationListsResponse. - * @implements IListCertificateRevocationListsResponse - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse=} [properties] Properties to set - */ - function ListCertificateRevocationListsResponse(properties) { - this.certificateRevocationLists = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCertificateRevocationListsResponse certificateRevocationLists. - * @member {Array.} certificateRevocationLists - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @instance - */ - ListCertificateRevocationListsResponse.prototype.certificateRevocationLists = $util.emptyArray; - - /** - * ListCertificateRevocationListsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @instance - */ - ListCertificateRevocationListsResponse.prototype.nextPageToken = ""; - - /** - * ListCertificateRevocationListsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @instance - */ - ListCertificateRevocationListsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListCertificateRevocationListsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse instance - */ - ListCertificateRevocationListsResponse.create = function create(properties) { - return new ListCertificateRevocationListsResponse(properties); - }; - - /** - * Encodes the specified ListCertificateRevocationListsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateRevocationListsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateRevocationLists != null && message.certificateRevocationLists.length) - for (var i = 0; i < message.certificateRevocationLists.length; ++i) - $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.encode(message.certificateRevocationLists[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListCertificateRevocationListsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCertificateRevocationListsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateRevocationListsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.certificateRevocationLists && message.certificateRevocationLists.length)) - message.certificateRevocationLists = []; - message.certificateRevocationLists.push($root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCertificateRevocationListsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCertificateRevocationListsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCertificateRevocationListsResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCertificateRevocationListsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificateRevocationLists != null && message.hasOwnProperty("certificateRevocationLists")) { - if (!Array.isArray(message.certificateRevocationLists)) - return "certificateRevocationLists: array expected"; - for (var i = 0; i < message.certificateRevocationLists.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify(message.certificateRevocationLists[i]); - if (error) - return "certificateRevocationLists." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListCertificateRevocationListsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} ListCertificateRevocationListsResponse - */ - ListCertificateRevocationListsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse(); - if (object.certificateRevocationLists) { - if (!Array.isArray(object.certificateRevocationLists)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.certificateRevocationLists: array expected"); - message.certificateRevocationLists = []; - for (var i = 0; i < object.certificateRevocationLists.length; ++i) { - if (typeof object.certificateRevocationLists[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.certificateRevocationLists: object expected"); - message.certificateRevocationLists[i] = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.fromObject(object.certificateRevocationLists[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListCertificateRevocationListsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse} message ListCertificateRevocationListsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCertificateRevocationListsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.certificateRevocationLists = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.certificateRevocationLists && message.certificateRevocationLists.length) { - object.certificateRevocationLists = []; - for (var j = 0; j < message.certificateRevocationLists.length; ++j) - object.certificateRevocationLists[j] = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.toObject(message.certificateRevocationLists[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListCertificateRevocationListsResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @instance - * @returns {Object.} JSON object - */ - ListCertificateRevocationListsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCertificateRevocationListsResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCertificateRevocationListsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse"; - }; - - return ListCertificateRevocationListsResponse; - })(); - - v1beta1.UpdateCertificateRevocationListRequest = (function() { - - /** - * Properties of an UpdateCertificateRevocationListRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IUpdateCertificateRevocationListRequest - * @property {google.cloud.security.privateca.v1beta1.ICertificateRevocationList|null} [certificateRevocationList] UpdateCertificateRevocationListRequest certificateRevocationList - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateRevocationListRequest updateMask - * @property {string|null} [requestId] UpdateCertificateRevocationListRequest requestId - */ - - /** - * Constructs a new UpdateCertificateRevocationListRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents an UpdateCertificateRevocationListRequest. - * @implements IUpdateCertificateRevocationListRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest=} [properties] Properties to set - */ - function UpdateCertificateRevocationListRequest(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]]; - } - - /** - * UpdateCertificateRevocationListRequest certificateRevocationList. - * @member {google.cloud.security.privateca.v1beta1.ICertificateRevocationList|null|undefined} certificateRevocationList - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @instance - */ - UpdateCertificateRevocationListRequest.prototype.certificateRevocationList = null; - - /** - * UpdateCertificateRevocationListRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @instance - */ - UpdateCertificateRevocationListRequest.prototype.updateMask = null; - - /** - * UpdateCertificateRevocationListRequest requestId. - * @member {string} requestId - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @instance - */ - UpdateCertificateRevocationListRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateCertificateRevocationListRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest instance - */ - UpdateCertificateRevocationListRequest.create = function create(properties) { - return new UpdateCertificateRevocationListRequest(properties); - }; - - /** - * Encodes the specified UpdateCertificateRevocationListRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateRevocationListRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.certificateRevocationList != null && Object.hasOwnProperty.call(message, "certificateRevocationList")) - $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.encode(message.certificateRevocationList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateCertificateRevocationListRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCertificateRevocationListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateRevocationListRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.certificateRevocationList = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateCertificateRevocationListRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCertificateRevocationListRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCertificateRevocationListRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCertificateRevocationListRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.certificateRevocationList != null && message.hasOwnProperty("certificateRevocationList")) { - var error = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.verify(message.certificateRevocationList); - if (error) - return "certificateRevocationList." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateCertificateRevocationListRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest} UpdateCertificateRevocationListRequest - */ - UpdateCertificateRevocationListRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(); - if (object.certificateRevocationList != null) { - if (typeof object.certificateRevocationList !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.certificateRevocationList: object expected"); - message.certificateRevocationList = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.fromObject(object.certificateRevocationList); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateCertificateRevocationListRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest} message UpdateCertificateRevocationListRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCertificateRevocationListRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.certificateRevocationList = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.certificateRevocationList != null && message.hasOwnProperty("certificateRevocationList")) - object.certificateRevocationList = $root.google.cloud.security.privateca.v1beta1.CertificateRevocationList.toObject(message.certificateRevocationList, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateCertificateRevocationListRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCertificateRevocationListRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCertificateRevocationListRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCertificateRevocationListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest"; - }; - - return UpdateCertificateRevocationListRequest; - })(); - - v1beta1.GetReusableConfigRequest = (function() { - - /** - * Properties of a GetReusableConfigRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IGetReusableConfigRequest - * @property {string|null} [name] GetReusableConfigRequest name - */ - - /** - * Constructs a new GetReusableConfigRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a GetReusableConfigRequest. - * @implements IGetReusableConfigRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest=} [properties] Properties to set - */ - function GetReusableConfigRequest(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]]; - } - - /** - * GetReusableConfigRequest name. - * @member {string} name - * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest - * @instance - */ - GetReusableConfigRequest.prototype.name = ""; - - /** - * Creates a new GetReusableConfigRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.GetReusableConfigRequest} GetReusableConfigRequest instance - */ - GetReusableConfigRequest.create = function create(properties) { - return new GetReusableConfigRequest(properties); - }; - - /** - * Encodes the specified GetReusableConfigRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetReusableConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest} message GetReusableConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetReusableConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetReusableConfigRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.GetReusableConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest} message GetReusableConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetReusableConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetReusableConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.GetReusableConfigRequest} GetReusableConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetReusableConfigRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetReusableConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.GetReusableConfigRequest} GetReusableConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetReusableConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetReusableConfigRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetReusableConfigRequest.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 GetReusableConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.GetReusableConfigRequest} GetReusableConfigRequest - */ - GetReusableConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetReusableConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.GetReusableConfigRequest} message GetReusableConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetReusableConfigRequest.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 GetReusableConfigRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest - * @instance - * @returns {Object.} JSON object - */ - GetReusableConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetReusableConfigRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.GetReusableConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetReusableConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.GetReusableConfigRequest"; - }; - - return GetReusableConfigRequest; - })(); - - v1beta1.ListReusableConfigsRequest = (function() { - - /** - * Properties of a ListReusableConfigsRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IListReusableConfigsRequest - * @property {string|null} [parent] ListReusableConfigsRequest parent - * @property {number|null} [pageSize] ListReusableConfigsRequest pageSize - * @property {string|null} [pageToken] ListReusableConfigsRequest pageToken - * @property {string|null} [filter] ListReusableConfigsRequest filter - * @property {string|null} [orderBy] ListReusableConfigsRequest orderBy - */ - - /** - * Constructs a new ListReusableConfigsRequest. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ListReusableConfigsRequest. - * @implements IListReusableConfigsRequest - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest=} [properties] Properties to set - */ - function ListReusableConfigsRequest(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]]; - } - - /** - * ListReusableConfigsRequest parent. - * @member {string} parent - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @instance - */ - ListReusableConfigsRequest.prototype.parent = ""; - - /** - * ListReusableConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @instance - */ - ListReusableConfigsRequest.prototype.pageSize = 0; - - /** - * ListReusableConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @instance - */ - ListReusableConfigsRequest.prototype.pageToken = ""; - - /** - * ListReusableConfigsRequest filter. - * @member {string} filter - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @instance - */ - ListReusableConfigsRequest.prototype.filter = ""; - - /** - * ListReusableConfigsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @instance - */ - ListReusableConfigsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListReusableConfigsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest} ListReusableConfigsRequest instance - */ - ListReusableConfigsRequest.create = function create(properties) { - return new ListReusableConfigsRequest(properties); - }; - - /** - * Encodes the specified ListReusableConfigsRequest message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest} message ListReusableConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListReusableConfigsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListReusableConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest} message ListReusableConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListReusableConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListReusableConfigsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest} ListReusableConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListReusableConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 ListReusableConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest} ListReusableConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListReusableConfigsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListReusableConfigsRequest message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListReusableConfigsRequest.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 ListReusableConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest} ListReusableConfigsRequest - */ - ListReusableConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListReusableConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @static - * @param {google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest} message ListReusableConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListReusableConfigsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListReusableConfigsRequest to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - ListReusableConfigsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListReusableConfigsRequest - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListReusableConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest"; - }; - - return ListReusableConfigsRequest; - })(); - - v1beta1.ListReusableConfigsResponse = (function() { - - /** - * Properties of a ListReusableConfigsResponse. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IListReusableConfigsResponse - * @property {Array.|null} [reusableConfigs] ListReusableConfigsResponse reusableConfigs - * @property {string|null} [nextPageToken] ListReusableConfigsResponse nextPageToken - * @property {Array.|null} [unreachable] ListReusableConfigsResponse unreachable - */ - - /** - * Constructs a new ListReusableConfigsResponse. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents a ListReusableConfigsResponse. - * @implements IListReusableConfigsResponse - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse=} [properties] Properties to set - */ - function ListReusableConfigsResponse(properties) { - this.reusableConfigs = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListReusableConfigsResponse reusableConfigs. - * @member {Array.} reusableConfigs - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @instance - */ - ListReusableConfigsResponse.prototype.reusableConfigs = $util.emptyArray; - - /** - * ListReusableConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @instance - */ - ListReusableConfigsResponse.prototype.nextPageToken = ""; - - /** - * ListReusableConfigsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @instance - */ - ListReusableConfigsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListReusableConfigsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} ListReusableConfigsResponse instance - */ - ListReusableConfigsResponse.create = function create(properties) { - return new ListReusableConfigsResponse(properties); - }; - - /** - * Encodes the specified ListReusableConfigsResponse message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse} message ListReusableConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListReusableConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.reusableConfigs != null && message.reusableConfigs.length) - for (var i = 0; i < message.reusableConfigs.length; ++i) - $root.google.cloud.security.privateca.v1beta1.ReusableConfig.encode(message.reusableConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListReusableConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse} message ListReusableConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListReusableConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListReusableConfigsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} ListReusableConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListReusableConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.reusableConfigs && message.reusableConfigs.length)) - message.reusableConfigs = []; - message.reusableConfigs.push($root.google.cloud.security.privateca.v1beta1.ReusableConfig.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListReusableConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} ListReusableConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListReusableConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListReusableConfigsResponse message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListReusableConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.reusableConfigs != null && message.hasOwnProperty("reusableConfigs")) { - if (!Array.isArray(message.reusableConfigs)) - return "reusableConfigs: array expected"; - for (var i = 0; i < message.reusableConfigs.length; ++i) { - var error = $root.google.cloud.security.privateca.v1beta1.ReusableConfig.verify(message.reusableConfigs[i]); - if (error) - return "reusableConfigs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListReusableConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} ListReusableConfigsResponse - */ - ListReusableConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse(); - if (object.reusableConfigs) { - if (!Array.isArray(object.reusableConfigs)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.reusableConfigs: array expected"); - message.reusableConfigs = []; - for (var i = 0; i < object.reusableConfigs.length; ++i) { - if (typeof object.reusableConfigs[i] !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.reusableConfigs: object expected"); - message.reusableConfigs[i] = $root.google.cloud.security.privateca.v1beta1.ReusableConfig.fromObject(object.reusableConfigs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListReusableConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @static - * @param {google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse} message ListReusableConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListReusableConfigsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.reusableConfigs = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.reusableConfigs && message.reusableConfigs.length) { - object.reusableConfigs = []; - for (var j = 0; j < message.reusableConfigs.length; ++j) - object.reusableConfigs[j] = $root.google.cloud.security.privateca.v1beta1.ReusableConfig.toObject(message.reusableConfigs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListReusableConfigsResponse to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - ListReusableConfigsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListReusableConfigsResponse - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListReusableConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse"; - }; - - return ListReusableConfigsResponse; - })(); - - v1beta1.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.security.privateca.v1beta1 - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.security.privateca.v1beta1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.security.privateca.v1beta1.IOperationMetadata=} [properties] Properties to set - */ - function OperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @static - * @param {google.cloud.security.privateca.v1beta1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.security.privateca.v1beta1.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.security.privateca.v1beta1.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @static - * @param {google.cloud.security.privateca.v1beta1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1beta1.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @static - * @param {google.cloud.security.privateca.v1beta1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.security.privateca.v1beta1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1beta1.OperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.security.privateca.v1beta1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationMetadata message. - * @function verify - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.security.privateca.v1beta1.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.security.privateca.v1beta1.OperationMetadata) - return object; - var message = new $root.google.cloud.security.privateca.v1beta1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.security.privateca.v1beta1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @static - * @param {google.cloud.security.privateca.v1beta1.OperationMetadata} message OperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationMetadata - * @function getTypeUrl - * @memberof google.cloud.security.privateca.v1beta1.OperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.security.privateca.v1beta1.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - return v1beta1; - })(); - - return privateca; - })(); - - return security; - })(); - - return cloud; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @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 - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER 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; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.ResourceDescriptor = (function() { - - /** - * 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 - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * 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 = []; - this.style = []; - 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]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * 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) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - 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); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * 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 = []; - object.style = []; - } - 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] === undefined ? message.history : $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; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @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; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * 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]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * 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]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (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 - */ - - /** - * 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]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * 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 - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * 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) - }); - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * 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]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - 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]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * CommonLanguageSettings selectiveGapicGeneration. - * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.selectiveGapicGeneration = null; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) - $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - case 3: { - message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { - var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); - if (error) - return "selectiveGapicGeneration." + error; - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - if (object.selectiveGapicGeneration != null) { - if (typeof object.selectiveGapicGeneration !== "object") - throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); - message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) { - object.referenceDocsUri = ""; - object.selectiveGapicGeneration = null; - } - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) - object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(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]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - 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]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - 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]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(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]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(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]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(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]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * PythonSettings experimentalFeatures. - * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.experimentalFeatures = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) - $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { - var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); - if (error) - return "experimentalFeatures." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.experimentalFeatures != null) { - if (typeof object.experimentalFeatures !== "object") - throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); - message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.common = null; - object.experimentalFeatures = null; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) - object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - PythonSettings.ExperimentalFeatures = (function() { - - /** - * Properties of an ExperimentalFeatures. - * @memberof google.api.PythonSettings - * @interface IExperimentalFeatures - * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled - * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled - * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled - */ - - /** - * Constructs a new ExperimentalFeatures. - * @memberof google.api.PythonSettings - * @classdesc Represents an ExperimentalFeatures. - * @implements IExperimentalFeatures - * @constructor - * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set - */ - function ExperimentalFeatures(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]]; - } - - /** - * ExperimentalFeatures restAsyncIoEnabled. - * @member {boolean} restAsyncIoEnabled - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @instance - */ - ExperimentalFeatures.prototype.restAsyncIoEnabled = false; - - /** - * ExperimentalFeatures protobufPythonicTypesEnabled. - * @member {boolean} protobufPythonicTypesEnabled - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @instance - */ - ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; - - /** - * ExperimentalFeatures unversionedPackageDisabled. - * @member {boolean} unversionedPackageDisabled - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @instance - */ - ExperimentalFeatures.prototype.unversionedPackageDisabled = false; - - /** - * Creates a new ExperimentalFeatures instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set - * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance - */ - ExperimentalFeatures.create = function create(properties) { - return new ExperimentalFeatures(properties); - }; - - /** - * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExperimentalFeatures.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); - if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); - if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); - return writer; - }; - - /** - * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExperimentalFeatures message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExperimentalFeatures.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.restAsyncIoEnabled = reader.bool(); - break; - } - case 2: { - message.protobufPythonicTypesEnabled = reader.bool(); - break; - } - case 3: { - message.unversionedPackageDisabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExperimentalFeatures message. - * @function verify - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExperimentalFeatures.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) - if (typeof message.restAsyncIoEnabled !== "boolean") - return "restAsyncIoEnabled: boolean expected"; - if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) - if (typeof message.protobufPythonicTypesEnabled !== "boolean") - return "protobufPythonicTypesEnabled: boolean expected"; - if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) - if (typeof message.unversionedPackageDisabled !== "boolean") - return "unversionedPackageDisabled: boolean expected"; - return null; - }; - - /** - * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures - */ - ExperimentalFeatures.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) - return object; - var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); - if (object.restAsyncIoEnabled != null) - message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); - if (object.protobufPythonicTypesEnabled != null) - message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); - if (object.unversionedPackageDisabled != null) - message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); - return message; - }; - - /** - * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExperimentalFeatures.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.restAsyncIoEnabled = false; - object.protobufPythonicTypesEnabled = false; - object.unversionedPackageDisabled = false; - } - if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) - object.restAsyncIoEnabled = message.restAsyncIoEnabled; - if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) - object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; - if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) - object.unversionedPackageDisabled = message.unversionedPackageDisabled; - return object; - }; - - /** - * Converts this ExperimentalFeatures to JSON. - * @function toJSON - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @instance - * @returns {Object.} JSON object - */ - ExperimentalFeatures.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExperimentalFeatures - * @function getTypeUrl - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; - }; - - return ExperimentalFeatures; - })(); - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(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]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - 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]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(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]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - * @property {Object.|null} [renamedServices] GoSettings renamedServices - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - this.renamedServices = {}; - 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]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * GoSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.renamedServices = $util.emptyObject; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.GoSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.renamedServices = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - 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]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(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]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - api.SelectiveGapicGeneration = (function() { - - /** - * Properties of a SelectiveGapicGeneration. - * @memberof google.api - * @interface ISelectiveGapicGeneration - * @property {Array.|null} [methods] SelectiveGapicGeneration methods - * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal - */ - - /** - * Constructs a new SelectiveGapicGeneration. - * @memberof google.api - * @classdesc Represents a SelectiveGapicGeneration. - * @implements ISelectiveGapicGeneration - * @constructor - * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set - */ - function SelectiveGapicGeneration(properties) { - this.methods = []; - 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]]; - } - - /** - * SelectiveGapicGeneration methods. - * @member {Array.} methods - * @memberof google.api.SelectiveGapicGeneration - * @instance - */ - SelectiveGapicGeneration.prototype.methods = $util.emptyArray; - - /** - * SelectiveGapicGeneration generateOmittedAsInternal. - * @member {boolean} generateOmittedAsInternal - * @memberof google.api.SelectiveGapicGeneration - * @instance - */ - SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; - - /** - * Creates a new SelectiveGapicGeneration instance using the specified properties. - * @function create - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set - * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance - */ - SelectiveGapicGeneration.create = function create(properties) { - return new SelectiveGapicGeneration(properties); - }; - - /** - * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. - * @function encode - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SelectiveGapicGeneration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methods != null && message.methods.length) - for (var i = 0; i < message.methods.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); - if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); - return writer; - }; - - /** - * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. - * @function decode - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SelectiveGapicGeneration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.methods && message.methods.length)) - message.methods = []; - message.methods.push(reader.string()); - break; - } - case 2: { - message.generateOmittedAsInternal = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SelectiveGapicGeneration message. - * @function verify - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SelectiveGapicGeneration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methods != null && message.hasOwnProperty("methods")) { - if (!Array.isArray(message.methods)) - return "methods: array expected"; - for (var i = 0; i < message.methods.length; ++i) - if (!$util.isString(message.methods[i])) - return "methods: string[] expected"; - } - if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) - if (typeof message.generateOmittedAsInternal !== "boolean") - return "generateOmittedAsInternal: boolean expected"; - return null; - }; - - /** - * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {Object.} object Plain object - * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration - */ - SelectiveGapicGeneration.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.SelectiveGapicGeneration) - return object; - var message = new $root.google.api.SelectiveGapicGeneration(); - if (object.methods) { - if (!Array.isArray(object.methods)) - throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); - message.methods = []; - for (var i = 0; i < object.methods.length; ++i) - message.methods[i] = String(object.methods[i]); - } - if (object.generateOmittedAsInternal != null) - message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); - return message; - }; - - /** - * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SelectiveGapicGeneration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.methods = []; - if (options.defaults) - object.generateOmittedAsInternal = false; - if (message.methods && message.methods.length) { - object.methods = []; - for (var j = 0; j < message.methods.length; ++j) - object.methods[j] = message.methods[j]; - } - if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) - object.generateOmittedAsInternal = message.generateOmittedAsInternal; - return object; - }; - - /** - * Converts this SelectiveGapicGeneration to JSON. - * @function toJSON - * @memberof google.api.SelectiveGapicGeneration - * @instance - * @returns {Object.} JSON object - */ - SelectiveGapicGeneration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SelectiveGapicGeneration - * @function getTypeUrl - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; - }; - - return SelectiveGapicGeneration; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - api.FieldInfo = (function() { - - /** - * Properties of a FieldInfo. - * @memberof google.api - * @interface IFieldInfo - * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format - * @property {Array.|null} [referencedTypes] FieldInfo referencedTypes - */ - - /** - * Constructs a new FieldInfo. - * @memberof google.api - * @classdesc Represents a FieldInfo. - * @implements IFieldInfo - * @constructor - * @param {google.api.IFieldInfo=} [properties] Properties to set - */ - function FieldInfo(properties) { - this.referencedTypes = []; - 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]]; - } - - /** - * FieldInfo format. - * @member {google.api.FieldInfo.Format} format - * @memberof google.api.FieldInfo - * @instance - */ - FieldInfo.prototype.format = 0; - - /** - * FieldInfo referencedTypes. - * @member {Array.} referencedTypes - * @memberof google.api.FieldInfo - * @instance - */ - FieldInfo.prototype.referencedTypes = $util.emptyArray; - - /** - * Creates a new FieldInfo instance using the specified properties. - * @function create - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo=} [properties] Properties to set - * @returns {google.api.FieldInfo} FieldInfo instance - */ - FieldInfo.create = function create(properties) { - return new FieldInfo(properties); - }; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encode - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); - if (message.referencedTypes != null && message.referencedTypes.length) - for (var i = 0; i < message.referencedTypes.length; ++i) - $root.google.api.TypeReference.encode(message.referencedTypes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @function decode - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.format = reader.int32(); - break; - } - case 2: { - if (!(message.referencedTypes && message.referencedTypes.length)) - message.referencedTypes = []; - message.referencedTypes.push($root.google.api.TypeReference.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldInfo message. - * @function verify - * @memberof google.api.FieldInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldInfo.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 1: - case 2: - case 3: - case 4: - break; - } - if (message.referencedTypes != null && message.hasOwnProperty("referencedTypes")) { - if (!Array.isArray(message.referencedTypes)) - return "referencedTypes: array expected"; - for (var i = 0; i < message.referencedTypes.length; ++i) { - var error = $root.google.api.TypeReference.verify(message.referencedTypes[i]); - if (error) - return "referencedTypes." + error; - } - } - return null; - }; - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.FieldInfo - * @static - * @param {Object.} object Plain object - * @returns {google.api.FieldInfo} FieldInfo - */ - FieldInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.FieldInfo) - return object; - var message = new $root.google.api.FieldInfo(); - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "UUID4": - case 1: - message.format = 1; - break; - case "IPV4": - case 2: - message.format = 2; - break; - case "IPV6": - case 3: - message.format = 3; - break; - case "IPV4_OR_IPV6": - case 4: - message.format = 4; - break; - } - if (object.referencedTypes) { - if (!Array.isArray(object.referencedTypes)) - throw TypeError(".google.api.FieldInfo.referencedTypes: array expected"); - message.referencedTypes = []; - for (var i = 0; i < object.referencedTypes.length; ++i) { - if (typeof object.referencedTypes[i] !== "object") - throw TypeError(".google.api.FieldInfo.referencedTypes: object expected"); - message.referencedTypes[i] = $root.google.api.TypeReference.fromObject(object.referencedTypes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.FieldInfo - * @static - * @param {google.api.FieldInfo} message FieldInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.referencedTypes = []; - if (options.defaults) - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; - if (message.referencedTypes && message.referencedTypes.length) { - object.referencedTypes = []; - for (var j = 0; j < message.referencedTypes.length; ++j) - object.referencedTypes[j] = $root.google.api.TypeReference.toObject(message.referencedTypes[j], options); - } - return object; - }; - - /** - * Converts this FieldInfo to JSON. - * @function toJSON - * @memberof google.api.FieldInfo - * @instance - * @returns {Object.} JSON object - */ - FieldInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldInfo - * @function getTypeUrl - * @memberof google.api.FieldInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.FieldInfo"; - }; - - /** - * Format enum. - * @name google.api.FieldInfo.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} UUID4=1 UUID4 value - * @property {number} IPV4=2 IPV4 value - * @property {number} IPV6=3 IPV6 value - * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value - */ - FieldInfo.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "UUID4"] = 1; - values[valuesById[2] = "IPV4"] = 2; - values[valuesById[3] = "IPV6"] = 3; - values[valuesById[4] = "IPV4_OR_IPV6"] = 4; - return values; - })(); - - return FieldInfo; - })(); - - api.TypeReference = (function() { - - /** - * Properties of a TypeReference. - * @memberof google.api - * @interface ITypeReference - * @property {string|null} [typeName] TypeReference typeName - */ - - /** - * Constructs a new TypeReference. - * @memberof google.api - * @classdesc Represents a TypeReference. - * @implements ITypeReference - * @constructor - * @param {google.api.ITypeReference=} [properties] Properties to set - */ - function TypeReference(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]]; - } - - /** - * TypeReference typeName. - * @member {string} typeName - * @memberof google.api.TypeReference - * @instance - */ - TypeReference.prototype.typeName = ""; - - /** - * Creates a new TypeReference instance using the specified properties. - * @function create - * @memberof google.api.TypeReference - * @static - * @param {google.api.ITypeReference=} [properties] Properties to set - * @returns {google.api.TypeReference} TypeReference instance - */ - TypeReference.create = function create(properties) { - return new TypeReference(properties); - }; - - /** - * Encodes the specified TypeReference message. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. - * @function encode - * @memberof google.api.TypeReference - * @static - * @param {google.api.ITypeReference} message TypeReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TypeReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.typeName); - return writer; - }; - - /** - * Encodes the specified TypeReference message, length delimited. Does not implicitly {@link google.api.TypeReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.TypeReference - * @static - * @param {google.api.ITypeReference} message TypeReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TypeReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TypeReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.TypeReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.TypeReference} TypeReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TypeReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.TypeReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.typeName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TypeReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.TypeReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.TypeReference} TypeReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TypeReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TypeReference message. - * @function verify - * @memberof google.api.TypeReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TypeReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - return null; - }; - - /** - * Creates a TypeReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.TypeReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.TypeReference} TypeReference - */ - TypeReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.TypeReference) - return object; - var message = new $root.google.api.TypeReference(); - if (object.typeName != null) - message.typeName = String(object.typeName); - return message; - }; - - /** - * Creates a plain object from a TypeReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.TypeReference - * @static - * @param {google.api.TypeReference} message TypeReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TypeReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.typeName = ""; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - return object; - }; - - /** - * Converts this TypeReference to JSON. - * @function toJSON - * @memberof google.api.TypeReference - * @instance - * @returns {Object.} JSON object - */ - TypeReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TypeReference - * @function getTypeUrl - * @memberof google.api.TypeReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TypeReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.TypeReference"; - }; - - return TypeReference; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * 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]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * 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); - }; - - /** - * 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; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[900] = "EDITION_LEGACY"] = 900; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * 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} [optionDependency] FileDescriptorProto optionDependency - * @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 - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * 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.optionDependency = []; - 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]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto optionDependency. - * @member {Array.} optionDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.optionDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - if (message.optionDependency != null && message.optionDependency.length) - for (var i = 0; i < message.optionDependency.length; ++i) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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 15: { - if (!(message.optionDependency && message.optionDependency.length)) - message.optionDependency = []; - message.optionDependency.push(reader.string()); - 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; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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.optionDependency != null && message.hasOwnProperty("optionDependency")) { - if (!Array.isArray(message.optionDependency)) - return "optionDependency: array expected"; - for (var i = 0; i < message.optionDependency.length; ++i) - if (!$util.isString(message.optionDependency[i])) - return "optionDependency: string[] 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.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * 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.optionDependency) { - if (!Array.isArray(object.optionDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); - message.optionDependency = []; - for (var i = 0; i < object.optionDependency.length; ++i) - message.optionDependency[i] = String(object.optionDependency[i]); - } - 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); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_LEGACY": - case 900: - message.edition = 900; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * 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 = []; - object.optionDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - 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; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - if (message.optionDependency && message.optionDependency.length) { - object.optionDependency = []; - for (var j = 0; j < message.optionDependency.length; ++j) - object.optionDependency[j] = message.optionDependency[j]; - } - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * 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 - * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility - */ - - /** - * 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]]; - } - - /** - * 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 - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * DescriptorProto visibility. - * @member {google.protobuf.SymbolVisibility} visibility - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.visibility = 0; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "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.visibility != null && Object.hasOwnProperty.call(message, "visibility")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - case 11: { - message.visibility = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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"; - } - if (message.visibility != null && message.hasOwnProperty("visibility")) - switch (message.visibility) { - default: - return "visibility: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * 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]); - } - switch (object.visibility) { - default: - if (typeof object.visibility === "number") { - message.visibility = object.visibility; - break; - } - break; - case "VISIBILITY_UNSET": - case 0: - message.visibility = 0; - break; - case "VISIBILITY_LOCAL": - case 1: - message.visibility = 1; - break; - case "VISIBILITY_EXPORT": - case 2: - message.visibility = 2; - break; - } - 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; - object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; - } - 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]; - } - if (message.visibility != null && message.hasOwnProperty("visibility")) - object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * 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 - */ - - /** - * 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]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * 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 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 && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - 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]]; - } - - /** - * 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 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * 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 = []; - this.declaration = []; - 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]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * 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); - }; - - /** - * 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.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - 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 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - 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()); - }; - - /** - * 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; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - 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]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - 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.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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 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); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(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]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (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 - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * 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]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * 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 = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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 3: - case 2: - 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; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - 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) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - 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); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - 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 = ""; - object.proto3Optional = false; - } - 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] === undefined ? message.label : $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] === undefined ? message.type : $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; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - 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); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @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; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * 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]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * 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 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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * 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 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, error) { - 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(); - if (tag === error) - break; - 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 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 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 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 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 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); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * 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 - * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility - */ - - /** - * 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]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * EnumDescriptorProto visibility. - * @member {google.protobuf.SymbolVisibility} visibility - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.visibility = 0; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "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]); - if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - case 6: { - message.visibility = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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"; - } - if (message.visibility != null && message.hasOwnProperty("visibility")) - switch (message.visibility) { - default: - return "visibility: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * 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]); - } - switch (object.visibility) { - default: - if (typeof object.visibility === "number") { - message.visibility = object.visibility; - break; - } - break; - case "VISIBILITY_UNSET": - case 0: - message.visibility = 0; - break; - case "VISIBILITY_LOCAL": - case 1: - message.visibility = 1; - break; - case "VISIBILITY_EXPORT": - case 2: - message.visibility = 2; - break; - } - return message; - }; - - /** - * 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; - object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; - } - 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]; - } - if (message.visibility != null && message.hasOwnProperty("visibility")) - object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * 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 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]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * 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 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 && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * 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 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * 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 - */ - - /** - * 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]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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 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()); - }; - - /** - * 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; - }; - - /** - * 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 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (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 - */ - - /** - * 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]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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 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()); - }; - - /** - * 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; - }; - - /** - * 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 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 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); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * 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 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]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * 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} [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 {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * 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]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - 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; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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 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 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - 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; - }; - - /** - * 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()); - }; - - /** - * 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.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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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 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) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - 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.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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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; - }; - - /** - * 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 = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - 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] === undefined ? message.optimizeFor : $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.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @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; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (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 {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * 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]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * 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 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 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 && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - 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 && Object.hasOwnProperty.call(message, ".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 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 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, error) { - 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(); - if (tag === error) - break; - 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 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - 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 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 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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 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.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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 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.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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 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); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (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} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport - * @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 - * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo - */ - - /** - * 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.targets = []; - this.editionDefaults = []; - 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]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions featureSupport. - * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.featureSupport = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * FieldOptions .google.api.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) - $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - 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) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) - $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); - 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 22: { - message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); - 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; - } - case 291403980: { - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); - 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()); - }; - - /** - * 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.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: 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.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { - var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); - if (error) - return "featureSupport." + error; - } - 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: - case 6: - case 7: - case 8: - 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; - } - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { - var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); - if (error) - return ".google.api.fieldInfo." + error; - } - 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) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - 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) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - 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.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.featureSupport != null) { - if (typeof object.featureSupport !== "object") - throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); - message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); - } - 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: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - 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; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - 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"]); - } - if (object[".google.api.fieldInfo"] != null) { - if (typeof object[".google.api.fieldInfo"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); - } - 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.targets = []; - object.editionDefaults = []; - 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.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object.featureSupport = null; - object[".google.api.resourceReference"] = null; - object[".google.api.fieldInfo"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $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] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) - object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); - 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]] === undefined ? message[".google.api.fieldBehavior"][j] : $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); - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) - object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); - 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); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @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; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @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; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(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]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_LEGACY": - case 900: - message.edition = 900; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - FieldOptions.FeatureSupport = (function() { - - /** - * Properties of a FeatureSupport. - * @memberof google.protobuf.FieldOptions - * @interface IFeatureSupport - * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced - * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated - * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning - * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved - */ - - /** - * Constructs a new FeatureSupport. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents a FeatureSupport. - * @implements IFeatureSupport - * @constructor - * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set - */ - function FeatureSupport(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]]; - } - - /** - * FeatureSupport editionIntroduced. - * @member {google.protobuf.Edition} editionIntroduced - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @instance - */ - FeatureSupport.prototype.editionIntroduced = 0; - - /** - * FeatureSupport editionDeprecated. - * @member {google.protobuf.Edition} editionDeprecated - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @instance - */ - FeatureSupport.prototype.editionDeprecated = 0; - - /** - * FeatureSupport deprecationWarning. - * @member {string} deprecationWarning - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @instance - */ - FeatureSupport.prototype.deprecationWarning = ""; - - /** - * FeatureSupport editionRemoved. - * @member {google.protobuf.Edition} editionRemoved - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @instance - */ - FeatureSupport.prototype.editionRemoved = 0; - - /** - * Creates a new FeatureSupport instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance - */ - FeatureSupport.create = function create(properties) { - return new FeatureSupport(properties); - }; - - /** - * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSupport.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); - if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); - if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); - if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); - return writer; - }; - - /** - * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSupport message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSupport.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.editionIntroduced = reader.int32(); - break; - } - case 2: { - message.editionDeprecated = reader.int32(); - break; - } - case 3: { - message.deprecationWarning = reader.string(); - break; - } - case 4: { - message.editionRemoved = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSupport.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSupport message. - * @function verify - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSupport.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) - switch (message.editionIntroduced) { - default: - return "editionIntroduced: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) - switch (message.editionDeprecated) { - default: - return "editionDeprecated: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) - if (!$util.isString(message.deprecationWarning)) - return "deprecationWarning: string expected"; - if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) - switch (message.editionRemoved) { - default: - return "editionRemoved: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport - */ - FeatureSupport.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) - return object; - var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); - switch (object.editionIntroduced) { - default: - if (typeof object.editionIntroduced === "number") { - message.editionIntroduced = object.editionIntroduced; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.editionIntroduced = 0; - break; - case "EDITION_LEGACY": - case 900: - message.editionIntroduced = 900; - break; - case "EDITION_PROTO2": - case 998: - message.editionIntroduced = 998; - break; - case "EDITION_PROTO3": - case 999: - message.editionIntroduced = 999; - break; - case "EDITION_2023": - case 1000: - message.editionIntroduced = 1000; - break; - case "EDITION_2024": - case 1001: - message.editionIntroduced = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.editionIntroduced = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.editionIntroduced = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.editionIntroduced = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.editionIntroduced = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.editionIntroduced = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.editionIntroduced = 2147483647; - break; - } - switch (object.editionDeprecated) { - default: - if (typeof object.editionDeprecated === "number") { - message.editionDeprecated = object.editionDeprecated; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.editionDeprecated = 0; - break; - case "EDITION_LEGACY": - case 900: - message.editionDeprecated = 900; - break; - case "EDITION_PROTO2": - case 998: - message.editionDeprecated = 998; - break; - case "EDITION_PROTO3": - case 999: - message.editionDeprecated = 999; - break; - case "EDITION_2023": - case 1000: - message.editionDeprecated = 1000; - break; - case "EDITION_2024": - case 1001: - message.editionDeprecated = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.editionDeprecated = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.editionDeprecated = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.editionDeprecated = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.editionDeprecated = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.editionDeprecated = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.editionDeprecated = 2147483647; - break; - } - if (object.deprecationWarning != null) - message.deprecationWarning = String(object.deprecationWarning); - switch (object.editionRemoved) { - default: - if (typeof object.editionRemoved === "number") { - message.editionRemoved = object.editionRemoved; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.editionRemoved = 0; - break; - case "EDITION_LEGACY": - case 900: - message.editionRemoved = 900; - break; - case "EDITION_PROTO2": - case 998: - message.editionRemoved = 998; - break; - case "EDITION_PROTO3": - case 999: - message.editionRemoved = 999; - break; - case "EDITION_2023": - case 1000: - message.editionRemoved = 1000; - break; - case "EDITION_2024": - case 1001: - message.editionRemoved = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.editionRemoved = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.editionRemoved = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.editionRemoved = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.editionRemoved = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.editionRemoved = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.editionRemoved = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSupport.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.deprecationWarning = ""; - object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) - object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; - if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) - object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; - if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) - object.deprecationWarning = message.deprecationWarning; - if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) - object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; - return object; - }; - - /** - * Converts this FeatureSupport to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @instance - * @returns {Object.} JSON object - */ - FeatureSupport.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSupport - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; - }; - - return FeatureSupport; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * 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]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * 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 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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 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 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - 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 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 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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 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 (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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 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); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * 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]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - 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 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - 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 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()); - }; - - /** - * 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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 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.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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 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; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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 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); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * 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]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions featureSupport. - * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.featureSupport = null; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * 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 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 && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) - $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - 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 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 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 4: { - message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); - 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 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 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { - var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); - if (error) - return "featureSupport." + error; - } - 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 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.featureSupport != null) { - if (typeof object.featureSupport !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); - message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); - } - 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 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; - object.features = null; - object.debugRedact = false; - object.featureSupport = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) - object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); - 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 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); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @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 - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * 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]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * 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 - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - 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 && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - 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; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * 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.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * 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 {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @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 - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * 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]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - 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.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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 && Object.hasOwnProperty.call(message, ".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 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - 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; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } - return null; - }; - - /** - * 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) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - 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.features = null; - object[".google.longrunning.operationInfo"] = null; - 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] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @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; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * 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 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]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * 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.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 && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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]); - } - } - 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 >= 0) - 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * 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]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * 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); - }; - - /** - * 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; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle - * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(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]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * FeatureSet enforceNamingStyle. - * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enforceNamingStyle = 0; - - /** - * FeatureSet defaultSymbolVisibility. - * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.defaultSymbolVisibility = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); - if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - case 7: { - message.enforceNamingStyle = reader.int32(); - break; - } - case 8: { - message.defaultSymbolVisibility = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) - switch (message.enforceNamingStyle) { - default: - return "enforceNamingStyle: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) - switch (message.defaultSymbolVisibility) { - default: - return "defaultSymbolVisibility: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - switch (object.enforceNamingStyle) { - default: - if (typeof object.enforceNamingStyle === "number") { - message.enforceNamingStyle = object.enforceNamingStyle; - break; - } - break; - case "ENFORCE_NAMING_STYLE_UNKNOWN": - case 0: - message.enforceNamingStyle = 0; - break; - case "STYLE2024": - case 1: - message.enforceNamingStyle = 1; - break; - case "STYLE_LEGACY": - case 2: - message.enforceNamingStyle = 2; - break; - } - switch (object.defaultSymbolVisibility) { - default: - if (typeof object.defaultSymbolVisibility === "number") { - message.defaultSymbolVisibility = object.defaultSymbolVisibility; - break; - } - break; - case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": - case 0: - message.defaultSymbolVisibility = 0; - break; - case "EXPORT_ALL": - case 1: - message.defaultSymbolVisibility = 1; - break; - case "EXPORT_TOP_LEVEL": - case 2: - message.defaultSymbolVisibility = 2; - break; - case "LOCAL_ALL": - case 3: - message.defaultSymbolVisibility = 3; - break; - case "STRICT": - case 4: - message.defaultSymbolVisibility = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; - object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) - object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; - if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) - object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - /** - * EnforceNamingStyle enum. - * @name google.protobuf.FeatureSet.EnforceNamingStyle - * @enum {number} - * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value - * @property {number} STYLE2024=1 STYLE2024 value - * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value - */ - FeatureSet.EnforceNamingStyle = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; - values[valuesById[1] = "STYLE2024"] = 1; - values[valuesById[2] = "STYLE_LEGACY"] = 2; - return values; - })(); - - FeatureSet.VisibilityFeature = (function() { - - /** - * Properties of a VisibilityFeature. - * @memberof google.protobuf.FeatureSet - * @interface IVisibilityFeature - */ - - /** - * Constructs a new VisibilityFeature. - * @memberof google.protobuf.FeatureSet - * @classdesc Represents a VisibilityFeature. - * @implements IVisibilityFeature - * @constructor - * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set - */ - function VisibilityFeature(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 VisibilityFeature instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance - */ - VisibilityFeature.create = function create(properties) { - return new VisibilityFeature(properties); - }; - - /** - * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VisibilityFeature.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VisibilityFeature message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VisibilityFeature.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VisibilityFeature message. - * @function verify - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VisibilityFeature.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature - */ - VisibilityFeature.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) - return object; - return new $root.google.protobuf.FeatureSet.VisibilityFeature(); - }; - - /** - * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VisibilityFeature.toObject = function toObject() { - return {}; - }; - - /** - * Converts this VisibilityFeature to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @instance - * @returns {Object.} JSON object - */ - VisibilityFeature.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VisibilityFeature - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; - }; - - /** - * DefaultSymbolVisibility enum. - * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility - * @enum {number} - * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value - * @property {number} EXPORT_ALL=1 EXPORT_ALL value - * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value - * @property {number} LOCAL_ALL=3 LOCAL_ALL value - * @property {number} STRICT=4 STRICT value - */ - VisibilityFeature.DefaultSymbolVisibility = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; - values[valuesById[1] = "EXPORT_ALL"] = 1; - values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; - values[valuesById[3] = "LOCAL_ALL"] = 3; - values[valuesById[4] = "STRICT"] = 4; - return values; - })(); - - return VisibilityFeature; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - 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]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_LEGACY": - case 900: - message.minimumEdition = 900; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_LEGACY": - case 900: - message.maximumEdition = 900; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures - * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(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]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault overridableFeatures. - * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.overridableFeatures = null; - - /** - * FeatureSetEditionDefault fixedFeatures. - * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.fixedFeatures = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) - $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) - $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 4: { - message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 5: { - message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { - var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); - if (error) - return "overridableFeatures." + error; - } - if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { - var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); - if (error) - return "fixedFeatures." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_LEGACY": - case 900: - message.edition = 900; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.overridableFeatures != null) { - if (typeof object.overridableFeatures !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); - message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); - } - if (object.fixedFeatures != null) { - if (typeof object.fixedFeatures !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); - message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.overridableFeatures = null; - object.fixedFeatures = null; - } - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) - object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); - if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) - object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * 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 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 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 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, error) { - 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(); - if (tag === error) - break; - 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 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()); - }; - - /** - * 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 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (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 - */ - - /** - * 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]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "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; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * 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]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * 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); - }; - - /** - * 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; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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]); - } - } - 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (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 - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * 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]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * 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"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - 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; - object.semantic = options.enums === String ? "NONE" : 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; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - 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); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - /** - * SymbolVisibility enum. - * @name google.protobuf.SymbolVisibility - * @enum {number} - * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value - * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value - * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value - */ - protobuf.SymbolVisibility = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VISIBILITY_UNSET"] = 0; - values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; - values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; - return values; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * 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]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * 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]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * 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); - }; - - /** - * 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 && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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; - }; - - /** - * 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; - }; - - /** - * 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 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); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(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]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(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 Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * 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]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * 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); - }; - - /** - * 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 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(); - }; - - /** - * 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, error) { - 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(); - if (tag === error) - break; - 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 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()); - }; - - /** - * 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 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 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - protobuf.DoubleValue = (function() { - - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ - - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(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]]; - } - - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DoubleValue - * @function getTypeUrl - * @memberof google.protobuf.DoubleValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DoubleValue"; - }; - - return DoubleValue; - })(); - - protobuf.FloatValue = (function() { - - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ - - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(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]]; - } - - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; - - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FloatValue - * @function getTypeUrl - * @memberof google.protobuf.FloatValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FloatValue"; - }; - - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ - - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(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]]; - } - - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; - - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int64Value - * @function getTypeUrl - * @memberof google.protobuf.Int64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int64Value"; - }; - - return Int64Value; - })(); - - protobuf.UInt64Value = (function() { - - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ - - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(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]]; - } - - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; - - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt64Value - * @function getTypeUrl - * @memberof google.protobuf.UInt64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt64Value"; - }; - - return UInt64Value; - })(); - - protobuf.Int32Value = (function() { - - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ - - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(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]]; - } - - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; - - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int32Value - * @function getTypeUrl - * @memberof google.protobuf.Int32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int32Value"; - }; - - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ - - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(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]]; - } - - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt32Value - * @function getTypeUrl - * @memberof google.protobuf.UInt32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt32Value"; - }; - - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(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]]; - } - - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; - - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoolValue - * @function getTypeUrl - * @memberof google.protobuf.BoolValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BoolValue"; - }; - - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(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]]; - } - - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringValue - * @function getTypeUrl - * @memberof google.protobuf.StringValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.StringValue"; - }; - - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(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]]; - } - - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BytesValue - * @function getTypeUrl - * @memberof google.protobuf.BytesValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BytesValue"; - }; - - return BytesValue; - })(); - - return protobuf; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Expr = (function() { - - /** - * 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 - */ - - /** - * 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]]; - } - - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; - - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; - - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; - - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; - - /** - * 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 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 && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; - - /** - * 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 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, error) { - 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(); - if (tag === error) - break; - 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; - }; - - /** - * 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()); - }; - - /** - * 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 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for Expr - * @function getTypeUrl - * @memberof google.type.Expr - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Expr"; - }; - - return Expr; - })(); - - return type; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @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 Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(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]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.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.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(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]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.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 GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(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]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.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.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: 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"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - 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]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(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]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.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 CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(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]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.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 DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(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]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(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]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - 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]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-security-privateca/protos/protos.json b/owl-bot-staging/google-cloud-security-privateca/protos/protos.json deleted file mode 100644 index 14b25276d45b..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/protos/protos.json +++ /dev/null @@ -1,7802 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "security": { - "nested": { - "privateca": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.Security.PrivateCA.V1", - "go_package": "cloud.google.com/go/security/privateca/apiv1/privatecapb;privatecapb", - "java_multiple_files": true, - "java_outer_classname": "PrivateCaProto", - "java_package": "com.google.cloud.security.privateca.v1", - "php_namespace": "Google\\Cloud\\Security\\PrivateCA\\V1", - "ruby_package": "Google::Cloud::Security::PrivateCA::V1" - }, - "nested": { - "CertificateAuthority": { - "options": { - "(google.api.resource).type": "privateca.googleapis.com/CertificateAuthority", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "type": { - "type": "Type", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "config": { - "type": "CertificateConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "lifetime": { - "type": "google.protobuf.Duration", - "id": 4, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "keySpec": { - "type": "KeyVersionSpec", - "id": 5, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "subordinateConfig": { - "type": "SubordinateConfig", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tier": { - "type": "CaPool.Tier", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCaCertificates": { - "rule": "repeated", - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "caCertificateDescriptions": { - "rule": "repeated", - "type": "CertificateDescription", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "gcsBucket": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "accessUrls": { - "type": "AccessUrls", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "userDefinedAccessUrls": { - "type": "UserDefinedAccessUrls", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "SELF_SIGNED": 1, - "SUBORDINATE": 2 - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ENABLED": 1, - "DISABLED": 2, - "STAGED": 3, - "AWAITING_USER_ACTIVATION": 4, - "DELETED": 5 - } - }, - "AccessUrls": { - "fields": { - "caCertificateAccessUrl": { - "type": "string", - "id": 1 - }, - "crlAccessUrls": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "KeyVersionSpec": { - "oneofs": { - "KeyVersion": { - "oneof": [ - "cloudKmsKeyVersion", - "algorithm" - ] - } - }, - "fields": { - "cloudKmsKeyVersion": { - "type": "string", - "id": 1 - }, - "algorithm": { - "type": "SignHashAlgorithm", - "id": 2 - } - } - }, - "SignHashAlgorithm": { - "values": { - "SIGN_HASH_ALGORITHM_UNSPECIFIED": 0, - "RSA_PSS_2048_SHA256": 1, - "RSA_PSS_3072_SHA256": 2, - "RSA_PSS_4096_SHA256": 3, - "RSA_PKCS1_2048_SHA256": 6, - "RSA_PKCS1_3072_SHA256": 7, - "RSA_PKCS1_4096_SHA256": 8, - "EC_P256_SHA256": 4, - "EC_P384_SHA384": 5 - } - }, - "UserDefinedAccessUrls": { - "fields": { - "aiaIssuingCertificateUrls": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "crlAccessUrls": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "CaPool": { - "options": { - "(google.api.resource).type": "privateca.googleapis.com/CaPool", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/caPools/{ca_pool}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "tier": { - "type": "Tier", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "issuancePolicy": { - "type": "IssuancePolicy", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "publishingOptions": { - "type": "PublishingOptions", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionSpec": { - "type": "EncryptionSpec", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Tier": { - "values": { - "TIER_UNSPECIFIED": 0, - "ENTERPRISE": 1, - "DEVOPS": 2 - } - }, - "PublishingOptions": { - "fields": { - "publishCaCert": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "publishCrl": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encodingFormat": { - "type": "EncodingFormat", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "EncodingFormat": { - "values": { - "ENCODING_FORMAT_UNSPECIFIED": 0, - "PEM": 1, - "DER": 2 - } - } - } - }, - "IssuancePolicy": { - "fields": { - "allowedKeyTypes": { - "rule": "repeated", - "type": "AllowedKeyType", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "backdateDuration": { - "type": "google.protobuf.Duration", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowRequesterSpecifiedNotBeforeTime": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maximumLifetime": { - "type": "google.protobuf.Duration", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedIssuanceModes": { - "type": "IssuanceModes", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "baselineValues": { - "type": "X509Parameters", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "identityConstraints": { - "type": "CertificateIdentityConstraints", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "passthroughExtensions": { - "type": "CertificateExtensionConstraints", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AllowedKeyType": { - "oneofs": { - "keyType": { - "oneof": [ - "rsa", - "ellipticCurve" - ] - } - }, - "fields": { - "rsa": { - "type": "RsaKeyType", - "id": 1 - }, - "ellipticCurve": { - "type": "EcKeyType", - "id": 2 - } - }, - "nested": { - "RsaKeyType": { - "fields": { - "minModulusSize": { - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxModulusSize": { - "type": "int64", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EcKeyType": { - "fields": { - "signatureAlgorithm": { - "type": "EcSignatureAlgorithm", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "EcSignatureAlgorithm": { - "values": { - "EC_SIGNATURE_ALGORITHM_UNSPECIFIED": 0, - "ECDSA_P256": 1, - "ECDSA_P384": 2, - "EDDSA_25519": 3 - } - } - } - } - } - }, - "IssuanceModes": { - "fields": { - "allowCsrBasedIssuance": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowConfigBasedIssuance": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - } - } - }, - "EncryptionSpec": { - "fields": { - "cloudKmsKey": { - "type": "string", - "id": 1 - } - } - }, - "CertificateRevocationList": { - "options": { - "(google.api.resource).type": "privateca.googleapis.com/CertificateRevocationList", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "sequenceNumber": { - "type": "int64", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "revokedCertificates": { - "rule": "repeated", - "type": "RevokedCertificate", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCrl": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "accessUrl": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "revisionId": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "RevokedCertificate": { - "fields": { - "certificate": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "privateca.googleapis.com/Certificate" - } - }, - "hexSerialNumber": { - "type": "string", - "id": 2 - }, - "revocationReason": { - "type": "RevocationReason", - "id": 3 - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "SUPERSEDED": 2 - } - } - } - }, - "Certificate": { - "options": { - "(google.api.resource).type": "privateca.googleapis.com/Certificate", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}" - }, - "oneofs": { - "certificateConfig": { - "oneof": [ - "pemCsr", - "config" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "pemCsr": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "config": { - "type": "CertificateConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "issuerCertificateAuthority": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "lifetime": { - "type": "google.protobuf.Duration", - "id": 5, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "certificateTemplate": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "IMMUTABLE", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateTemplate" - } - }, - "subjectMode": { - "type": "SubjectRequestMode", - "id": 7, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "revocationDetails": { - "type": "RevocationDetails", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCertificate": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "certificateDescription": { - "type": "CertificateDescription", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCertificateChain": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestedNotBeforeTime": { - "type": "google.protobuf.Timestamp", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "RevocationDetails": { - "fields": { - "revocationState": { - "type": "RevocationReason", - "id": 1 - }, - "revocationTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - } - } - }, - "CertificateTemplate": { - "options": { - "(google.api.resource).type": "privateca.googleapis.com/CertificateTemplate", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificateTemplates/{certificate_template}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "maximumLifetime": { - "type": "google.protobuf.Duration", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "predefinedValues": { - "type": "X509Parameters", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "identityConstraints": { - "type": "CertificateIdentityConstraints", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "passthroughExtensions": { - "type": "CertificateExtensionConstraints", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "X509Parameters": { - "fields": { - "keyUsage": { - "type": "KeyUsage", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "caOptions": { - "type": "CaOptions", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "policyIds": { - "rule": "repeated", - "type": "ObjectId", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "aiaOcspServers": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nameConstraints": { - "type": "NameConstraints", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "additionalExtensions": { - "rule": "repeated", - "type": "X509Extension", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "CaOptions": { - "oneofs": { - "_isCa": { - "oneof": [ - "isCa" - ] - }, - "_maxIssuerPathLength": { - "oneof": [ - "maxIssuerPathLength" - ] - } - }, - "fields": { - "isCa": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "maxIssuerPathLength": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "NameConstraints": { - "fields": { - "critical": { - "type": "bool", - "id": 1 - }, - "permittedDnsNames": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "excludedDnsNames": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "permittedIpRanges": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "excludedIpRanges": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "permittedEmailAddresses": { - "rule": "repeated", - "type": "string", - "id": 6 - }, - "excludedEmailAddresses": { - "rule": "repeated", - "type": "string", - "id": 7 - }, - "permittedUris": { - "rule": "repeated", - "type": "string", - "id": 8 - }, - "excludedUris": { - "rule": "repeated", - "type": "string", - "id": 9 - } - } - } - } - }, - "SubordinateConfig": { - "oneofs": { - "subordinateConfig": { - "oneof": [ - "certificateAuthority", - "pemIssuerChain" - ] - } - }, - "fields": { - "certificateAuthority": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "pemIssuerChain": { - "type": "SubordinateConfigChain", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "SubordinateConfigChain": { - "fields": { - "pemCertificates": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "PublicKey": { - "fields": { - "key": { - "type": "bytes", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "format": { - "type": "KeyFormat", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "KeyFormat": { - "values": { - "KEY_FORMAT_UNSPECIFIED": 0, - "PEM": 1 - } - } - } - }, - "CertificateConfig": { - "fields": { - "subjectConfig": { - "type": "SubjectConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "x509Config": { - "type": "X509Parameters", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "publicKey": { - "type": "PublicKey", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subjectKeyId": { - "type": "KeyId", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SubjectConfig": { - "fields": { - "subject": { - "type": "Subject", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subjectAltName": { - "type": "SubjectAltNames", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "KeyId": { - "fields": { - "keyId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "CertificateDescription": { - "fields": { - "subjectDescription": { - "type": "SubjectDescription", - "id": 1 - }, - "x509Description": { - "type": "X509Parameters", - "id": 2 - }, - "publicKey": { - "type": "PublicKey", - "id": 3 - }, - "subjectKeyId": { - "type": "KeyId", - "id": 4 - }, - "authorityKeyId": { - "type": "KeyId", - "id": 5 - }, - "crlDistributionPoints": { - "rule": "repeated", - "type": "string", - "id": 6 - }, - "aiaIssuingCertificateUrls": { - "rule": "repeated", - "type": "string", - "id": 7 - }, - "certFingerprint": { - "type": "CertificateFingerprint", - "id": 8 - }, - "tbsCertificateDigest": { - "type": "string", - "id": 9 - } - }, - "nested": { - "SubjectDescription": { - "fields": { - "subject": { - "type": "Subject", - "id": 1 - }, - "subjectAltName": { - "type": "SubjectAltNames", - "id": 2 - }, - "hexSerialNumber": { - "type": "string", - "id": 3 - }, - "lifetime": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "notBeforeTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "notAfterTime": { - "type": "google.protobuf.Timestamp", - "id": 6 - } - } - }, - "KeyId": { - "fields": { - "keyId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CertificateFingerprint": { - "fields": { - "sha256Hash": { - "type": "string", - "id": 1 - } - } - } - } - }, - "ObjectId": { - "fields": { - "objectIdPath": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "X509Extension": { - "fields": { - "objectId": { - "type": "ObjectId", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "critical": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "value": { - "type": "bytes", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "KeyUsage": { - "fields": { - "baseKeyUsage": { - "type": "KeyUsageOptions", - "id": 1 - }, - "extendedKeyUsage": { - "type": "ExtendedKeyUsageOptions", - "id": 2 - }, - "unknownExtendedKeyUsages": { - "rule": "repeated", - "type": "ObjectId", - "id": 3 - } - }, - "nested": { - "KeyUsageOptions": { - "fields": { - "digitalSignature": { - "type": "bool", - "id": 1 - }, - "contentCommitment": { - "type": "bool", - "id": 2 - }, - "keyEncipherment": { - "type": "bool", - "id": 3 - }, - "dataEncipherment": { - "type": "bool", - "id": 4 - }, - "keyAgreement": { - "type": "bool", - "id": 5 - }, - "certSign": { - "type": "bool", - "id": 6 - }, - "crlSign": { - "type": "bool", - "id": 7 - }, - "encipherOnly": { - "type": "bool", - "id": 8 - }, - "decipherOnly": { - "type": "bool", - "id": 9 - } - } - }, - "ExtendedKeyUsageOptions": { - "fields": { - "serverAuth": { - "type": "bool", - "id": 1 - }, - "clientAuth": { - "type": "bool", - "id": 2 - }, - "codeSigning": { - "type": "bool", - "id": 3 - }, - "emailProtection": { - "type": "bool", - "id": 4 - }, - "timeStamping": { - "type": "bool", - "id": 5 - }, - "ocspSigning": { - "type": "bool", - "id": 6 - } - } - } - } - }, - "AttributeTypeAndValue": { - "oneofs": { - "attributeType": { - "oneof": [ - "type", - "objectId" - ] - } - }, - "fields": { - "type": { - "type": "AttributeType", - "id": 1 - }, - "objectId": { - "type": "ObjectId", - "id": 2 - }, - "value": { - "type": "string", - "id": 3 - } - } - }, - "RelativeDistinguishedName": { - "fields": { - "attributes": { - "rule": "repeated", - "type": "AttributeTypeAndValue", - "id": 1 - } - } - }, - "Subject": { - "fields": { - "commonName": { - "type": "string", - "id": 1 - }, - "countryCode": { - "type": "string", - "id": 2 - }, - "organization": { - "type": "string", - "id": 3 - }, - "organizationalUnit": { - "type": "string", - "id": 4 - }, - "locality": { - "type": "string", - "id": 5 - }, - "province": { - "type": "string", - "id": 6 - }, - "streetAddress": { - "type": "string", - "id": 7 - }, - "postalCode": { - "type": "string", - "id": 8 - }, - "rdnSequence": { - "rule": "repeated", - "type": "RelativeDistinguishedName", - "id": 9 - } - } - }, - "SubjectAltNames": { - "fields": { - "dnsNames": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "uris": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "emailAddresses": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "ipAddresses": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "customSans": { - "rule": "repeated", - "type": "X509Extension", - "id": 5 - } - } - }, - "CertificateIdentityConstraints": { - "oneofs": { - "_allowSubjectPassthrough": { - "oneof": [ - "allowSubjectPassthrough" - ] - }, - "_allowSubjectAltNamesPassthrough": { - "oneof": [ - "allowSubjectAltNamesPassthrough" - ] - } - }, - "fields": { - "celExpression": { - "type": "google.type.Expr", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowSubjectPassthrough": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "allowSubjectAltNamesPassthrough": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - } - } - }, - "CertificateExtensionConstraints": { - "fields": { - "knownExtensions": { - "rule": "repeated", - "type": "KnownCertificateExtension", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "additionalExtensions": { - "rule": "repeated", - "type": "ObjectId", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "KnownCertificateExtension": { - "values": { - "KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED": 0, - "BASE_KEY_USAGE": 1, - "EXTENDED_KEY_USAGE": 2, - "CA_OPTIONS": 3, - "POLICY_IDS": 4, - "AIA_OCSP_SERVERS": 5, - "NAME_CONSTRAINTS": 6 - } - } - } - }, - "AttributeType": { - "values": { - "ATTRIBUTE_TYPE_UNSPECIFIED": 0, - "COMMON_NAME": 1, - "COUNTRY_CODE": 2, - "ORGANIZATION": 3, - "ORGANIZATIONAL_UNIT": 4, - "LOCALITY": 5, - "PROVINCE": 6, - "STREET_ADDRESS": 7, - "POSTAL_CODE": 8 - } - }, - "RevocationReason": { - "values": { - "REVOCATION_REASON_UNSPECIFIED": 0, - "KEY_COMPROMISE": 1, - "CERTIFICATE_AUTHORITY_COMPROMISE": 2, - "AFFILIATION_CHANGED": 3, - "SUPERSEDED": 4, - "CESSATION_OF_OPERATION": 5, - "CERTIFICATE_HOLD": 6, - "PRIVILEGE_WITHDRAWN": 7, - "ATTRIBUTE_AUTHORITY_COMPROMISE": 8 - } - }, - "SubjectRequestMode": { - "values": { - "SUBJECT_REQUEST_MODE_UNSPECIFIED": 0, - "DEFAULT": 1, - "RDN_SEQUENCE": 3, - "REFLECTED_SPIFFE": 2 - } - }, - "CertificateAuthorityService": { - "options": { - "(google.api.default_host)": "privateca.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateCertificate": { - "requestType": "CreateCertificateRequest", - "responseType": "Certificate", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/caPools/*}/certificates", - "(google.api.http).body": "certificate", - "(google.api.method_signature)": "parent,certificate,certificate_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/caPools/*}/certificates", - "body": "certificate" - } - }, - { - "(google.api.method_signature)": "parent,certificate,certificate_id" - } - ] - }, - "GetCertificate": { - "requestType": "GetCertificateRequest", - "responseType": "Certificate", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListCertificates": { - "requestType": "ListCertificatesRequest", - "responseType": "ListCertificatesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/caPools/*}/certificates", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/caPools/*}/certificates" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "RevokeCertificate": { - "requestType": "RevokeCertificateRequest", - "responseType": "Certificate", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}:revoke", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/caPools/*/certificates/*}:revoke", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateCertificate": { - "requestType": "UpdateCertificateRequest", - "responseType": "Certificate", - "options": { - "(google.api.http).patch": "/v1/{certificate.name=projects/*/locations/*/caPools/*/certificates/*}", - "(google.api.http).body": "certificate", - "(google.api.method_signature)": "certificate,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{certificate.name=projects/*/locations/*/caPools/*/certificates/*}", - "body": "certificate" - } - }, - { - "(google.api.method_signature)": "certificate,update_mask" - } - ] - }, - "ActivateCertificateAuthority": { - "requestType": "ActivateCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:activate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:activate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateCertificateAuthority": { - "requestType": "CreateCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities", - "(google.api.http).body": "certificate_authority", - "(google.api.method_signature)": "parent,certificate_authority,certificate_authority_id", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities", - "body": "certificate_authority" - } - }, - { - "(google.api.method_signature)": "parent,certificate_authority,certificate_authority_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DisableCertificateAuthority": { - "requestType": "DisableCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:disable", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:disable", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "EnableCertificateAuthority": { - "requestType": "EnableCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:enable", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:enable", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "FetchCertificateAuthorityCsr": { - "requestType": "FetchCertificateAuthorityCsrRequest", - "responseType": "FetchCertificateAuthorityCsrResponse", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:fetch", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:fetch" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetCertificateAuthority": { - "requestType": "GetCertificateAuthorityRequest", - "responseType": "CertificateAuthority", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListCertificateAuthorities": { - "requestType": "ListCertificateAuthoritiesRequest", - "responseType": "ListCertificateAuthoritiesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UndeleteCertificateAuthority": { - "requestType": "UndeleteCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:undelete", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:undelete", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteCertificateAuthority": { - "requestType": "DeleteCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateCertificateAuthority": { - "requestType": "UpdateCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{certificate_authority.name=projects/*/locations/*/caPools/*/certificateAuthorities/*}", - "(google.api.http).body": "certificate_authority", - "(google.api.method_signature)": "certificate_authority,update_mask", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{certificate_authority.name=projects/*/locations/*/caPools/*/certificateAuthorities/*}", - "body": "certificate_authority" - } - }, - { - "(google.api.method_signature)": "certificate_authority,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateCaPool": { - "requestType": "CreateCaPoolRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/caPools", - "(google.api.http).body": "ca_pool", - "(google.api.method_signature)": "parent,ca_pool,ca_pool_id", - "(google.longrunning.operation_info).response_type": "CaPool", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/caPools", - "body": "ca_pool" - } - }, - { - "(google.api.method_signature)": "parent,ca_pool,ca_pool_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CaPool", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateCaPool": { - "requestType": "UpdateCaPoolRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{ca_pool.name=projects/*/locations/*/caPools/*}", - "(google.api.http).body": "ca_pool", - "(google.api.method_signature)": "ca_pool,update_mask", - "(google.longrunning.operation_info).response_type": "CaPool", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{ca_pool.name=projects/*/locations/*/caPools/*}", - "body": "ca_pool" - } - }, - { - "(google.api.method_signature)": "ca_pool,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CaPool", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "GetCaPool": { - "requestType": "GetCaPoolRequest", - "responseType": "CaPool", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/caPools/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/caPools/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListCaPools": { - "requestType": "ListCaPoolsRequest", - "responseType": "ListCaPoolsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/caPools", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/caPools" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteCaPool": { - "requestType": "DeleteCaPoolRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/caPools/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/caPools/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "FetchCaCerts": { - "requestType": "FetchCaCertsRequest", - "responseType": "FetchCaCertsResponse", - "options": { - "(google.api.http).post": "/v1/{ca_pool=projects/*/locations/*/caPools/*}:fetchCaCerts", - "(google.api.http).body": "*", - "(google.api.method_signature)": "ca_pool" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{ca_pool=projects/*/locations/*/caPools/*}:fetchCaCerts", - "body": "*" - } - }, - { - "(google.api.method_signature)": "ca_pool" - } - ] - }, - "GetCertificateRevocationList": { - "requestType": "GetCertificateRevocationListRequest", - "responseType": "CertificateRevocationList", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListCertificateRevocationLists": { - "requestType": "ListCertificateRevocationListsRequest", - "responseType": "ListCertificateRevocationListsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/caPools/*/certificateAuthorities/*}/certificateRevocationLists", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/caPools/*/certificateAuthorities/*}/certificateRevocationLists" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateCertificateRevocationList": { - "requestType": "UpdateCertificateRevocationListRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{certificate_revocation_list.name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}", - "(google.api.http).body": "certificate_revocation_list", - "(google.api.method_signature)": "certificate_revocation_list,update_mask", - "(google.longrunning.operation_info).response_type": "CertificateRevocationList", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{certificate_revocation_list.name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}", - "body": "certificate_revocation_list" - } - }, - { - "(google.api.method_signature)": "certificate_revocation_list,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateRevocationList", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateCertificateTemplate": { - "requestType": "CreateCertificateTemplateRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/certificateTemplates", - "(google.api.http).body": "certificate_template", - "(google.api.method_signature)": "parent,certificate_template,certificate_template_id", - "(google.longrunning.operation_info).response_type": "CertificateTemplate", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/certificateTemplates", - "body": "certificate_template" - } - }, - { - "(google.api.method_signature)": "parent,certificate_template,certificate_template_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateTemplate", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteCertificateTemplate": { - "requestType": "DeleteCertificateTemplateRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/certificateTemplates/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.cloud.security.privateca.v1.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/certificateTemplates/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.cloud.security.privateca.v1.OperationMetadata" - } - } - ] - }, - "GetCertificateTemplate": { - "requestType": "GetCertificateTemplateRequest", - "responseType": "CertificateTemplate", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/certificateTemplates/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/certificateTemplates/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListCertificateTemplates": { - "requestType": "ListCertificateTemplatesRequest", - "responseType": "ListCertificateTemplatesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/certificateTemplates", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/certificateTemplates" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateCertificateTemplate": { - "requestType": "UpdateCertificateTemplateRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{certificate_template.name=projects/*/locations/*/certificateTemplates/*}", - "(google.api.http).body": "certificate_template", - "(google.api.method_signature)": "certificate_template,update_mask", - "(google.longrunning.operation_info).response_type": "CertificateTemplate", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{certificate_template.name=projects/*/locations/*/certificateTemplates/*}", - "body": "certificate_template" - } - }, - { - "(google.api.method_signature)": "certificate_template,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateTemplate", - "metadata_type": "OperationMetadata" - } - } - ] - } - } - }, - "CreateCertificateRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" - } - }, - "certificateId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "certificate": { - "type": "Certificate", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "issuingCertificateAuthorityId": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetCertificateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/Certificate" - } - } - } - }, - "ListCertificatesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" - } - }, - "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" - } - } - } - }, - "ListCertificatesResponse": { - "fields": { - "certificates": { - "rule": "repeated", - "type": "Certificate", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "RevokeCertificateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/Certificate" - } - }, - "reason": { - "type": "RevocationReason", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateCertificateRequest": { - "fields": { - "certificate": { - "type": "Certificate", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ActivateCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "pemCaCertificate": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "subordinateConfig": { - "type": "SubordinateConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateCertificateAuthorityRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" - } - }, - "certificateAuthorityId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "certificateAuthority": { - "type": "CertificateAuthority", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DisableCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreDependentResources": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EnableCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FetchCertificateAuthorityCsrRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - } - } - }, - "FetchCertificateAuthorityCsrResponse": { - "fields": { - "pemCsr": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GetCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - } - } - }, - "ListCertificateAuthoritiesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" - } - }, - "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" - } - } - } - }, - "ListCertificateAuthoritiesResponse": { - "fields": { - "certificateAuthorities": { - "rule": "repeated", - "type": "CertificateAuthority", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "UndeleteCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreActiveCertificates": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "skipGracePeriod": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreDependentResources": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateCertificateAuthorityRequest": { - "fields": { - "certificateAuthority": { - "type": "CertificateAuthority", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateCaPoolRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" - } - }, - "caPoolId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "caPool": { - "type": "CaPool", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateCaPoolRequest": { - "fields": { - "caPool": { - "type": "CaPool", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteCaPoolRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreDependentResources": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FetchCaCertsRequest": { - "fields": { - "caPool": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FetchCaCertsResponse": { - "fields": { - "caCerts": { - "rule": "repeated", - "type": "CertChain", - "id": 1 - } - }, - "nested": { - "CertChain": { - "fields": { - "certificates": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - } - } - }, - "GetCaPoolRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" - } - } - } - }, - "ListCaPoolsRequest": { - "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" - } - } - } - }, - "ListCaPoolsResponse": { - "fields": { - "caPools": { - "rule": "repeated", - "type": "CaPool", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetCertificateRevocationListRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateRevocationList" - } - } - } - }, - "ListCertificateRevocationListsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "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" - } - } - } - }, - "ListCertificateRevocationListsResponse": { - "fields": { - "certificateRevocationLists": { - "rule": "repeated", - "type": "CertificateRevocationList", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "UpdateCertificateRevocationListRequest": { - "fields": { - "certificateRevocationList": { - "type": "CertificateRevocationList", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateCertificateTemplateRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" - } - }, - "certificateTemplateId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "certificateTemplate": { - "type": "CertificateTemplate", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteCertificateTemplateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateTemplate" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetCertificateTemplateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateTemplate" - } - } - } - }, - "ListCertificateTemplatesRequest": { - "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" - } - } - } - }, - "ListCertificateTemplatesResponse": { - "fields": { - "certificateTemplates": { - "rule": "repeated", - "type": "CertificateTemplate", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "UpdateCertificateTemplateRequest": { - "fields": { - "certificateTemplate": { - "type": "CertificateTemplate", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OperationMetadata": { - "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "target": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "verb": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusMessage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "v1beta1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Security.PrivateCA.V1Beta1", - "go_package": "cloud.google.com/go/security/privateca/apiv1beta1/privatecapb;privatecapb", - "java_multiple_files": true, - "java_outer_classname": "PrivateCaProto", - "java_package": "com.google.cloud.security.privateca.v1beta1", - "php_namespace": "Google\\Cloud\\Security\\PrivateCA\\V1beta1", - "ruby_package": "Google::Cloud::Security::PrivateCA::V1beta1" - }, - "nested": { - "CertificateAuthority": { - "options": { - "(google.api.resource).type": "privateca.googleapis.com/CertificateAuthority", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "Type", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "tier": { - "type": "Tier", - "id": 3, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "config": { - "type": "CertificateConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "lifetime": { - "type": "google.protobuf.Duration", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "keySpec": { - "type": "KeyVersionSpec", - "id": 6, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "certificatePolicy": { - "type": "CertificateAuthorityPolicy", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "issuingOptions": { - "type": "IssuingOptions", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subordinateConfig": { - "type": "SubordinateConfig", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "state": { - "type": "State", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCaCertificates": { - "rule": "repeated", - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "caCertificateDescriptions": { - "rule": "repeated", - "type": "CertificateDescription", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "gcsBucket": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "accessUrls": { - "type": "AccessUrls", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "IssuingOptions": { - "fields": { - "includeCaCertUrl": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "includeCrlAccessUrl": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "CertificateAuthorityPolicy": { - "oneofs": { - "configPolicy": { - "oneof": [ - "allowedConfigList", - "overwriteConfigValues" - ] - } - }, - "fields": { - "allowedConfigList": { - "type": "AllowedConfigList", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "overwriteConfigValues": { - "type": "ReusableConfigWrapper", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedLocationsAndOrganizations": { - "rule": "repeated", - "type": "Subject", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedCommonNames": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedSans": { - "type": "AllowedSubjectAltNames", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maximumLifetime": { - "type": "google.protobuf.Duration", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedIssuanceModes": { - "type": "IssuanceModes", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AllowedConfigList": { - "fields": { - "allowedConfigValues": { - "rule": "repeated", - "type": "ReusableConfigWrapper", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AllowedSubjectAltNames": { - "fields": { - "allowedDnsNames": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedUris": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedEmailAddresses": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedIps": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowGlobbingDnsWildcards": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowCustomSans": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "IssuanceModes": { - "fields": { - "allowCsrBasedIssuance": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "allowConfigBasedIssuance": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "AccessUrls": { - "fields": { - "caCertificateAccessUrl": { - "type": "string", - "id": 1 - }, - "crlAccessUrl": { - "type": "string", - "id": 2 - } - } - }, - "KeyVersionSpec": { - "oneofs": { - "KeyVersion": { - "oneof": [ - "cloudKmsKeyVersion", - "algorithm" - ] - } - }, - "fields": { - "cloudKmsKeyVersion": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "algorithm": { - "type": "SignHashAlgorithm", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "SELF_SIGNED": 1, - "SUBORDINATE": 2 - } - }, - "Tier": { - "values": { - "TIER_UNSPECIFIED": 0, - "ENTERPRISE": 1, - "DEVOPS": 2 - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ENABLED": 1, - "DISABLED": 2, - "PENDING_ACTIVATION": 3, - "PENDING_DELETION": 4 - } - }, - "SignHashAlgorithm": { - "values": { - "SIGN_HASH_ALGORITHM_UNSPECIFIED": 0, - "RSA_PSS_2048_SHA256": 1, - "RSA_PSS_3072_SHA256": 2, - "RSA_PSS_4096_SHA256": 3, - "RSA_PKCS1_2048_SHA256": 6, - "RSA_PKCS1_3072_SHA256": 7, - "RSA_PKCS1_4096_SHA256": 8, - "EC_P256_SHA256": 4, - "EC_P384_SHA384": 5 - } - } - } - }, - "CertificateRevocationList": { - "options": { - "(google.api.resource).type": "privateca.googleapis.com/CertificateRevocationList", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sequenceNumber": { - "type": "int64", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "revokedCertificates": { - "rule": "repeated", - "type": "RevokedCertificate", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCrl": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "accessUrl": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "RevokedCertificate": { - "fields": { - "certificate": { - "type": "string", - "id": 1 - }, - "hexSerialNumber": { - "type": "string", - "id": 2 - }, - "revocationReason": { - "type": "RevocationReason", - "id": 3 - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "SUPERSEDED": 2 - } - } - } - }, - "Certificate": { - "options": { - "(google.api.resource).type": "privateca.googleapis.com/Certificate", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificates/{certificate}" - }, - "oneofs": { - "certificateConfig": { - "oneof": [ - "pemCsr", - "config" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCsr": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "config": { - "type": "CertificateConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "lifetime": { - "type": "google.protobuf.Duration", - "id": 4, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "revocationDetails": { - "type": "RevocationDetails", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCertificate": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "certificateDescription": { - "type": "CertificateDescription", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCertificateChain": { - "rule": "repeated", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "RevocationDetails": { - "fields": { - "revocationState": { - "type": "RevocationReason", - "id": 1 - }, - "revocationTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - } - } - }, - "ReusableConfig": { - "options": { - "(google.api.resource).type": "privateca.googleapis.com/ReusableConfig", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/reusableConfigs/{reusable_config}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "values": { - "type": "ReusableConfigValues", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ReusableConfigValues": { - "fields": { - "keyUsage": { - "type": "KeyUsage", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "caOptions": { - "type": "CaOptions", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "policyIds": { - "rule": "repeated", - "type": "ObjectId", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "aiaOcspServers": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "additionalExtensions": { - "rule": "repeated", - "type": "X509Extension", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "CaOptions": { - "fields": { - "isCa": { - "type": "google.protobuf.BoolValue", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxIssuerPathLength": { - "type": "google.protobuf.Int32Value", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "ReusableConfigWrapper": { - "oneofs": { - "configValues": { - "oneof": [ - "reusableConfig", - "reusableConfigValues" - ] - } - }, - "fields": { - "reusableConfig": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "reusableConfigValues": { - "type": "ReusableConfigValues", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "SubordinateConfig": { - "oneofs": { - "subordinateConfig": { - "oneof": [ - "certificateAuthority", - "pemIssuerChain" - ] - } - }, - "fields": { - "certificateAuthority": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "pemIssuerChain": { - "type": "SubordinateConfigChain", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "SubordinateConfigChain": { - "fields": { - "pemCertificates": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "PublicKey": { - "fields": { - "type": { - "type": "KeyType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "key": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "KeyType": { - "values": { - "KEY_TYPE_UNSPECIFIED": 0, - "PEM_RSA_KEY": 1, - "PEM_EC_KEY": 2 - } - } - } - }, - "CertificateConfig": { - "fields": { - "subjectConfig": { - "type": "SubjectConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "reusableConfig": { - "type": "ReusableConfigWrapper", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "publicKey": { - "type": "PublicKey", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SubjectConfig": { - "fields": { - "subject": { - "type": "Subject", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "commonName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subjectAltName": { - "type": "SubjectAltNames", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "CertificateDescription": { - "fields": { - "subjectDescription": { - "type": "SubjectDescription", - "id": 1 - }, - "configValues": { - "type": "ReusableConfigValues", - "id": 2 - }, - "publicKey": { - "type": "PublicKey", - "id": 3 - }, - "subjectKeyId": { - "type": "KeyId", - "id": 4 - }, - "authorityKeyId": { - "type": "KeyId", - "id": 5 - }, - "crlDistributionPoints": { - "rule": "repeated", - "type": "string", - "id": 6 - }, - "aiaIssuingCertificateUrls": { - "rule": "repeated", - "type": "string", - "id": 7 - }, - "certFingerprint": { - "type": "CertificateFingerprint", - "id": 8 - } - }, - "nested": { - "SubjectDescription": { - "fields": { - "subject": { - "type": "Subject", - "id": 1 - }, - "commonName": { - "type": "string", - "id": 2 - }, - "subjectAltName": { - "type": "SubjectAltNames", - "id": 3 - }, - "hexSerialNumber": { - "type": "string", - "id": 4 - }, - "lifetime": { - "type": "google.protobuf.Duration", - "id": 5 - }, - "notBeforeTime": { - "type": "google.protobuf.Timestamp", - "id": 6 - }, - "notAfterTime": { - "type": "google.protobuf.Timestamp", - "id": 7 - } - } - }, - "KeyId": { - "fields": { - "keyId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CertificateFingerprint": { - "fields": { - "sha256Hash": { - "type": "string", - "id": 1 - } - } - } - } - }, - "ObjectId": { - "fields": { - "objectIdPath": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "X509Extension": { - "fields": { - "objectId": { - "type": "ObjectId", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "critical": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "value": { - "type": "bytes", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "KeyUsage": { - "fields": { - "baseKeyUsage": { - "type": "KeyUsageOptions", - "id": 1 - }, - "extendedKeyUsage": { - "type": "ExtendedKeyUsageOptions", - "id": 2 - }, - "unknownExtendedKeyUsages": { - "rule": "repeated", - "type": "ObjectId", - "id": 3 - } - }, - "nested": { - "KeyUsageOptions": { - "fields": { - "digitalSignature": { - "type": "bool", - "id": 1 - }, - "contentCommitment": { - "type": "bool", - "id": 2 - }, - "keyEncipherment": { - "type": "bool", - "id": 3 - }, - "dataEncipherment": { - "type": "bool", - "id": 4 - }, - "keyAgreement": { - "type": "bool", - "id": 5 - }, - "certSign": { - "type": "bool", - "id": 6 - }, - "crlSign": { - "type": "bool", - "id": 7 - }, - "encipherOnly": { - "type": "bool", - "id": 8 - }, - "decipherOnly": { - "type": "bool", - "id": 9 - } - } - }, - "ExtendedKeyUsageOptions": { - "fields": { - "serverAuth": { - "type": "bool", - "id": 1 - }, - "clientAuth": { - "type": "bool", - "id": 2 - }, - "codeSigning": { - "type": "bool", - "id": 3 - }, - "emailProtection": { - "type": "bool", - "id": 4 - }, - "timeStamping": { - "type": "bool", - "id": 5 - }, - "ocspSigning": { - "type": "bool", - "id": 6 - } - } - } - } - }, - "Subject": { - "fields": { - "countryCode": { - "type": "string", - "id": 1 - }, - "organization": { - "type": "string", - "id": 2 - }, - "organizationalUnit": { - "type": "string", - "id": 3 - }, - "locality": { - "type": "string", - "id": 4 - }, - "province": { - "type": "string", - "id": 5 - }, - "streetAddress": { - "type": "string", - "id": 6 - }, - "postalCode": { - "type": "string", - "id": 7 - } - } - }, - "SubjectAltNames": { - "fields": { - "dnsNames": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "uris": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "emailAddresses": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "ipAddresses": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "customSans": { - "rule": "repeated", - "type": "X509Extension", - "id": 5 - } - } - }, - "RevocationReason": { - "values": { - "REVOCATION_REASON_UNSPECIFIED": 0, - "KEY_COMPROMISE": 1, - "CERTIFICATE_AUTHORITY_COMPROMISE": 2, - "AFFILIATION_CHANGED": 3, - "SUPERSEDED": 4, - "CESSATION_OF_OPERATION": 5, - "CERTIFICATE_HOLD": 6, - "PRIVILEGE_WITHDRAWN": 7, - "ATTRIBUTE_AUTHORITY_COMPROMISE": 8 - } - }, - "CertificateAuthorityService": { - "options": { - "(google.api.default_host)": "privateca.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateCertificate": { - "requestType": "CreateCertificateRequest", - "responseType": "Certificate", - "options": { - "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates", - "(google.api.http).body": "certificate", - "(google.api.method_signature)": "parent,certificate,certificate_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates", - "body": "certificate" - } - }, - { - "(google.api.method_signature)": "parent,certificate,certificate_id" - } - ] - }, - "GetCertificate": { - "requestType": "GetCertificateRequest", - "responseType": "Certificate", - "options": { - "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListCertificates": { - "requestType": "ListCertificatesRequest", - "responseType": "ListCertificatesResponse", - "options": { - "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "RevokeCertificate": { - "requestType": "RevokeCertificateRequest", - "responseType": "Certificate", - "options": { - "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}:revoke", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}:revoke", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateCertificate": { - "requestType": "UpdateCertificateRequest", - "responseType": "Certificate", - "options": { - "(google.api.http).patch": "/v1beta1/{certificate.name=projects/*/locations/*/certificateAuthorities/*/certificates/*}", - "(google.api.http).body": "certificate", - "(google.api.method_signature)": "certificate,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta1/{certificate.name=projects/*/locations/*/certificateAuthorities/*/certificates/*}", - "body": "certificate" - } - }, - { - "(google.api.method_signature)": "certificate,update_mask" - } - ] - }, - "ActivateCertificateAuthority": { - "requestType": "ActivateCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:activate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:activate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateCertificateAuthority": { - "requestType": "CreateCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities", - "(google.api.http).body": "certificate_authority", - "(google.api.method_signature)": "parent,certificate_authority,certificate_authority_id", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities", - "body": "certificate_authority" - } - }, - { - "(google.api.method_signature)": "parent,certificate_authority,certificate_authority_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DisableCertificateAuthority": { - "requestType": "DisableCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:disable", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:disable", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "EnableCertificateAuthority": { - "requestType": "EnableCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:enable", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:enable", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "FetchCertificateAuthorityCsr": { - "requestType": "FetchCertificateAuthorityCsrRequest", - "responseType": "FetchCertificateAuthorityCsrResponse", - "options": { - "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:fetch", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:fetch" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetCertificateAuthority": { - "requestType": "GetCertificateAuthorityRequest", - "responseType": "CertificateAuthority", - "options": { - "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListCertificateAuthorities": { - "requestType": "ListCertificateAuthoritiesRequest", - "responseType": "ListCertificateAuthoritiesResponse", - "options": { - "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "RestoreCertificateAuthority": { - "requestType": "RestoreCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:restore", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:restore", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ScheduleDeleteCertificateAuthority": { - "requestType": "ScheduleDeleteCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:scheduleDelete", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:scheduleDelete", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateCertificateAuthority": { - "requestType": "UpdateCertificateAuthorityRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1beta1/{certificate_authority.name=projects/*/locations/*/certificateAuthorities/*}", - "(google.api.http).body": "certificate_authority", - "(google.api.method_signature)": "certificate_authority,update_mask", - "(google.longrunning.operation_info).response_type": "CertificateAuthority", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta1/{certificate_authority.name=projects/*/locations/*/certificateAuthorities/*}", - "body": "certificate_authority" - } - }, - { - "(google.api.method_signature)": "certificate_authority,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateAuthority", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "GetCertificateRevocationList": { - "requestType": "GetCertificateRevocationListRequest", - "responseType": "CertificateRevocationList", - "options": { - "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListCertificateRevocationLists": { - "requestType": "ListCertificateRevocationListsRequest", - "responseType": "ListCertificateRevocationListsResponse", - "options": { - "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificateRevocationLists", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificateRevocationLists" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateCertificateRevocationList": { - "requestType": "UpdateCertificateRevocationListRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1beta1/{certificate_revocation_list.name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}", - "(google.api.http).body": "certificate_revocation_list", - "(google.api.method_signature)": "certificate_revocation_list,update_mask", - "(google.longrunning.operation_info).response_type": "CertificateRevocationList", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta1/{certificate_revocation_list.name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}", - "body": "certificate_revocation_list" - } - }, - { - "(google.api.method_signature)": "certificate_revocation_list,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "CertificateRevocationList", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "GetReusableConfig": { - "requestType": "GetReusableConfigRequest", - "responseType": "ReusableConfig", - "options": { - "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/reusableConfigs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{name=projects/*/locations/*/reusableConfigs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListReusableConfigs": { - "requestType": "ListReusableConfigsRequest", - "responseType": "ListReusableConfigsResponse", - "options": { - "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/reusableConfigs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{parent=projects/*/locations/*}/reusableConfigs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "CreateCertificateRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "certificateId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "certificate": { - "type": "Certificate", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetCertificateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/Certificate" - } - } - } - }, - "ListCertificatesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "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" - } - } - } - }, - "ListCertificatesResponse": { - "fields": { - "certificates": { - "rule": "repeated", - "type": "Certificate", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "RevokeCertificateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/Certificate" - } - }, - "reason": { - "type": "RevocationReason", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateCertificateRequest": { - "fields": { - "certificate": { - "type": "Certificate", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ActivateCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "pemCaCertificate": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "subordinateConfig": { - "type": "SubordinateConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateCertificateAuthorityRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" - } - }, - "certificateAuthorityId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "certificateAuthority": { - "type": "CertificateAuthority", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DisableCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EnableCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FetchCertificateAuthorityCsrRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - } - } - }, - "FetchCertificateAuthorityCsrResponse": { - "fields": { - "pemCsr": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GetCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - } - } - }, - "ListCertificateAuthoritiesRequest": { - "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" - } - } - } - }, - "ListCertificateAuthoritiesResponse": { - "fields": { - "certificateAuthorities": { - "rule": "repeated", - "type": "CertificateAuthority", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "RestoreCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ScheduleDeleteCertificateAuthorityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateCertificateAuthorityRequest": { - "fields": { - "certificateAuthority": { - "type": "CertificateAuthority", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetCertificateRevocationListRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateRevocationList" - } - } - } - }, - "ListCertificateRevocationListsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/CertificateAuthority" - } - }, - "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" - } - } - } - }, - "ListCertificateRevocationListsResponse": { - "fields": { - "certificateRevocationLists": { - "rule": "repeated", - "type": "CertificateRevocationList", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "UpdateCertificateRevocationListRequest": { - "fields": { - "certificateRevocationList": { - "type": "CertificateRevocationList", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetReusableConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "privateca.googleapis.com/ReusableConfig" - } - } - } - }, - "ListReusableConfigsRequest": { - "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" - } - } - } - }, - "ListReusableConfigsResponse": { - "fields": { - "reusableConfigs": { - "rule": "repeated", - "type": "ReusableConfig", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "OperationMetadata": { - "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "target": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "verb": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusMessage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "FieldInfoProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI" - }, - "nested": { - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - }, - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - }, - "selectiveGapicGeneration": { - "type": "SelectiveGapicGeneration", - "id": 3 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "experimentalFeatures": { - "type": "ExperimentalFeatures", - "id": 2 - } - }, - "nested": { - "ExperimentalFeatures": { - "fields": { - "restAsyncIoEnabled": { - "type": "bool", - "id": 1 - }, - "protobufPythonicTypesEnabled": { - "type": "bool", - "id": 2 - }, - "unversionedPackageDisabled": { - "type": "bool", - "id": 3 - } - } - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "SelectiveGapicGeneration": { - "fields": { - "methods": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "generateOmittedAsInternal": { - "type": "bool", - "id": 2 - } - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "fieldInfo": { - "type": "google.api.FieldInfo", - "id": 291403980, - "extend": "google.protobuf.FieldOptions" - }, - "FieldInfo": { - "fields": { - "format": { - "type": "Format", - "id": 1 - }, - "referencedTypes": { - "rule": "repeated", - "type": "TypeReference", - "id": 2 - } - }, - "nested": { - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "UUID4": 1, - "IPV4": 2, - "IPV6": 3, - "IPV4_OR_IPV6": 4 - } - } - } - }, - "TypeReference": { - "fields": { - "typeName": { - "type": "string", - "id": 1 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - }, - "extensions": [ - [ - 536000000, - 536000000 - ] - ] - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_LEGACY": 900, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "optionDependency": { - "rule": "repeated", - "type": "string", - "id": 15 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - }, - "visibility": { - "type": "SymbolVisibility", - "id": 11 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "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 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "visibility": { - "type": "SymbolVisibility", - "id": 6 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - }, - "reserved": [ - [ - 4, - 4 - ], - "stream" - ] - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - "php_generic_services", - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false, - "deprecated": true - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "featureSupport": { - "type": "FeatureSupport", - "id": 22 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - }, - "FeatureSupport": { - "fields": { - "editionIntroduced": { - "type": "Edition", - "id": 1 - }, - "editionDeprecated": { - "type": "Edition", - "id": 2 - }, - "deprecationWarning": { - "type": "string", - "id": 3 - }, - "editionRemoved": { - "type": "Edition", - "id": 4 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "featureSupport": { - "type": "FieldOptions.FeatureSupport", - "id": 4 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_LEGACY", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - }, - "enforceNamingStyle": { - "type": "EnforceNamingStyle", - "id": 7, - "options": { - "retention": "RETENTION_SOURCE", - "targets": "TARGET_TYPE_METHOD", - "feature_support.edition_introduced": "EDITION_2024", - "edition_defaults.edition": "EDITION_2024", - "edition_defaults.value": "STYLE2024" - } - }, - "defaultSymbolVisibility": { - "type": "VisibilityFeature.DefaultSymbolVisibility", - "id": 8, - "options": { - "retention": "RETENTION_SOURCE", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2024", - "edition_defaults.edition": "EDITION_2024", - "edition_defaults.value": "EXPORT_TOP_LEVEL" - } - } - }, - "extensions": [ - [ - 1000, - 9994 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - }, - "reserved": [ - [ - 1, - 1 - ] - ] - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - }, - "EnforceNamingStyle": { - "values": { - "ENFORCE_NAMING_STYLE_UNKNOWN": 0, - "STYLE2024": 1, - "STYLE_LEGACY": 2 - } - }, - "VisibilityFeature": { - "fields": {}, - "reserved": [ - [ - 1, - 536870911 - ] - ], - "nested": { - "DefaultSymbolVisibility": { - "values": { - "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, - "EXPORT_ALL": 1, - "EXPORT_TOP_LEVEL": 2, - "LOCAL_ALL": 3, - "STRICT": 4 - } - } - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "overridableFeatures": { - "type": "FeatureSet", - "id": 4 - }, - "fixedFeatures": { - "type": "FeatureSet", - "id": 5 - } - }, - "reserved": [ - [ - 1, - 1 - ], - [ - 2, - 2 - ], - "features" - ] - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "extensions": [ - [ - 536000000, - 536000000 - ] - ], - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "SymbolVisibility": { - "edition": "proto2", - "values": { - "VISIBILITY_UNSET": 0, - "VISIBILITY_LOCAL": 1, - "VISIBILITY_EXPORT": 2 - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "DoubleValue": { - "fields": { - "value": { - "type": "double", - "id": 1 - } - } - }, - "FloatValue": { - "fields": { - "value": { - "type": "float", - "id": 1 - } - } - }, - "Int64Value": { - "fields": { - "value": { - "type": "int64", - "id": 1 - } - } - }, - "UInt64Value": { - "fields": { - "value": { - "type": "uint64", - "id": 1 - } - } - }, - "Int32Value": { - "fields": { - "value": { - "type": "int32", - "id": 1 - } - } - }, - "UInt32Value": { - "fields": { - "value": { - "type": "uint32", - "id": 1 - } - } - }, - "BoolValue": { - "fields": { - "value": { - "type": "bool", - "id": 1 - } - } - }, - "StringValue": { - "fields": { - "value": { - "type": "string", - "id": 1 - } - } - }, - "BytesValue": { - "fields": { - "value": { - "type": "bytes", - "id": 1 - } - } - } - } - }, - "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 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "objc_class_prefix": "GLRUN", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.activate_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.activate_certificate_authority.js deleted file mode 100644 index c20e501bbf3c..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.activate_certificate_authority.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, pemCaCertificate, subordinateConfig) { - // [START privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - /** - * Required. The signed CA certificate issued from - * FetchCertificateAuthorityCsrResponse.pem_csr google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.pem_csr. - */ - // const pemCaCertificate = 'abc123' - /** - * Required. Must include information about the issuer of - * 'pem_ca_certificate', and any further issuers until the self-signed CA. - */ - // const subordinateConfig = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callActivateCertificateAuthority() { - // Construct request - const request = { - name, - pemCaCertificate, - subordinateConfig, - }; - - // Run request - const [operation] = await privatecaClient.activateCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callActivateCertificateAuthority(); - // [END privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_ca_pool.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_ca_pool.js deleted file mode 100644 index e84805c7c4fc..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_ca_pool.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, caPoolId, caPool) { - // [START privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location associated with the - * CaPool google.cloud.security.privateca.v1.CaPool, in the format - * `projects/* /locations/*`. - */ - // const parent = 'abc123' - /** - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - */ - // const caPoolId = 'abc123' - /** - * Required. A CaPool google.cloud.security.privateca.v1.CaPool with - * initial field values. - */ - // const caPool = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callCreateCaPool() { - // Construct request - const request = { - parent, - caPoolId, - caPool, - }; - - // Run request - const [operation] = await privatecaClient.createCaPool(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateCaPool(); - // [END privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate.js deleted file mode 100644 index 1bf084d79f42..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate.js +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, certificate) { - // [START privateca_v1_generated_CertificateAuthorityService_CreateCertificate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the - * CaPool google.cloud.security.privateca.v1.CaPool associated with the - * Certificate google.cloud.security.privateca.v1.Certificate, in the - * format `projects/* /locations/* /caPools/*`. - */ - // const parent = 'abc123' - /** - * Optional. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * in the Enterprise - * CertificateAuthority.tier google.cloud.security.privateca.v1.CertificateAuthority.tier, - * but is optional and its value is ignored otherwise. - */ - // const certificateId = 'abc123' - /** - * Required. A Certificate google.cloud.security.privateca.v1.Certificate - * with initial field values. - */ - // const certificate = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. If this is true, no - * Certificate google.cloud.security.privateca.v1.Certificate resource will - * be persisted regardless of the - * CaPool google.cloud.security.privateca.v1.CaPool's - * tier google.cloud.security.privateca.v1.CaPool.tier, and the returned - * Certificate google.cloud.security.privateca.v1.Certificate will not - * contain the - * pem_certificate google.cloud.security.privateca.v1.Certificate.pem_certificate - * field. - */ - // const validateOnly = true - /** - * Optional. The resource ID of the - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * that should issue the certificate. This optional field will ignore the - * load-balancing scheme of the Pool and directly issue the certificate from - * the CA with the specified ID, contained in the same - * CaPool google.cloud.security.privateca.v1.CaPool referenced by `parent`. - * Per-CA quota rules apply. If left empty, a - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * will be chosen from the CaPool google.cloud.security.privateca.v1.CaPool - * by the service. For example, to issue a - * Certificate google.cloud.security.privateca.v1.Certificate from a - * Certificate Authority with resource name - * "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", - * you can set the - * parent google.cloud.security.privateca.v1.CreateCertificateRequest.parent - * to "projects/my-project/locations/us-central1/caPools/my-pool" and the - * issuing_certificate_authority_id google.cloud.security.privateca.v1.CreateCertificateRequest.issuing_certificate_authority_id - * to "my-ca". - */ - // const issuingCertificateAuthorityId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callCreateCertificate() { - // Construct request - const request = { - parent, - certificate, - }; - - // Run request - const response = await privatecaClient.createCertificate(request); - console.log(response); - } - - callCreateCertificate(); - // [END privateca_v1_generated_CertificateAuthorityService_CreateCertificate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_authority.js deleted file mode 100644 index 1b183d2ffaef..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_authority.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, certificateAuthorityId, certificateAuthority) { - // [START privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the - * CaPool google.cloud.security.privateca.v1.CaPool associated with the - * CertificateAuthorities google.cloud.security.privateca.v1.CertificateAuthority, - * in the format `projects/* /locations/* /caPools/*`. - */ - // const parent = 'abc123' - /** - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - */ - // const certificateAuthorityId = 'abc123' - /** - * Required. A - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * with initial field values. - */ - // const certificateAuthority = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callCreateCertificateAuthority() { - // Construct request - const request = { - parent, - certificateAuthorityId, - certificateAuthority, - }; - - // Run request - const [operation] = await privatecaClient.createCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateCertificateAuthority(); - // [END privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_template.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_template.js deleted file mode 100644 index 9eb57a8857c7..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.create_certificate_template.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, certificateTemplateId, certificateTemplate) { - // [START privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location associated with the - * CertificateTemplate google.cloud.security.privateca.v1.CertificateTemplate, - * in the format `projects/* /locations/*`. - */ - // const parent = 'abc123' - /** - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - */ - // const certificateTemplateId = 'abc123' - /** - * Required. A - * CertificateTemplate google.cloud.security.privateca.v1.CertificateTemplate - * with initial field values. - */ - // const certificateTemplate = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callCreateCertificateTemplate() { - // Construct request - const request = { - parent, - certificateTemplateId, - certificateTemplate, - }; - - // Run request - const [operation] = await privatecaClient.createCertificateTemplate(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateCertificateTemplate(); - // [END privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js deleted file mode 100644 index 1190cecae76c..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this - * CaPool google.cloud.security.privateca.v1.CaPool in the format - * `projects/* /locations/* /caPools/*`. - */ - // const name = 'abc123' - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. This field allows this pool to be deleted even if it's being - * depended on by another resource. However, doing so may result in unintended - * and unrecoverable effects on any dependent resources since the pool will - * no longer be able to issue certificates. - */ - // const ignoreDependentResources = true - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callDeleteCaPool() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await privatecaClient.deleteCaPool(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteCaPool(); - // [END privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js deleted file mode 100644 index 3fe8c766541e..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. This field allows the CA to be deleted even if the CA has - * active certs. Active certs include both unrevoked and unexpired certs. - */ - // const ignoreActiveCertificates = true - /** - * Optional. If this flag is set, the Certificate Authority will be deleted as - * soon as possible without a 30-day grace period where undeletion would have - * been allowed. If you proceed, there will be no way to recover this CA. - */ - // const skipGracePeriod = true - /** - * Optional. This field allows this CA to be deleted even if it's being - * depended on by another resource. However, doing so may result in unintended - * and unrecoverable effects on any dependent resources since the CA will - * no longer be able to issue certificates. - */ - // const ignoreDependentResources = true - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callDeleteCertificateAuthority() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await privatecaClient.deleteCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteCertificateAuthority(); - // [END privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_template.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_template.js deleted file mode 100644 index 2722872082b2..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_template.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this - * CertificateTemplate google.cloud.security.privateca.v1.CertificateTemplate - * in the format `projects/* /locations/* /certificateTemplates/*`. - */ - // const name = 'abc123' - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callDeleteCertificateTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await privatecaClient.deleteCertificateTemplate(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteCertificateTemplate(); - // [END privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js deleted file mode 100644 index 69e3467fa95c..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. This field allows this CA to be disabled even if it's being - * depended on by another resource. However, doing so may result in unintended - * and unrecoverable effects on any dependent resources since the CA will - * no longer be able to issue certificates. - */ - // const ignoreDependentResources = true - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callDisableCertificateAuthority() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await privatecaClient.disableCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDisableCertificateAuthority(); - // [END privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.enable_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.enable_certificate_authority.js deleted file mode 100644 index 7840fe97c842..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.enable_certificate_authority.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callEnableCertificateAuthority() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await privatecaClient.enableCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callEnableCertificateAuthority(); - // [END privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_ca_certs.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_ca_certs.js deleted file mode 100644 index f9e9be0794ef..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_ca_certs.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(caPool) { - // [START privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for the - * CaPool google.cloud.security.privateca.v1.CaPool in the format - * `projects/* /locations/* /caPools/*`. - */ - // const caPool = 'abc123' - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callFetchCaCerts() { - // Construct request - const request = { - caPool, - }; - - // Run request - const response = await privatecaClient.fetchCaCerts(request); - console.log(response); - } - - callFetchCaCerts(); - // [END privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js deleted file mode 100644 index 3952fa029afb..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callFetchCertificateAuthorityCsr() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await privatecaClient.fetchCertificateAuthorityCsr(request); - console.log(response); - } - - callFetchCertificateAuthorityCsr(); - // [END privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_ca_pool.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_ca_pool.js deleted file mode 100644 index 77b37b793f07..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_ca_pool.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_GetCaPool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name google.cloud.security.privateca.v1.CaPool.name of the - * CaPool google.cloud.security.privateca.v1.CaPool to get. - */ - // const name = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callGetCaPool() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await privatecaClient.getCaPool(request); - console.log(response); - } - - callGetCaPool(); - // [END privateca_v1_generated_CertificateAuthorityService_GetCaPool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate.js deleted file mode 100644 index 5884ff290df6..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_GetCertificate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name google.cloud.security.privateca.v1.Certificate.name - * of the Certificate google.cloud.security.privateca.v1.Certificate to - * get. - */ - // const name = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callGetCertificate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await privatecaClient.getCertificate(request); - console.log(response); - } - - callGetCertificate(); - // [END privateca_v1_generated_CertificateAuthorityService_GetCertificate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_authority.js deleted file mode 100644 index c98bb1edbb86..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_authority.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The - * name google.cloud.security.privateca.v1.CertificateAuthority.name of the - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * to get. - */ - // const name = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callGetCertificateAuthority() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await privatecaClient.getCertificateAuthority(request); - console.log(response); - } - - callGetCertificateAuthority(); - // [END privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js deleted file mode 100644 index ac84979168dc..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The - * name google.cloud.security.privateca.v1.CertificateRevocationList.name - * of the - * CertificateRevocationList google.cloud.security.privateca.v1.CertificateRevocationList - * to get. - */ - // const name = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callGetCertificateRevocationList() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await privatecaClient.getCertificateRevocationList(request); - console.log(response); - } - - callGetCertificateRevocationList(); - // [END privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_template.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_template.js deleted file mode 100644 index eed47b46b481..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.get_certificate_template.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The - * name google.cloud.security.privateca.v1.CertificateTemplate.name of the - * CertificateTemplate google.cloud.security.privateca.v1.CertificateTemplate - * to get. - */ - // const name = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callGetCertificateTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await privatecaClient.getCertificateTemplate(request); - console.log(response); - } - - callGetCertificateTemplate(); - // [END privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_ca_pools.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_ca_pools.js deleted file mode 100644 index c2e2deae554c..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_ca_pools.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START privateca_v1_generated_CertificateAuthorityService_ListCaPools_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location associated with the - * CaPools google.cloud.security.privateca.v1.CaPool, in the format - * `projects/* /locations/*`. - */ - // const parent = 'abc123' - /** - * Optional. Limit on the number of - * CaPools google.cloud.security.privateca.v1.CaPool to include in the - * response. Further CaPools google.cloud.security.privateca.v1.CaPool can - * subsequently be obtained by including the - * ListCaPoolsResponse.next_page_token google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. Pagination token, returned earlier via - * ListCaPoolsResponse.next_page_token google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token. - */ - // const pageToken = 'abc123' - /** - * Optional. Only include resources that match the filter in the response. - */ - // const filter = 'abc123' - /** - * Optional. Specify how the results should be sorted. - */ - // const orderBy = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callListCaPools() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = privatecaClient.listCaPoolsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCaPools(); - // [END privateca_v1_generated_CertificateAuthorityService_ListCaPools_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_authorities.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_authorities.js deleted file mode 100644 index e23e6e89aa2f..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_authorities.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the - * CaPool google.cloud.security.privateca.v1.CaPool associated with the - * CertificateAuthorities google.cloud.security.privateca.v1.CertificateAuthority, - * in the format `projects/* /locations/* /caPools/*`. - */ - // const parent = 'abc123' - /** - * Optional. Limit on the number of - * CertificateAuthorities google.cloud.security.privateca.v1.CertificateAuthority - * to include in the response. Further - * CertificateAuthorities google.cloud.security.privateca.v1.CertificateAuthority - * can subsequently be obtained by including the - * ListCertificateAuthoritiesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. Pagination token, returned earlier via - * ListCertificateAuthoritiesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token. - */ - // const pageToken = 'abc123' - /** - * Optional. Only include resources that match the filter in the response. - */ - // const filter = 'abc123' - /** - * Optional. Specify how the results should be sorted. - */ - // const orderBy = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callListCertificateAuthorities() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = privatecaClient.listCertificateAuthoritiesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCertificateAuthorities(); - // [END privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js deleted file mode 100644 index 978fd39b8f48..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location associated with the - * CertificateRevocationLists google.cloud.security.privateca.v1.CertificateRevocationList, - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - */ - // const parent = 'abc123' - /** - * Optional. Limit on the number of - * CertificateRevocationLists google.cloud.security.privateca.v1.CertificateRevocationList - * to include in the response. Further - * CertificateRevocationLists google.cloud.security.privateca.v1.CertificateRevocationList - * can subsequently be obtained by including the - * ListCertificateRevocationListsResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. Pagination token, returned earlier via - * ListCertificateRevocationListsResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token. - */ - // const pageToken = 'abc123' - /** - * Optional. Only include resources that match the filter in the response. - */ - // const filter = 'abc123' - /** - * Optional. Specify how the results should be sorted. - */ - // const orderBy = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callListCertificateRevocationLists() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = privatecaClient.listCertificateRevocationListsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCertificateRevocationLists(); - // [END privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_templates.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_templates.js deleted file mode 100644 index 40b45810635b..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificate_templates.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location associated with the - * CertificateTemplates google.cloud.security.privateca.v1.CertificateTemplate, - * in the format `projects/* /locations/*`. - */ - // const parent = 'abc123' - /** - * Optional. Limit on the number of - * CertificateTemplates google.cloud.security.privateca.v1.CertificateTemplate - * to include in the response. Further - * CertificateTemplates google.cloud.security.privateca.v1.CertificateTemplate - * can subsequently be obtained by including the - * ListCertificateTemplatesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. Pagination token, returned earlier via - * ListCertificateTemplatesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token. - */ - // const pageToken = 'abc123' - /** - * Optional. Only include resources that match the filter in the response. - */ - // const filter = 'abc123' - /** - * Optional. Specify how the results should be sorted. - */ - // const orderBy = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callListCertificateTemplates() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = privatecaClient.listCertificateTemplatesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCertificateTemplates(); - // [END privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js deleted file mode 100644 index fa81a8eb69e2..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START privateca_v1_generated_CertificateAuthorityService_ListCertificates_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the parent associated with the - * Certificates google.cloud.security.privateca.v1.Certificate, in the - * format `projects/* /locations/* /caPools/*`. The parent resource name can be - * in one of two forms: - * 1. **Specific CA Pool:** To list certificates within a single CA Pool: - * `projects/* /locations/* /caPools/*` - * 2. **All CA Pools in a Location:** To list certificates across *all* CA - * Pools in a given project and location, use the wildcard character (`-`) - * in place of the CA Pool ID. - * Example: `projects/* /locations/* /caPools/-` - */ - // const parent = 'abc123' - /** - * Optional. Limit on the number of - * Certificates google.cloud.security.privateca.v1.Certificate to include - * in the response. Further - * Certificates google.cloud.security.privateca.v1.Certificate can - * subsequently be obtained by including the - * ListCertificatesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. Pagination token, returned earlier via - * ListCertificatesResponse.next_page_token google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token. - */ - // const pageToken = 'abc123' - /** - * Optional. Only include resources that match the filter in the response. For - * details on supported filters and syntax, see Certificates Filtering - * documentation (https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - */ - // const filter = 'abc123' - /** - * Optional. Specify how the results should be sorted. For details on - * supported fields and syntax, see Certificates Sorting - * documentation (https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - */ - // const orderBy = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callListCertificates() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = privatecaClient.listCertificatesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCertificates(); - // [END privateca_v1_generated_CertificateAuthorityService_ListCertificates_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.revoke_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.revoke_certificate.js deleted file mode 100644 index 2871b5a377ef..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.revoke_certificate.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, reason) { - // [START privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this - * Certificate google.cloud.security.privateca.v1.Certificate in the format - * `projects/* /locations/* /caPools/* /certificates/*`. - */ - // const name = 'abc123' - /** - * Required. The - * RevocationReason google.cloud.security.privateca.v1.RevocationReason for - * revoking this certificate. - */ - // const reason = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callRevokeCertificate() { - // Construct request - const request = { - name, - reason, - }; - - // Run request - const response = await privatecaClient.revokeCertificate(request); - console.log(response); - } - - callRevokeCertificate(); - // [END privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js deleted file mode 100644 index efd6976370b3..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callUndeleteCertificateAuthority() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await privatecaClient.undeleteCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUndeleteCertificateAuthority(); - // [END privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_ca_pool.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_ca_pool.js deleted file mode 100644 index daadb6a77a6b..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_ca_pool.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(caPool, updateMask) { - // [START privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. CaPool google.cloud.security.privateca.v1.CaPool with updated - * values. - */ - // const caPool = {} - /** - * Required. A list of fields to be updated in this request. - */ - // const updateMask = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callUpdateCaPool() { - // Construct request - const request = { - caPool, - updateMask, - }; - - // Run request - const [operation] = await privatecaClient.updateCaPool(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateCaPool(); - // [END privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate.js deleted file mode 100644 index b54efba3a47c..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(certificate, updateMask) { - // [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Certificate google.cloud.security.privateca.v1.Certificate - * with updated values. - */ - // const certificate = {} - /** - * Required. A list of fields to be updated in this request. - */ - // const updateMask = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callUpdateCertificate() { - // Construct request - const request = { - certificate, - updateMask, - }; - - // Run request - const response = await privatecaClient.updateCertificate(request); - console.log(response); - } - - callUpdateCertificate(); - // [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_authority.js deleted file mode 100644 index 8262a182f25e..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_authority.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(certificateAuthority, updateMask) { - // [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. - * CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority - * with updated values. - */ - // const certificateAuthority = {} - /** - * Required. A list of fields to be updated in this request. - */ - // const updateMask = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callUpdateCertificateAuthority() { - // Construct request - const request = { - certificateAuthority, - updateMask, - }; - - // Run request - const [operation] = await privatecaClient.updateCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateCertificateAuthority(); - // [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js deleted file mode 100644 index 9a2ab753c2a6..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(certificateRevocationList, updateMask) { - // [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. - * CertificateRevocationList google.cloud.security.privateca.v1.CertificateRevocationList - * with updated values. - */ - // const certificateRevocationList = {} - /** - * Required. A list of fields to be updated in this request. - */ - // const updateMask = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callUpdateCertificateRevocationList() { - // Construct request - const request = { - certificateRevocationList, - updateMask, - }; - - // Run request - const [operation] = await privatecaClient.updateCertificateRevocationList(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateCertificateRevocationList(); - // [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_template.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_template.js deleted file mode 100644 index 90683dc23091..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.update_certificate_template.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(certificateTemplate, updateMask) { - // [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. - * CertificateTemplate google.cloud.security.privateca.v1.CertificateTemplate - * with updated values. - */ - // const certificateTemplate = {} - /** - * Required. A list of fields to be updated in this request. - */ - // const updateMask = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callUpdateCertificateTemplate() { - // Construct request - const request = { - certificateTemplate, - updateMask, - }; - - // Run request - const [operation] = await privatecaClient.updateCertificateTemplate(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateCertificateTemplate(); - // [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json deleted file mode 100644 index 72d7dcb4ed20..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json +++ /dev/null @@ -1,1419 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-privateca", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.security.privateca.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificate_async", - "title": "CertificateAuthorityService createCertificate Sample", - "origin": "API_DEFINITION", - "description": " Create a new [Certificate][google.cloud.security.privateca.v1.Certificate] in a given Project, Location from a particular [CaPool][google.cloud.security.privateca.v1.CaPool].", - "canonical": true, - "file": "certificate_authority_service.create_certificate.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 118, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCertificate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "certificate_id", - "type": "TYPE_STRING" - }, - { - "name": "certificate", - "type": ".google.cloud.security.privateca.v1.Certificate" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "issuing_certificate_authority_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.Certificate", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "CreateCertificate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_GetCertificate_async", - "title": "CertificateAuthorityService getCertificate Sample", - "origin": "API_DEFINITION", - "description": " Returns a [Certificate][google.cloud.security.privateca.v1.Certificate].", - "canonical": true, - "file": "certificate_authority_service.get_certificate.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCertificate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.Certificate", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "GetCertificate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_ListCertificates_async", - "title": "CertificateAuthorityService listCertificates Sample", - "origin": "API_DEFINITION", - "description": " Lists [Certificates][google.cloud.security.privateca.v1.Certificate].", - "canonical": true, - "file": "certificate_authority_service.list_certificates.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 92, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCertificates", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.ListCertificatesResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ListCertificates", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_async", - "title": "CertificateAuthorityService revokeCertificate Sample", - "origin": "API_DEFINITION", - "description": " Revoke a [Certificate][google.cloud.security.privateca.v1.Certificate].", - "canonical": true, - "file": "certificate_authority_service.revoke_certificate.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RevokeCertificate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "reason", - "type": ".google.cloud.security.privateca.v1.RevocationReason" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.Certificate", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "RevokeCertificate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_async", - "title": "CertificateAuthorityService updateCertificate Sample", - "origin": "API_DEFINITION", - "description": " Update a [Certificate][google.cloud.security.privateca.v1.Certificate]. Currently, the only field you can update is the [labels][google.cloud.security.privateca.v1.Certificate.labels] field.", - "canonical": true, - "file": "certificate_authority_service.update_certificate.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCertificate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificate", - "async": true, - "parameters": [ - { - "name": "certificate", - "type": ".google.cloud.security.privateca.v1.Certificate" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.Certificate", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "UpdateCertificate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async", - "title": "CertificateAuthorityService activateCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Activate a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] that is in state [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] and is of type [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. After the parent Certificate Authority signs a certificate signing request from [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr], this method can complete the activation process.", - "canonical": true, - "file": "certificate_authority_service.activate_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ActivateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "pem_ca_certificate", - "type": "TYPE_STRING" - }, - { - "name": "subordinate_config", - "type": ".google.cloud.security.privateca.v1.SubordinateConfig" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ActivateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async", - "title": "CertificateAuthorityService createCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Create a new [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] in a given Project and Location.", - "canonical": true, - "file": "certificate_authority_service.create_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "certificate_authority_id", - "type": "TYPE_STRING" - }, - { - "name": "certificate_authority", - "type": ".google.cloud.security.privateca.v1.CertificateAuthority" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "CreateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async", - "title": "CertificateAuthorityService disableCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Disable a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.disable_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DisableCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "ignore_dependent_resources", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "DisableCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async", - "title": "CertificateAuthorityService enableCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Enable a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.enable_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "EnableCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "EnableCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async", - "title": "CertificateAuthorityService fetchCertificateAuthorityCsr Sample", - "origin": "API_DEFINITION", - "description": " Fetch a certificate signing request (CSR) from a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] that is in state [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] and is of type [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. The CSR must then be signed by the desired parent Certificate Authority, which could be another [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] resource, or could be an on-prem certificate authority. See also [ActivateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.fetch_certificate_authority_csr.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchCertificateAuthorityCsr", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "FetchCertificateAuthorityCsr", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_async", - "title": "CertificateAuthorityService getCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Returns a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.get_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.CertificateAuthority", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "GetCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_async", - "title": "CertificateAuthorityService listCertificateAuthorities Sample", - "origin": "API_DEFINITION", - "description": " Lists [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.list_certificate_authorities.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCertificateAuthorities", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ListCertificateAuthorities", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async", - "title": "CertificateAuthorityService undeleteCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Undelete a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] that has been deleted.", - "canonical": true, - "file": "certificate_authority_service.undelete_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UndeleteCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "UndeleteCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async", - "title": "CertificateAuthorityService deleteCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Delete a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.delete_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 88, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "ignore_active_certificates", - "type": "TYPE_BOOL" - }, - { - "name": "skip_grace_period", - "type": "TYPE_BOOL" - }, - { - "name": "ignore_dependent_resources", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "DeleteCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async", - "title": "CertificateAuthorityService updateCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Update a [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.update_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "certificate_authority", - "type": ".google.cloud.security.privateca.v1.CertificateAuthority" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "UpdateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async", - "title": "CertificateAuthorityService createCaPool Sample", - "origin": "API_DEFINITION", - "description": " Create a [CaPool][google.cloud.security.privateca.v1.CaPool].", - "canonical": true, - "file": "certificate_authority_service.create_ca_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCaPool", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPool", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "ca_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "ca_pool", - "type": ".google.cloud.security.privateca.v1.CaPool" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "CreateCaPool", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPool", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async", - "title": "CertificateAuthorityService updateCaPool Sample", - "origin": "API_DEFINITION", - "description": " Update a [CaPool][google.cloud.security.privateca.v1.CaPool].", - "canonical": true, - "file": "certificate_authority_service.update_ca_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCaPool", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPool", - "async": true, - "parameters": [ - { - "name": "ca_pool", - "type": ".google.cloud.security.privateca.v1.CaPool" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "UpdateCaPool", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPool", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_GetCaPool_async", - "title": "CertificateAuthorityService getCaPool Sample", - "origin": "API_DEFINITION", - "description": " Returns a [CaPool][google.cloud.security.privateca.v1.CaPool].", - "canonical": true, - "file": "certificate_authority_service.get_ca_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCaPool", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPool", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.CaPool", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "GetCaPool", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPool", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_ListCaPools_async", - "title": "CertificateAuthorityService listCaPools Sample", - "origin": "API_DEFINITION", - "description": " Lists [CaPools][google.cloud.security.privateca.v1.CaPool].", - "canonical": true, - "file": "certificate_authority_service.list_ca_pools.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCaPools", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.ListCaPoolsResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ListCaPools", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async", - "title": "CertificateAuthorityService deleteCaPool Sample", - "origin": "API_DEFINITION", - "description": " Delete a [CaPool][google.cloud.security.privateca.v1.CaPool].", - "canonical": true, - "file": "certificate_authority_service.delete_ca_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCaPool", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPool", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "ignore_dependent_resources", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "DeleteCaPool", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPool", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_async", - "title": "CertificateAuthorityService fetchCaCerts Sample", - "origin": "API_DEFINITION", - "description": " FetchCaCerts returns the current trust anchor for the [CaPool][google.cloud.security.privateca.v1.CaPool]. This will include CA certificate chains for all certificate authorities in the ENABLED, DISABLED, or STAGED states.", - "canonical": true, - "file": "certificate_authority_service.fetch_ca_certs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchCaCerts", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts", - "async": true, - "parameters": [ - { - "name": "ca_pool", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.FetchCaCertsResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "FetchCaCerts", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_async", - "title": "CertificateAuthorityService getCertificateRevocationList Sample", - "origin": "API_DEFINITION", - "description": " Returns a [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList].", - "canonical": true, - "file": "certificate_authority_service.get_certificate_revocation_list.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCertificateRevocationList", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationList", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.CertificateRevocationList", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "GetCertificateRevocationList", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationList", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async", - "title": "CertificateAuthorityService listCertificateRevocationLists Sample", - "origin": "API_DEFINITION", - "description": " Lists [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList].", - "canonical": true, - "file": "certificate_authority_service.list_certificate_revocation_lists.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCertificateRevocationLists", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ListCertificateRevocationLists", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async", - "title": "CertificateAuthorityService updateCertificateRevocationList Sample", - "origin": "API_DEFINITION", - "description": " Update a [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList].", - "canonical": true, - "file": "certificate_authority_service.update_certificate_revocation_list.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCertificateRevocationList", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationList", - "async": true, - "parameters": [ - { - "name": "certificate_revocation_list", - "type": ".google.cloud.security.privateca.v1.CertificateRevocationList" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "UpdateCertificateRevocationList", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationList", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async", - "title": "CertificateAuthorityService createCertificateTemplate Sample", - "origin": "API_DEFINITION", - "description": " Create a new [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] in a given Project and Location.", - "canonical": true, - "file": "certificate_authority_service.create_certificate_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCertificateTemplate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplate", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "certificate_template_id", - "type": "TYPE_STRING" - }, - { - "name": "certificate_template", - "type": ".google.cloud.security.privateca.v1.CertificateTemplate" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "CreateCertificateTemplate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async", - "title": "CertificateAuthorityService deleteCertificateTemplate Sample", - "origin": "API_DEFINITION", - "description": " DeleteCertificateTemplate deletes a [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate].", - "canonical": true, - "file": "certificate_authority_service.delete_certificate_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCertificateTemplate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "DeleteCertificateTemplate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_async", - "title": "CertificateAuthorityService getCertificateTemplate Sample", - "origin": "API_DEFINITION", - "description": " Returns a [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate].", - "canonical": true, - "file": "certificate_authority_service.get_certificate_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCertificateTemplate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.CertificateTemplate", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "GetCertificateTemplate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_async", - "title": "CertificateAuthorityService listCertificateTemplates Sample", - "origin": "API_DEFINITION", - "description": " Lists [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate].", - "canonical": true, - "file": "certificate_authority_service.list_certificate_templates.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCertificateTemplates", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1.ListCertificateTemplatesResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ListCertificateTemplates", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async", - "title": "CertificateAuthorityService updateCertificateTemplate Sample", - "origin": "API_DEFINITION", - "description": " Update a [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate].", - "canonical": true, - "file": "certificate_authority_service.update_certificate_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCertificateTemplate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplate", - "async": true, - "parameters": [ - { - "name": "certificate_template", - "type": ".google.cloud.security.privateca.v1.CertificateTemplate" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "UpdateCertificateTemplate", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js deleted file mode 100644 index 480e775882df..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, pemCaCertificate, subordinateConfig) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the - * format `projects/* /locations/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - /** - * Required. The signed CA certificate issued from - * FetchCertificateAuthorityCsrResponse.pem_csr google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.pem_csr. - */ - // const pemCaCertificate = 'abc123' - /** - * Required. Must include information about the issuer of 'pem_ca_certificate', and any - * further issuers until the self-signed CA. - */ - // const subordinateConfig = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callActivateCertificateAuthority() { - // Construct request - const request = { - name, - pemCaCertificate, - subordinateConfig, - }; - - // Run request - const [operation] = await privatecaClient.activateCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callActivateCertificateAuthority(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate.js deleted file mode 100644 index 73d3825b24c6..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, certificate) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location and CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority - * associated with the Certificate google.cloud.security.privateca.v1beta1.Certificate, in the format - * `projects/* /locations/* /certificateAuthorities/*`. - */ - // const parent = 'abc123' - /** - * Optional. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - * CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the Enterprise CertificateAuthority.Tier google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier, - * but is optional and its value is ignored otherwise. - */ - // const certificateId = 'abc123' - /** - * Required. A Certificate google.cloud.security.privateca.v1beta1.Certificate with initial field values. - */ - // const certificate = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callCreateCertificate() { - // Construct request - const request = { - parent, - certificate, - }; - - // Run request - const response = await privatecaClient.createCertificate(request); - console.log(response); - } - - callCreateCertificate(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js deleted file mode 100644 index 2aa8f4788225..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, certificateAuthorityId, certificateAuthority) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location associated with the - * CertificateAuthorities google.cloud.security.privateca.v1beta1.CertificateAuthority, in the format - * `projects/* /locations/*`. - */ - // const parent = 'abc123' - /** - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - */ - // const certificateAuthorityId = 'abc123' - /** - * Required. A CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority with initial field values. - */ - // const certificateAuthority = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callCreateCertificateAuthority() { - // Construct request - const request = { - parent, - certificateAuthorityId, - certificateAuthority, - }; - - // Run request - const [operation] = await privatecaClient.createCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateCertificateAuthority(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js deleted file mode 100644 index 8af3dc53872e..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the - * format `projects/* /locations/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - /** - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callDisableCertificateAuthority() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await privatecaClient.disableCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDisableCertificateAuthority(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js deleted file mode 100644 index 650b0ac7675b..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the - * format `projects/* /locations/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - /** - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callEnableCertificateAuthority() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await privatecaClient.enableCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callEnableCertificateAuthority(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js deleted file mode 100644 index a4a1b46fc184..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the - * format `projects/* /locations/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callFetchCertificateAuthorityCsr() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await privatecaClient.fetchCertificateAuthorityCsr(request); - console.log(response); - } - - callFetchCertificateAuthorityCsr(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate.js deleted file mode 100644 index 82970a185a1b..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name google.cloud.security.privateca.v1beta1.Certificate.name of the Certificate google.cloud.security.privateca.v1beta1.Certificate to get. - */ - // const name = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callGetCertificate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await privatecaClient.getCertificate(request); - console.log(response); - } - - callGetCertificate(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js deleted file mode 100644 index 9b8c68276bac..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name google.cloud.security.privateca.v1beta1.CertificateAuthority.name of the CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority to - * get. - */ - // const name = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callGetCertificateAuthority() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await privatecaClient.getCertificateAuthority(request); - console.log(response); - } - - callGetCertificateAuthority(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js deleted file mode 100644 index a96e6c2cd685..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name google.cloud.security.privateca.v1beta1.CertificateRevocationList.name of the - * CertificateRevocationList google.cloud.security.privateca.v1beta1.CertificateRevocationList to get. - */ - // const name = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callGetCertificateRevocationList() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await privatecaClient.getCertificateRevocationList(request); - console.log(response); - } - - callGetCertificateRevocationList(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js deleted file mode 100644 index 38f003d620f2..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name ReusableConfigs.name of the ReusableConfigs to get. - */ - // const name = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callGetReusableConfig() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await privatecaClient.getReusableConfig(request); - console.log(response); - } - - callGetReusableConfig(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js deleted file mode 100644 index 470f984314b0..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location associated with the - * CertificateAuthorities google.cloud.security.privateca.v1beta1.CertificateAuthority, in the format - * `projects/* /locations/*`. - */ - // const parent = 'abc123' - /** - * Optional. Limit on the number of CertificateAuthorities google.cloud.security.privateca.v1beta1.CertificateAuthority to - * include in the response. - * Further CertificateAuthorities google.cloud.security.privateca.v1beta1.CertificateAuthority can subsequently be - * obtained by including the - * ListCertificateAuthoritiesResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token in a subsequent - * request. If unspecified, the server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. Pagination token, returned earlier via - * ListCertificateAuthoritiesResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token. - */ - // const pageToken = 'abc123' - /** - * Optional. Only include resources that match the filter in the response. - */ - // const filter = 'abc123' - /** - * Optional. Specify how the results should be sorted. - */ - // const orderBy = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callListCertificateAuthorities() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = privatecaClient.listCertificateAuthoritiesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCertificateAuthorities(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js deleted file mode 100644 index fd477477d992..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location associated with the - * CertificateRevocationLists google.cloud.security.privateca.v1beta1.CertificateRevocationList, in the format - * `projects/* /locations/* /certificateauthorities/*`. - */ - // const parent = 'abc123' - /** - * Optional. Limit on the number of - * CertificateRevocationLists google.cloud.security.privateca.v1beta1.CertificateRevocationList to include in the - * response. Further CertificateRevocationLists google.cloud.security.privateca.v1beta1.CertificateRevocationList - * can subsequently be obtained by including the - * ListCertificateRevocationListsResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token in a subsequent - * request. If unspecified, the server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. Pagination token, returned earlier via - * ListCertificateRevocationListsResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token. - */ - // const pageToken = 'abc123' - /** - * Optional. Only include resources that match the filter in the response. - */ - // const filter = 'abc123' - /** - * Optional. Specify how the results should be sorted. - */ - // const orderBy = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callListCertificateRevocationLists() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = privatecaClient.listCertificateRevocationListsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCertificateRevocationLists(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificates.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificates.js deleted file mode 100644 index d1fef2ca4a75..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_certificates.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location associated with the - * Certificates google.cloud.security.privateca.v1beta1.Certificate, in the format - * `projects/* /locations/* /certificateauthorities/*`. - */ - // const parent = 'abc123' - /** - * Optional. Limit on the number of - * Certificates google.cloud.security.privateca.v1beta1.Certificate to include in the - * response. Further Certificates google.cloud.security.privateca.v1beta1.Certificate can subsequently be obtained - * by including the - * ListCertificatesResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token in a subsequent - * request. If unspecified, the server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. Pagination token, returned earlier via - * ListCertificatesResponse.next_page_token google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token. - */ - // const pageToken = 'abc123' - /** - * Optional. Only include resources that match the filter in the response. For details - * on supported filters and syntax, see Certificates Filtering - * documentation (https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - */ - // const filter = 'abc123' - /** - * Optional. Specify how the results should be sorted. For details on supported fields - * and syntax, see Certificates Sorting - * documentation (https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - */ - // const orderBy = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callListCertificates() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = privatecaClient.listCertificatesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCertificates(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js deleted file mode 100644 index fe28df6d9462..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location associated with the - * ReusableConfigs google.cloud.security.privateca.v1beta1.ReusableConfig, in the format - * `projects/* /locations/*`. - */ - // const parent = 'abc123' - /** - * Optional. Limit on the number of - * ReusableConfigs google.cloud.security.privateca.v1beta1.ReusableConfig to include in the response. - * Further ReusableConfigs google.cloud.security.privateca.v1beta1.ReusableConfig can subsequently be - * obtained by including the - * ListReusableConfigsResponse.next_page_token google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token in a subsequent request. If - * unspecified, the server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. Pagination token, returned earlier via - * ListReusableConfigsResponse.next_page_token google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token. - */ - // const pageToken = 'abc123' - /** - * Optional. Only include resources that match the filter in the response. - */ - // const filter = 'abc123' - /** - * Optional. Specify how the results should be sorted. - */ - // const orderBy = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callListReusableConfigs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = privatecaClient.listReusableConfigsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListReusableConfigs(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js deleted file mode 100644 index 2e86eae1d391..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the - * format `projects/* /locations/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - /** - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callRestoreCertificateAuthority() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await privatecaClient.restoreCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestoreCertificateAuthority(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js deleted file mode 100644 index 01a5d03ca217..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, reason) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this Certificate google.cloud.security.privateca.v1beta1.Certificate in the - * format `projects/* /locations/* /certificateAuthorities/* /certificates/*`. - */ - // const name = 'abc123' - /** - * Required. The RevocationReason google.cloud.security.privateca.v1beta1.RevocationReason for revoking this certificate. - */ - // const reason = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callRevokeCertificate() { - // Construct request - const request = { - name, - reason, - }; - - // Run request - const response = await privatecaClient.revokeCertificate(request); - console.log(response); - } - - callRevokeCertificate(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js deleted file mode 100644 index 6aa90aeaaf96..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority in the - * format `projects/* /locations/* /certificateAuthorities/*`. - */ - // const name = 'abc123' - /** - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callScheduleDeleteCertificateAuthority() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await privatecaClient.scheduleDeleteCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callScheduleDeleteCertificateAuthority(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate.js deleted file mode 100644 index 17571312bf34..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(certificate, updateMask) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Certificate google.cloud.security.privateca.v1beta1.Certificate with updated values. - */ - // const certificate = {} - /** - * Required. A list of fields to be updated in this request. - */ - // const updateMask = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callUpdateCertificate() { - // Construct request - const request = { - certificate, - updateMask, - }; - - // Run request - const response = await privatecaClient.updateCertificate(request); - console.log(response); - } - - callUpdateCertificate(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js deleted file mode 100644 index 3ad76629a601..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(certificateAuthority, updateMask) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. CertificateAuthority google.cloud.security.privateca.v1beta1.CertificateAuthority with updated values. - */ - // const certificateAuthority = {} - /** - * Required. A list of fields to be updated in this request. - */ - // const updateMask = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callUpdateCertificateAuthority() { - // Construct request - const request = { - certificateAuthority, - updateMask, - }; - - // Run request - const [operation] = await privatecaClient.updateCertificateAuthority(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateCertificateAuthority(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js deleted file mode 100644 index cc7ccfc1c711..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(certificateRevocationList, updateMask) { - // [START privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. CertificateRevocationList google.cloud.security.privateca.v1beta1.CertificateRevocationList with updated values. - */ - // const certificateRevocationList = {} - /** - * Required. A list of fields to be updated in this request. - */ - // const updateMask = {} - /** - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Privateca library - const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1beta1; - - // Instantiates a client - const privatecaClient = new CertificateAuthorityServiceClient(); - - async function callUpdateCertificateRevocationList() { - // Construct request - const request = { - certificateRevocationList, - updateMask, - }; - - // Run request - const [operation] = await privatecaClient.updateCertificateRevocationList(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateCertificateRevocationList(); - // [END privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata_google.cloud.security.privateca.v1beta1.json b/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata_google.cloud.security.privateca.v1beta1.json deleted file mode 100644 index de0c1f8e8433..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata_google.cloud.security.privateca.v1beta1.json +++ /dev/null @@ -1,963 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-privateca", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.security.privateca.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_async", - "title": "CertificateAuthorityService createCertificate Sample", - "origin": "API_DEFINITION", - "description": " Create a new [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in a given Project, Location from a particular [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.create_certificate.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCertificate", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificate", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "certificate_id", - "type": "TYPE_STRING" - }, - { - "name": "certificate", - "type": ".google.cloud.security.privateca.v1beta1.Certificate" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.Certificate", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "CreateCertificate", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_async", - "title": "CertificateAuthorityService getCertificate Sample", - "origin": "API_DEFINITION", - "description": " Returns a [Certificate][google.cloud.security.privateca.v1beta1.Certificate].", - "canonical": true, - "file": "certificate_authority_service.get_certificate.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCertificate", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.Certificate", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "GetCertificate", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_async", - "title": "CertificateAuthorityService listCertificates Sample", - "origin": "API_DEFINITION", - "description": " Lists [Certificates][google.cloud.security.privateca.v1beta1.Certificate].", - "canonical": true, - "file": "certificate_authority_service.list_certificates.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCertificates", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificates", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.ListCertificatesResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ListCertificates", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificates", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_async", - "title": "CertificateAuthorityService revokeCertificate Sample", - "origin": "API_DEFINITION", - "description": " Revoke a [Certificate][google.cloud.security.privateca.v1beta1.Certificate].", - "canonical": true, - "file": "certificate_authority_service.revoke_certificate.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RevokeCertificate", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "reason", - "type": ".google.cloud.security.privateca.v1beta1.RevocationReason" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.Certificate", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "RevokeCertificate", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_async", - "title": "CertificateAuthorityService updateCertificate Sample", - "origin": "API_DEFINITION", - "description": " Update a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. Currently, the only field you can update is the [labels][google.cloud.security.privateca.v1beta1.Certificate.labels] field.", - "canonical": true, - "file": "certificate_authority_service.update_certificate.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCertificate", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificate", - "async": true, - "parameters": [ - { - "name": "certificate", - "type": ".google.cloud.security.privateca.v1beta1.Certificate" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.Certificate", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "UpdateCertificate", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificate", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async", - "title": "CertificateAuthorityService activateCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Activate a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is in state [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. After the parent Certificate Authority signs a certificate signing request from [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr], this method can complete the activation process.", - "canonical": true, - "file": "certificate_authority_service.activate_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ActivateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "pem_ca_certificate", - "type": "TYPE_STRING" - }, - { - "name": "subordinate_config", - "type": ".google.cloud.security.privateca.v1beta1.SubordinateConfig" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ActivateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_async", - "title": "CertificateAuthorityService createCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Create a new [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in a given Project and Location.", - "canonical": true, - "file": "certificate_authority_service.create_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "certificate_authority_id", - "type": "TYPE_STRING" - }, - { - "name": "certificate_authority", - "type": ".google.cloud.security.privateca.v1beta1.CertificateAuthority" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "CreateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_async", - "title": "CertificateAuthorityService disableCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Disable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.disable_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DisableCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "DisableCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_async", - "title": "CertificateAuthorityService enableCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Enable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.enable_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "EnableCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "EnableCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async", - "title": "CertificateAuthorityService fetchCertificateAuthorityCsr Sample", - "origin": "API_DEFINITION", - "description": " Fetch a certificate signing request (CSR) from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is in state [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. The CSR must then be signed by the desired parent Certificate Authority, which could be another [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] resource, or could be an on-prem certificate authority. See also [ActivateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.fetch_certificate_authority_csr.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchCertificateAuthorityCsr", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "FetchCertificateAuthorityCsr", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_async", - "title": "CertificateAuthorityService getCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Returns a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.get_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.CertificateAuthority", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "GetCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_async", - "title": "CertificateAuthorityService listCertificateAuthorities Sample", - "origin": "API_DEFINITION", - "description": " Lists [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.list_certificate_authorities.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCertificateAuthorities", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthorities", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ListCertificateAuthorities", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthorities", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_async", - "title": "CertificateAuthorityService restoreCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Restore a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is scheduled for deletion.", - "canonical": true, - "file": "certificate_authority_service.restore_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "RestoreCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_async", - "title": "CertificateAuthorityService scheduleDeleteCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Schedule a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] for deletion.", - "canonical": true, - "file": "certificate_authority_service.schedule_delete_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ScheduleDeleteCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ScheduleDeleteCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async", - "title": "CertificateAuthorityService updateCertificateAuthority Sample", - "origin": "API_DEFINITION", - "description": " Update a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority].", - "canonical": true, - "file": "certificate_authority_service.update_certificate_authority.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthority", - "async": true, - "parameters": [ - { - "name": "certificate_authority", - "type": ".google.cloud.security.privateca.v1beta1.CertificateAuthority" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "UpdateCertificateAuthority", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthority", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_async", - "title": "CertificateAuthorityService getCertificateRevocationList Sample", - "origin": "API_DEFINITION", - "description": " Returns a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList].", - "canonical": true, - "file": "certificate_authority_service.get_certificate_revocation_list.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCertificateRevocationList", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationList", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.CertificateRevocationList", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "GetCertificateRevocationList", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationList", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async", - "title": "CertificateAuthorityService listCertificateRevocationLists Sample", - "origin": "API_DEFINITION", - "description": " Lists [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList].", - "canonical": true, - "file": "certificate_authority_service.list_certificate_revocation_lists.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCertificateRevocationLists", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationLists", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ListCertificateRevocationLists", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationLists", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async", - "title": "CertificateAuthorityService updateCertificateRevocationList Sample", - "origin": "API_DEFINITION", - "description": " Update a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList].", - "canonical": true, - "file": "certificate_authority_service.update_certificate_revocation_list.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCertificateRevocationList", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationList", - "async": true, - "parameters": [ - { - "name": "certificate_revocation_list", - "type": ".google.cloud.security.privateca.v1beta1.CertificateRevocationList" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "UpdateCertificateRevocationList", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationList", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_async", - "title": "CertificateAuthorityService getReusableConfig Sample", - "origin": "API_DEFINITION", - "description": " Returns a [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig].", - "canonical": true, - "file": "certificate_authority_service.get_reusable_config.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetReusableConfig", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfig", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.ReusableConfig", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "GetReusableConfig", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfig", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - }, - { - "regionTag": "privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_async", - "title": "CertificateAuthorityService listReusableConfigs Sample", - "origin": "API_DEFINITION", - "description": " Lists [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig].", - "canonical": true, - "file": "certificate_authority_service.list_reusable_configs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListReusableConfigs", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse", - "client": { - "shortName": "CertificateAuthorityServiceClient", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityServiceClient" - }, - "method": { - "shortName": "ListReusableConfigs", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigs", - "service": { - "shortName": "CertificateAuthorityService", - "fullName": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/index.ts b/owl-bot-staging/google-cloud-security-privateca/src/index.ts deleted file mode 100644 index c5cdb2fc6929..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/src/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2026 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 synthtool. ** -// ** https://github.com/googleapis/synthtool ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -import * as v1beta1 from './v1beta1'; - -const CertificateAuthorityServiceClient = v1.CertificateAuthorityServiceClient; -type CertificateAuthorityServiceClient = v1.CertificateAuthorityServiceClient; - -export {v1, v1beta1, CertificateAuthorityServiceClient}; -export default {v1, v1beta1, CertificateAuthorityServiceClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts b/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts deleted file mode 100644 index 01b6373b2fd7..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts +++ /dev/null @@ -1,7233 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type { - Callback, - CallOptions, - Descriptors, - ClientOptions, - GrpcClientOptions, - LROperation, - PaginationCallback, - GaxCall, - IamClient, - IamProtos, - LocationsClient, - LocationProtos, -} from 'google-gax'; -import { Transform } from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/certificate_authority_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './certificate_authority_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * [Certificate Authority - * Service][google.cloud.security.privateca.v1.CertificateAuthorityService] - * manages private certificate authorities and issued certificates. - * @class - * @memberof v1 - */ -export class CertificateAuthorityServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: { [method: string]: gax.CallSettings }; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('security-private-ca'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: { [name: string]: Function }; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: { [name: string]: gax.PathTemplate }; - operationsClient: gax.OperationsClient; - certificateAuthorityServiceStub?: Promise<{ [name: string]: Function }>; - - /** - * Construct an instance of CertificateAuthorityServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new CertificateAuthorityServiceClient({fallback: true}, gax); - * ``` - */ - constructor( - opts?: ClientOptions, - gaxInstance?: typeof gax | typeof gax.fallback, - ) { - // Ensure that options include all the required fields. - const staticMembers = this - .constructor as typeof CertificateAuthorityServiceClient; - if ( - opts?.universe_domain && - opts?.universeDomain && - opts?.universe_domain !== opts?.universeDomain - ) { - throw new Error( - 'Please set either universe_domain or universeDomain, but not both.', - ); - } - const universeDomainEnvVar = - typeof process === 'object' && typeof process.env === 'object' - ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] - : undefined; - this._universeDomain = - opts?.universeDomain ?? - opts?.universe_domain ?? - universeDomainEnvVar ?? - 'googleapis.com'; - this._servicePath = 'privateca.' + this._universeDomain; - const servicePath = - opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!( - opts?.servicePath || opts?.apiEndpoint - ); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = - opts?.fallback ?? - (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = this._gaxGrpc.auth as gax.GoogleAuth; - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts, - ); - - // Determine the client header string. - const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - caPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/caPools/{ca_pool}', - ), - certificatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}', - ), - certificateAuthorityPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}', - ), - certificateRevocationListPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}', - ), - certificateTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/certificateTemplates/{certificate_template}', - ), - locationPathTemplate: new this._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 = { - listCertificates: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'certificates', - ), - listCertificateAuthorities: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'certificateAuthorities', - ), - listCaPools: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'caPools', - ), - listCertificateRevocationLists: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'certificateRevocationLists', - ), - listCertificateTemplates: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'certificateTemplates', - ), - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [ - { - selector: 'google.cloud.location.Locations.GetLocation', - get: '/v1/{name=projects/*/locations/*}', - }, - { - selector: 'google.cloud.location.Locations.ListLocations', - get: '/v1/{name=projects/*}/locations', - }, - { - selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', - get: '/v1/{resource=projects/*/locations/*/caPools/*}:getIamPolicy', - additional_bindings: [ - { - get: '/v1/{resource=projects/*/locations/*/certificateTemplates/*}:getIamPolicy', - }, - { - get: '/v1/{resource=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}:getIamPolicy', - }, - ], - }, - { - selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', - post: '/v1/{resource=projects/*/locations/*/caPools/*}:setIamPolicy', - body: '*', - additional_bindings: [ - { - post: '/v1/{resource=projects/*/locations/*/certificateTemplates/*}:setIamPolicy', - body: '*', - }, - { - post: '/v1/{resource=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}:setIamPolicy', - body: '*', - }, - ], - }, - { - selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', - post: '/v1/{resource=projects/*/locations/*/caPools/*}:testIamPermissions', - body: '*', - additional_bindings: [ - { - post: '/v1/{resource=projects/*/locations/*/certificateTemplates/*}:testIamPermissions', - body: '*', - }, - { - post: '/v1/{resource=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}:testIamPermissions', - body: '*', - }, - ], - }, - { - selector: 'google.longrunning.Operations.CancelOperation', - post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', - body: '*', - }, - { - selector: 'google.longrunning.Operations.DeleteOperation', - delete: '/v1/{name=projects/*/locations/*/operations/*}', - }, - { - selector: 'google.longrunning.Operations.GetOperation', - get: '/v1/{name=projects/*/locations/*/operations/*}', - }, - { - selector: 'google.longrunning.Operations.ListOperations', - get: '/v1/{name=projects/*/locations/*}/operations', - }, - ]; - } - this.operationsClient = this._gaxModule - .lro(lroOptions) - .operationsClient(opts); - const activateCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CertificateAuthority', - ) as gax.protobuf.Type; - const activateCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const createCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CertificateAuthority', - ) as gax.protobuf.Type; - const createCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const disableCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CertificateAuthority', - ) as gax.protobuf.Type; - const disableCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const enableCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CertificateAuthority', - ) as gax.protobuf.Type; - const enableCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const undeleteCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CertificateAuthority', - ) as gax.protobuf.Type; - const undeleteCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const deleteCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CertificateAuthority', - ) as gax.protobuf.Type; - const deleteCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const updateCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CertificateAuthority', - ) as gax.protobuf.Type; - const updateCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const createCaPoolResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CaPool', - ) as gax.protobuf.Type; - const createCaPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const updateCaPoolResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CaPool', - ) as gax.protobuf.Type; - const updateCaPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const deleteCaPoolResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty', - ) as gax.protobuf.Type; - const deleteCaPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const updateCertificateRevocationListResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CertificateRevocationList', - ) as gax.protobuf.Type; - const updateCertificateRevocationListMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const createCertificateTemplateResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CertificateTemplate', - ) as gax.protobuf.Type; - const createCertificateTemplateMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const deleteCertificateTemplateResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty', - ) as gax.protobuf.Type; - const deleteCertificateTemplateMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - const updateCertificateTemplateResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.CertificateTemplate', - ) as gax.protobuf.Type; - const updateCertificateTemplateMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1.OperationMetadata', - ) as gax.protobuf.Type; - - this.descriptors.longrunning = { - activateCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - activateCertificateAuthorityResponse.decode.bind( - activateCertificateAuthorityResponse, - ), - activateCertificateAuthorityMetadata.decode.bind( - activateCertificateAuthorityMetadata, - ), - ), - createCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createCertificateAuthorityResponse.decode.bind( - createCertificateAuthorityResponse, - ), - createCertificateAuthorityMetadata.decode.bind( - createCertificateAuthorityMetadata, - ), - ), - disableCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - disableCertificateAuthorityResponse.decode.bind( - disableCertificateAuthorityResponse, - ), - disableCertificateAuthorityMetadata.decode.bind( - disableCertificateAuthorityMetadata, - ), - ), - enableCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - enableCertificateAuthorityResponse.decode.bind( - enableCertificateAuthorityResponse, - ), - enableCertificateAuthorityMetadata.decode.bind( - enableCertificateAuthorityMetadata, - ), - ), - undeleteCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - undeleteCertificateAuthorityResponse.decode.bind( - undeleteCertificateAuthorityResponse, - ), - undeleteCertificateAuthorityMetadata.decode.bind( - undeleteCertificateAuthorityMetadata, - ), - ), - deleteCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteCertificateAuthorityResponse.decode.bind( - deleteCertificateAuthorityResponse, - ), - deleteCertificateAuthorityMetadata.decode.bind( - deleteCertificateAuthorityMetadata, - ), - ), - updateCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateCertificateAuthorityResponse.decode.bind( - updateCertificateAuthorityResponse, - ), - updateCertificateAuthorityMetadata.decode.bind( - updateCertificateAuthorityMetadata, - ), - ), - createCaPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createCaPoolResponse.decode.bind(createCaPoolResponse), - createCaPoolMetadata.decode.bind(createCaPoolMetadata), - ), - updateCaPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateCaPoolResponse.decode.bind(updateCaPoolResponse), - updateCaPoolMetadata.decode.bind(updateCaPoolMetadata), - ), - deleteCaPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteCaPoolResponse.decode.bind(deleteCaPoolResponse), - deleteCaPoolMetadata.decode.bind(deleteCaPoolMetadata), - ), - updateCertificateRevocationList: - new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateCertificateRevocationListResponse.decode.bind( - updateCertificateRevocationListResponse, - ), - updateCertificateRevocationListMetadata.decode.bind( - updateCertificateRevocationListMetadata, - ), - ), - createCertificateTemplate: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createCertificateTemplateResponse.decode.bind( - createCertificateTemplateResponse, - ), - createCertificateTemplateMetadata.decode.bind( - createCertificateTemplateMetadata, - ), - ), - deleteCertificateTemplate: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteCertificateTemplateResponse.decode.bind( - deleteCertificateTemplateResponse, - ), - deleteCertificateTemplateMetadata.decode.bind( - deleteCertificateTemplateMetadata, - ), - ), - updateCertificateTemplate: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateCertificateTemplateResponse.decode.bind( - updateCertificateTemplateResponse, - ), - updateCertificateTemplateMetadata.decode.bind( - updateCertificateTemplateMetadata, - ), - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.security.privateca.v1.CertificateAuthorityService', - gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, - { 'x-goog-api-client': clientHeader.join(' ') }, - ); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.certificateAuthorityServiceStub) { - return this.certificateAuthorityServiceStub; - } - - // Put together the "service stub" for - // google.cloud.security.privateca.v1.CertificateAuthorityService. - this.certificateAuthorityServiceStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.cloud.security.privateca.v1.CertificateAuthorityService', - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.security.privateca.v1 - .CertificateAuthorityService, - this._opts, - this._providedCustomServicePath, - ) as Promise<{ [method: string]: Function }>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const certificateAuthorityServiceStubMethods = [ - 'createCertificate', - 'getCertificate', - 'listCertificates', - 'revokeCertificate', - 'updateCertificate', - 'activateCertificateAuthority', - 'createCertificateAuthority', - 'disableCertificateAuthority', - 'enableCertificateAuthority', - 'fetchCertificateAuthorityCsr', - 'getCertificateAuthority', - 'listCertificateAuthorities', - 'undeleteCertificateAuthority', - 'deleteCertificateAuthority', - 'updateCertificateAuthority', - 'createCaPool', - 'updateCaPool', - 'getCaPool', - 'listCaPools', - 'deleteCaPool', - 'fetchCaCerts', - 'getCertificateRevocationList', - 'listCertificateRevocationLists', - 'updateCertificateRevocationList', - 'createCertificateTemplate', - 'deleteCertificateTemplate', - 'getCertificateTemplate', - 'listCertificateTemplates', - 'updateCertificateTemplate', - ]; - for (const methodName of certificateAuthorityServiceStubMethods) { - const callPromise = this.certificateAuthorityServiceStub.then( - (stub) => - (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error | null | undefined) => () => { - throw err; - }, - ); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback, - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.certificateAuthorityServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - process.emitWarning( - 'Static servicePath is deprecated, please use the instance method instead.', - 'DeprecationWarning', - ); - } - return 'privateca.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - process.emitWarning( - 'Static apiEndpoint is deprecated, please use the instance method instead.', - 'DeprecationWarning', - ); - } - return 'privateca.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId( - callback?: Callback, - ): Promise | void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - /** - * Create a new {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} - * in a given Project, Location from a particular - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} associated with the - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}, in the - * format `projects/* /locations/* /caPools/*`. - * @param {string} [request.certificateId] - * Optional. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * in the Enterprise - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.tier|CertificateAuthority.tier}, - * but is optional and its value is ignored otherwise. - * @param {google.cloud.security.privateca.v1.Certificate} request.certificate - * Required. A {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} - * with initial field values. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.validateOnly] - * Optional. If this is true, no - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} resource will - * be persisted regardless of the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}'s - * {@link protos.google.cloud.security.privateca.v1.CaPool.tier|tier}, and the returned - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} will not - * contain the - * {@link protos.google.cloud.security.privateca.v1.Certificate.pem_certificate|pem_certificate} - * field. - * @param {string} [request.issuingCertificateAuthorityId] - * Optional. The resource ID of the - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * that should issue the certificate. This optional field will ignore the - * load-balancing scheme of the Pool and directly issue the certificate from - * the CA with the specified ID, contained in the same - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} referenced by `parent`. - * Per-CA quota rules apply. If left empty, a - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * will be chosen from the {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} - * by the service. For example, to issue a - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} from a - * Certificate Authority with resource name - * "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", - * you can set the - * {@link protos.google.cloud.security.privateca.v1.CreateCertificateRequest.parent|parent} - * to "projects/my-project/locations/us-central1/caPools/my-pool" and the - * {@link protos.google.cloud.security.privateca.v1.CreateCertificateRequest.issuing_certificate_authority_id|issuing_certificate_authority_id} - * to "my-ca". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.create_certificate.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificate_async - */ - createCertificate( - request?: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest - | undefined - ), - {} | undefined, - ] - >; - createCertificate( - request: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - createCertificate( - request: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - createCertificate( - request?: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('createCertificate request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createCertificate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .createCertificate(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('createCertificate response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Returns a {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The {@link protos.google.cloud.security.privateca.v1.Certificate.name|name} - * of the {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} 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 {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.get_certificate.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificate_async - */ - getCertificate( - request?: protos.google.cloud.security.privateca.v1.IGetCertificateRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateRequest - | undefined - ), - {} | undefined, - ] - >; - getCertificate( - request: protos.google.cloud.security.privateca.v1.IGetCertificateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IGetCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificate( - request: protos.google.cloud.security.privateca.v1.IGetCertificateRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IGetCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificate( - request?: protos.google.cloud.security.privateca.v1.IGetCertificateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IGetCertificateRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IGetCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('getCertificate request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IGetCertificateRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCertificate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .getCertificate(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('getCertificate response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Revoke a {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} in the format - * `projects/* /locations/* /caPools/* /certificates/*`. - * @param {google.cloud.security.privateca.v1.RevocationReason} request.reason - * Required. The - * {@link protos.google.cloud.security.privateca.v1.RevocationReason|RevocationReason} for - * revoking this certificate. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.revoke_certificate.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_async - */ - revokeCertificate( - request?: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest - | undefined - ), - {} | undefined, - ] - >; - revokeCertificate( - request: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - revokeCertificate( - request: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - revokeCertificate( - request?: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('revokeCertificate request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('revokeCertificate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .revokeCertificate(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('revokeCertificate response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Update a {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. - * Currently, the only field you can update is the - * {@link protos.google.cloud.security.privateca.v1.Certificate.labels|labels} field. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.security.privateca.v1.Certificate} request.certificate - * Required. {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} - * with updated values. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A list of fields to be updated in this request. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.update_certificate.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_async - */ - updateCertificate( - request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest - | undefined - ), - {} | undefined, - ] - >; - updateCertificate( - request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - updateCertificate( - request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - updateCertificate( - request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - 'certificate.name': request.certificate!.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('updateCertificate request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1.ICertificate, - | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateCertificate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .updateCertificate(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('updateCertificate response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Fetch a certificate signing request (CSR) from a - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * that is in state - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION|AWAITING_USER_ACTIVATION} - * and is of type - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE|SUBORDINATE}. - * The CSR must then be signed by the desired parent Certificate Authority, - * which could be another - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * resource, or could be an on-prem certificate authority. See also - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority|ActivateCertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse|FetchCertificateAuthorityCsrResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async - */ - fetchCertificateAuthorityCsr( - request?: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, - ( - | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest - | undefined - ), - {} | undefined, - ] - >; - fetchCertificateAuthorityCsr( - request: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, - | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - fetchCertificateAuthorityCsr( - request: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, - | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - fetchCertificateAuthorityCsr( - request?: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, - | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, - | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, - ( - | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('fetchCertificateAuthorityCsr request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, - | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('fetchCertificateAuthorityCsr response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .fetchCertificateAuthorityCsr(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse, - ( - | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('fetchCertificateAuthorityCsr response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Returns a - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.name|name} of the - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * 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 {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.get_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_async - */ - getCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest - | undefined - ), - {} | undefined, - ] - >; - getCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('getCertificateAuthority request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCertificateAuthority response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .getCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('getCertificateAuthority response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Returns a {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The {@link protos.google.cloud.security.privateca.v1.CaPool.name|name} of the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} 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 {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.get_ca_pool.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCaPool_async - */ - getCaPool( - request?: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IGetCaPoolRequest | undefined, - {} | undefined, - ] - >; - getCaPool( - request: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICaPool, - | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCaPool( - request: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICaPool, - | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCaPool( - request?: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1.ICaPool, - | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1.ICaPool, - | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IGetCaPoolRequest | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('getCaPool request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1.ICaPool, - | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCaPool response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .getCaPool(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1.ICaPool, - ( - | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('getCaPool response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * FetchCaCerts returns the current trust anchor for the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. This will include CA - * certificate chains for all certificate authorities in the ENABLED, - * DISABLED, or STAGED states. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.caPool - * Required. The resource name for the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} in the format - * `projects/* /locations/* /caPools/*`. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1.FetchCaCertsResponse|FetchCaCertsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.fetch_ca_certs.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_async - */ - fetchCaCerts( - request?: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, - ( - | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest - | undefined - ), - {} | undefined, - ] - >; - fetchCaCerts( - request: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, - | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - fetchCaCerts( - request: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, - | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - fetchCaCerts( - request?: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, - | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, - | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, - ( - | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - ca_pool: request.caPool ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('fetchCaCerts request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, - | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('fetchCaCerts response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .fetchCaCerts(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse, - ( - | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('fetchCaCerts response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Returns a - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList.name|name} - * of the - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList} - * 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 {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_async - */ - getCertificateRevocationList( - request?: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest - | undefined - ), - {} | undefined, - ] - >; - getCertificateRevocationList( - request: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificateRevocationList( - request: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificateRevocationList( - request?: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('getCertificateRevocationList request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCertificateRevocationList response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .getCertificateRevocationList(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('getCertificateRevocationList response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Returns a - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate.name|name} of the - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} - * 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 {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.get_certificate_template.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_async - */ - getCertificateTemplate( - request?: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest - | undefined - ), - {} | undefined, - ] - >; - getCertificateTemplate( - request: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificateTemplate( - request: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificateTemplate( - request?: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('getCertificateTemplate request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCertificateTemplate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .getCertificateTemplate(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - ( - | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('getCertificateTemplate response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - - /** - * Activate a - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * that is in state - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION|AWAITING_USER_ACTIVATION} - * and is of type - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE|SUBORDINATE}. - * After the parent Certificate Authority signs a certificate signing request - * from - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr|FetchCertificateAuthorityCsr}, - * this method can complete the activation process. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - * @param {string} request.pemCaCertificate - * Required. The signed CA certificate issued from - * {@link protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.pem_csr|FetchCertificateAuthorityCsrResponse.pem_csr}. - * @param {google.cloud.security.privateca.v1.SubordinateConfig} request.subordinateConfig - * Required. Must include information about the issuer of - * 'pem_ca_certificate', and any further issuers until the self-signed CA. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.activate_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async - */ - activateCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - activateCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - activateCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - activateCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info( - 'activateCertificateAuthority response %j', - rawResponse, - ); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('activateCertificateAuthority request %j', request); - return this.innerApiCalls - .activateCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info( - 'activateCertificateAuthority response %j', - rawResponse, - ); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `activateCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.activate_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async - */ - async checkActivateCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('activateCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.activateCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Create a new - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * 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 - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} associated with the - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, - * in the format `projects/* /locations/* /caPools/*`. - * @param {string} request.certificateAuthorityId - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param {google.cloud.security.privateca.v1.CertificateAuthority} request.certificateAuthority - * Required. A - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * with initial field values. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.create_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async - */ - createCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - createCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - createCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - createCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createCertificateAuthority response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createCertificateAuthority request %j', request); - return this.innerApiCalls - .createCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('createCertificateAuthority response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `createCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.create_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async - */ - async checkCreateCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('createCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.createCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Disable a - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.ignoreDependentResources] - * Optional. This field allows this CA to be disabled even if it's being - * depended on by another resource. However, doing so may result in unintended - * and unrecoverable effects on any dependent resources since the CA will - * no longer be able to issue certificates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.disable_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async - */ - disableCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - disableCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - disableCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - disableCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info( - 'disableCertificateAuthority response %j', - rawResponse, - ); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('disableCertificateAuthority request %j', request); - return this.innerApiCalls - .disableCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info( - 'disableCertificateAuthority response %j', - rawResponse, - ); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `disableCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.disable_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async - */ - async checkDisableCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('disableCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.disableCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Enable a - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.enable_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async - */ - enableCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - enableCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - enableCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - enableCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('enableCertificateAuthority response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('enableCertificateAuthority request %j', request); - return this.innerApiCalls - .enableCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('enableCertificateAuthority response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `enableCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.enable_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async - */ - async checkEnableCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('enableCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.enableCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Undelete a - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * that has been deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async - */ - undeleteCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - undeleteCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - undeleteCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - undeleteCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info( - 'undeleteCertificateAuthority response %j', - rawResponse, - ); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('undeleteCertificateAuthority request %j', request); - return this.innerApiCalls - .undeleteCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info( - 'undeleteCertificateAuthority response %j', - rawResponse, - ); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `undeleteCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async - */ - async checkUndeleteCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('undeleteCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.undeleteCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Delete a - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.ignoreActiveCertificates] - * Optional. This field allows the CA to be deleted even if the CA has - * active certs. Active certs include both unrevoked and unexpired certs. - * @param {boolean} [request.skipGracePeriod] - * Optional. If this flag is set, the Certificate Authority will be deleted as - * soon as possible without a 30-day grace period where undeletion would have - * been allowed. If you proceed, there will be no way to recover this CA. - * @param {boolean} [request.ignoreDependentResources] - * Optional. This field allows this CA to be deleted even if it's being - * depended on by another resource. However, doing so may result in unintended - * and unrecoverable effects on any dependent resources since the CA will - * no longer be able to issue certificates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.delete_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async - */ - deleteCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - deleteCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - deleteCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - deleteCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteCertificateAuthority response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteCertificateAuthority request %j', request); - return this.innerApiCalls - .deleteCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('deleteCertificateAuthority response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `deleteCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.delete_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async - */ - async checkDeleteCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('deleteCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.deleteCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Update a - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.security.privateca.v1.CertificateAuthority} request.certificateAuthority - * Required. - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} - * with updated values. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A list of fields to be updated in this request. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.update_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async - */ - updateCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - updateCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCertificateAuthority( - request: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - 'certificate_authority.name': request.certificateAuthority!.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateCertificateAuthority response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateCertificateAuthority request %j', request); - return this.innerApiCalls - .updateCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('updateCertificateAuthority response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `updateCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.update_certificate_authority.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async - */ - async checkUpdateCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('updateCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.updateCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CertificateAuthority, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Create a {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}, in the format - * `projects/* /locations/*`. - * @param {string} request.caPoolId - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param {google.cloud.security.privateca.v1.CaPool} request.caPool - * Required. A {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} with - * initial field values. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.create_ca_pool.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async - */ - createCaPool( - request?: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - createCaPool( - request: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - createCaPool( - request: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - createCaPool( - request?: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createCaPool response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createCaPool request %j', request); - return this.innerApiCalls - .createCaPool(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('createCaPool response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `createCaPool()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.create_ca_pool.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async - */ - async checkCreateCaPoolProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CaPool, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('createCaPool long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.createCaPool, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CaPool, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Update a {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.security.privateca.v1.CaPool} request.caPool - * Required. {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} with updated - * values. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A list of fields to be updated in this request. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.update_ca_pool.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async - */ - updateCaPool( - request?: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - updateCaPool( - request: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCaPool( - request: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCaPool( - request?: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - 'ca_pool.name': request.caPool!.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateCaPool response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateCaPool request %j', request); - return this.innerApiCalls - .updateCaPool(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('updateCaPool response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `updateCaPool()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.update_ca_pool.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async - */ - async checkUpdateCaPoolProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CaPool, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('updateCaPool long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.updateCaPool, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CaPool, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Delete a {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} in the format - * `projects/* /locations/* /caPools/*`. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.ignoreDependentResources] - * Optional. This field allows this pool to be deleted even if it's being - * depended on by another resource. However, doing so may result in unintended - * and unrecoverable effects on any dependent resources since the pool will - * no longer be able to issue certificates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.delete_ca_pool.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async - */ - deleteCaPool( - request?: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - deleteCaPool( - request: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - deleteCaPool( - request: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - deleteCaPool( - request?: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteCaPool response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteCaPool request %j', request); - return this.innerApiCalls - .deleteCaPool(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('deleteCaPool response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `deleteCaPool()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.delete_ca_pool.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async - */ - async checkDeleteCaPoolProgress( - name: string, - ): Promise< - LROperation< - protos.google.protobuf.Empty, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('deleteCaPool long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.deleteCaPool, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.protobuf.Empty, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Update a - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.security.privateca.v1.CertificateRevocationList} request.certificateRevocationList - * Required. - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList} - * with updated values. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A list of fields to be updated in this request. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async - */ - updateCertificateRevocationList( - request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - updateCertificateRevocationList( - request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCertificateRevocationList( - request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCertificateRevocationList( - request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - 'certificate_revocation_list.name': - request.certificateRevocationList!.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info( - 'updateCertificateRevocationList response %j', - rawResponse, - ); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateCertificateRevocationList request %j', request); - return this.innerApiCalls - .updateCertificateRevocationList(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info( - 'updateCertificateRevocationList response %j', - rawResponse, - ); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `updateCertificateRevocationList()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async - */ - async checkUpdateCertificateRevocationListProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CertificateRevocationList, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('updateCertificateRevocationList long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.updateCertificateRevocationList, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CertificateRevocationList, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Create a new - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} - * 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 - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}, - * in the format `projects/* /locations/*`. - * @param {string} request.certificateTemplateId - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param {google.cloud.security.privateca.v1.CertificateTemplate} request.certificateTemplate - * Required. A - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} - * with initial field values. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.create_certificate_template.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async - */ - createCertificateTemplate( - request?: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - createCertificateTemplate( - request: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - createCertificateTemplate( - request: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - createCertificateTemplate( - request?: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createCertificateTemplate response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createCertificateTemplate request %j', request); - return this.innerApiCalls - .createCertificateTemplate(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('createCertificateTemplate response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `createCertificateTemplate()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.create_certificate_template.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async - */ - async checkCreateCertificateTemplateProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CertificateTemplate, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('createCertificateTemplate long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.createCertificateTemplate, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CertificateTemplate, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * DeleteCertificateTemplate deletes a - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} - * in the format `projects/* /locations/* /certificateTemplates/*`. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.delete_certificate_template.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async - */ - deleteCertificateTemplate( - request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - deleteCertificateTemplate( - request: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - deleteCertificateTemplate( - request: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - deleteCertificateTemplate( - request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteCertificateTemplate response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteCertificateTemplate request %j', request); - return this.innerApiCalls - .deleteCertificateTemplate(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('deleteCertificateTemplate response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `deleteCertificateTemplate()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.delete_certificate_template.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async - */ - async checkDeleteCertificateTemplateProgress( - name: string, - ): Promise< - LROperation< - protos.google.protobuf.Empty, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('deleteCertificateTemplate long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.deleteCertificateTemplate, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.protobuf.Empty, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Update a - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.security.privateca.v1.CertificateTemplate} request.certificateTemplate - * Required. - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} - * with updated values. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A list of fields to be updated in this request. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that - * if you must retry your request, the server will know to ignore the request - * if it has already been completed. The server will guarantee that for at - * least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.update_certificate_template.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async - */ - updateCertificateTemplate( - request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - updateCertificateTemplate( - request: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCertificateTemplate( - request: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCertificateTemplate( - request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - 'certificate_template.name': request.certificateTemplate!.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateCertificateTemplate response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateCertificateTemplate request %j', request); - return this.innerApiCalls - .updateCertificateTemplate(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('updateCertificateTemplate response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `updateCertificateTemplate()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.update_certificate_template.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async - */ - async checkUpdateCertificateTemplateProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1.CertificateTemplate, - protos.google.cloud.security.privateca.v1.OperationMetadata - > - > { - this._log.info('updateCertificateTemplate long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.updateCertificateTemplate, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1.CertificateTemplate, - protos.google.cloud.security.privateca.v1.OperationMetadata - >; - } - /** - * Lists {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the parent associated with the - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates}, in the - * format `projects/* /locations/* /caPools/*`. The parent resource name can be - * in one of two forms: - * - * 1. **Specific CA Pool:** To list certificates within a single CA Pool: - * `projects/* /locations/* /caPools/*` - * - * 2. **All CA Pools in a Location:** To list certificates across *all* CA - * Pools in a given project and location, use the wildcard character (`-`) - * in place of the CA Pool ID. - * Example: `projects/* /locations/* /caPools/-` - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} to include - * in the response. Further - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} can - * subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For - * details on supported filters and syntax, see [Certificates Filtering - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. For details on - * supported fields and syntax, see [Certificates Sorting - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCertificatesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificates( - request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificate[], - protos.google.cloud.security.privateca.v1.IListCertificatesRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificatesResponse, - ] - >; - listCertificates( - request: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificatesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificate - >, - ): void; - listCertificates( - request: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificatesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificate - >, - ): void; - listCertificates( - request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificatesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificate - >, - callback?: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificatesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificate - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificate[], - protos.google.cloud.security.privateca.v1.IListCertificatesRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificatesResponse, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificatesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificate - > - | undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listCertificates values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listCertificates request %j', request); - return this.innerApiCalls - .listCertificates(request, options, wrappedCallback) - ?.then( - ([response, input, output]: [ - protos.google.cloud.security.privateca.v1.ICertificate[], - protos.google.cloud.security.privateca.v1.IListCertificatesRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificatesResponse, - ]) => { - this._log.info('listCertificates values %j', response); - return [response, input, output]; - }, - ); - } - - /** - * Equivalent to `listCertificates`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the parent associated with the - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates}, in the - * format `projects/* /locations/* /caPools/*`. The parent resource name can be - * in one of two forms: - * - * 1. **Specific CA Pool:** To list certificates within a single CA Pool: - * `projects/* /locations/* /caPools/*` - * - * 2. **All CA Pools in a Location:** To list certificates across *all* CA - * Pools in a given project and location, use the wildcard character (`-`) - * in place of the CA Pool ID. - * Example: `projects/* /locations/* /caPools/-` - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} to include - * in the response. Further - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} can - * subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For - * details on supported filters and syntax, see [Certificates Filtering - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. For details on - * supported fields and syntax, see [Certificates Sorting - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCertificatesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificatesStream( - request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, - options?: CallOptions, - ): Transform { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCertificates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificates stream %j', request); - return this.descriptors.page.listCertificates.createStream( - this.innerApiCalls.listCertificates as GaxCall, - request, - callSettings, - ); - } - - /** - * Equivalent to `listCertificates`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the parent associated with the - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates}, in the - * format `projects/* /locations/* /caPools/*`. The parent resource name can be - * in one of two forms: - * - * 1. **Specific CA Pool:** To list certificates within a single CA Pool: - * `projects/* /locations/* /caPools/*` - * - * 2. **All CA Pools in a Location:** To list certificates across *all* CA - * Pools in a given project and location, use the wildcard character (`-`) - * in place of the CA Pool ID. - * Example: `projects/* /locations/* /caPools/-` - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} to include - * in the response. Further - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} can - * subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For - * details on supported filters and syntax, see [Certificates Filtering - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. For details on - * supported fields and syntax, see [Certificates Sorting - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificate}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.list_certificates.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificates_async - */ - listCertificatesAsync( - request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest, - options?: CallOptions, - ): AsyncIterable { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCertificates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificates iterate %j', request); - return this.descriptors.page.listCertificates.asyncIterate( - this.innerApiCalls['listCertificates'] as GaxCall, - request as {}, - callSettings, - ) as AsyncIterable; - } - /** - * Lists - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} associated with the - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, - * in the format `projects/* /locations/* /caPools/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} - * to include in the response. Further - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCertificateAuthoritiesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificateAuthorities( - request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateAuthority[], - protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse, - ] - >; - listCertificateAuthorities( - request: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateAuthority - >, - ): void; - listCertificateAuthorities( - request: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateAuthority - >, - ): void; - listCertificateAuthorities( - request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateAuthority - >, - callback?: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateAuthority - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateAuthority[], - protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateAuthority - > - | undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listCertificateAuthorities values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listCertificateAuthorities request %j', request); - return this.innerApiCalls - .listCertificateAuthorities(request, options, wrappedCallback) - ?.then( - ([response, input, output]: [ - protos.google.cloud.security.privateca.v1.ICertificateAuthority[], - protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse, - ]) => { - this._log.info('listCertificateAuthorities values %j', response); - return [response, input, output]; - }, - ); - } - - /** - * Equivalent to `listCertificateAuthorities`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} associated with the - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, - * in the format `projects/* /locations/* /caPools/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} - * to include in the response. Further - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCertificateAuthoritiesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificateAuthoritiesStream( - request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, - options?: CallOptions, - ): Transform { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCertificateAuthorities']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificateAuthorities stream %j', request); - return this.descriptors.page.listCertificateAuthorities.createStream( - this.innerApiCalls.listCertificateAuthorities as GaxCall, - request, - callSettings, - ); - } - - /** - * Equivalent to `listCertificateAuthorities`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} associated with the - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, - * in the format `projects/* /locations/* /caPools/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} - * to include in the response. Further - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.list_certificate_authorities.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_async - */ - listCertificateAuthoritiesAsync( - request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest, - options?: CallOptions, - ): AsyncIterable { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCertificateAuthorities']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificateAuthorities iterate %j', request); - return this.descriptors.page.listCertificateAuthorities.asyncIterate( - this.innerApiCalls['listCertificateAuthorities'] as GaxCall, - request as {}, - callSettings, - ) as AsyncIterable; - } - /** - * Lists {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools}, in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} to include in the - * response. Further {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} can - * subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCaPoolsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCaPools( - request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICaPool[], - protos.google.cloud.security.privateca.v1.IListCaPoolsRequest | null, - protos.google.cloud.security.privateca.v1.IListCaPoolsResponse, - ] - >; - listCaPools( - request: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, - | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICaPool - >, - ): void; - listCaPools( - request: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, - | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICaPool - >, - ): void; - listCaPools( - request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, - | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICaPool - >, - callback?: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, - | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICaPool - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICaPool[], - protos.google.cloud.security.privateca.v1.IListCaPoolsRequest | null, - protos.google.cloud.security.privateca.v1.IListCaPoolsResponse, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, - | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICaPool - > - | undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listCaPools values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listCaPools request %j', request); - return this.innerApiCalls - .listCaPools(request, options, wrappedCallback) - ?.then( - ([response, input, output]: [ - protos.google.cloud.security.privateca.v1.ICaPool[], - protos.google.cloud.security.privateca.v1.IListCaPoolsRequest | null, - protos.google.cloud.security.privateca.v1.IListCaPoolsResponse, - ]) => { - this._log.info('listCaPools values %j', response); - return [response, input, output]; - }, - ); - } - - /** - * Equivalent to `listCaPools`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools}, in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} to include in the - * response. Further {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} can - * subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCaPoolsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCaPoolsStream( - request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, - options?: CallOptions, - ): Transform { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCaPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCaPools stream %j', request); - return this.descriptors.page.listCaPools.createStream( - this.innerApiCalls.listCaPools as GaxCall, - request, - callSettings, - ); - } - - /** - * Equivalent to `listCaPools`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools}, in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} to include in the - * response. Further {@link protos.google.cloud.security.privateca.v1.CaPool|CaPools} can - * subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.security.privateca.v1.CaPool|CaPool}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.list_ca_pools.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCaPools_async - */ - listCaPoolsAsync( - request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest, - options?: CallOptions, - ): AsyncIterable { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCaPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCaPools iterate %j', request); - return this.descriptors.page.listCaPools.asyncIterate( - this.innerApiCalls['listCaPools'] as GaxCall, - request as {}, - callSettings, - ) as AsyncIterable; - } - /** - * Lists - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}, - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} - * to include in the response. Further - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCertificateRevocationListsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificateRevocationLists( - request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateRevocationList[], - protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse, - ] - >; - listCertificateRevocationLists( - request: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateRevocationList - >, - ): void; - listCertificateRevocationLists( - request: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateRevocationList - >, - ): void; - listCertificateRevocationLists( - request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateRevocationList - >, - callback?: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateRevocationList - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateRevocationList[], - protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateRevocationList - > - | undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listCertificateRevocationLists values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listCertificateRevocationLists request %j', request); - return this.innerApiCalls - .listCertificateRevocationLists(request, options, wrappedCallback) - ?.then( - ([response, input, output]: [ - protos.google.cloud.security.privateca.v1.ICertificateRevocationList[], - protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse, - ]) => { - this._log.info('listCertificateRevocationLists values %j', response); - return [response, input, output]; - }, - ); - } - - /** - * Equivalent to `listCertificateRevocationLists`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}, - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} - * to include in the response. Further - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCertificateRevocationListsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificateRevocationListsStream( - request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, - options?: CallOptions, - ): Transform { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = - this._defaults['listCertificateRevocationLists']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificateRevocationLists stream %j', request); - return this.descriptors.page.listCertificateRevocationLists.createStream( - this.innerApiCalls.listCertificateRevocationLists as GaxCall, - request, - callSettings, - ); - } - - /** - * Equivalent to `listCertificateRevocationLists`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}, - * in the format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} - * to include in the response. Further - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async - */ - listCertificateRevocationListsAsync( - request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest, - options?: CallOptions, - ): AsyncIterable { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = - this._defaults['listCertificateRevocationLists']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificateRevocationLists iterate %j', request); - return this.descriptors.page.listCertificateRevocationLists.asyncIterate( - this.innerApiCalls['listCertificateRevocationLists'] as GaxCall, - request as {}, - callSettings, - ) as AsyncIterable; - } - /** - * Lists - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}, - * in the format `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} - * to include in the response. Further - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCertificateTemplatesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificateTemplates( - request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateTemplate[], - protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse, - ] - >; - listCertificateTemplates( - request: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateTemplate - >, - ): void; - listCertificateTemplates( - request: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateTemplate - >, - ): void; - listCertificateTemplates( - request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateTemplate - >, - callback?: PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateTemplate - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1.ICertificateTemplate[], - protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | PaginationCallback< - protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, - | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1.ICertificateTemplate - > - | undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listCertificateTemplates values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listCertificateTemplates request %j', request); - return this.innerApiCalls - .listCertificateTemplates(request, options, wrappedCallback) - ?.then( - ([response, input, output]: [ - protos.google.cloud.security.privateca.v1.ICertificateTemplate[], - protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest | null, - protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse, - ]) => { - this._log.info('listCertificateTemplates values %j', response); - return [response, input, output]; - }, - ); - } - - /** - * Equivalent to `listCertificateTemplates`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}, - * in the format `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} - * to include in the response. Further - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCertificateTemplatesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificateTemplatesStream( - request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, - options?: CallOptions, - ): Transform { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCertificateTemplates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificateTemplates stream %j', request); - return this.descriptors.page.listCertificateTemplates.createStream( - this.innerApiCalls.listCertificateTemplates as GaxCall, - request, - callSettings, - ); - } - - /** - * Equivalent to `listCertificateTemplates`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}, - * in the format `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} - * to include in the response. Further - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token} - * in a subsequent request. If unspecified, the server will pick an - * appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/certificate_authority_service.list_certificate_templates.js - * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_async - */ - listCertificateTemplatesAsync( - request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest, - options?: CallOptions, - ): AsyncIterable { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCertificateTemplates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificateTemplates iterate %j', request); - return this.descriptors.page.listCertificateTemplates.asyncIterate( - this.innerApiCalls['listCertificateTemplates'] as GaxCall, - request as {}, - callSettings, - ) as AsyncIterable; - } - /** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - ): Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - ): Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - - /** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - /** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions, - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - - /** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - ): Promise<[protos.google.longrunning.Operation]> { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions, - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - ): Promise { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - ): Promise { - 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'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified caPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} ca_pool - * @returns {string} Resource name string. - */ - caPoolPath(project: string, location: string, caPool: string) { - return this.pathTemplates.caPoolPathTemplate.render({ - project: project, - location: location, - ca_pool: caPool, - }); - } - - /** - * Parse the project from CaPool resource. - * - * @param {string} caPoolName - * A fully-qualified path representing CaPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCaPoolName(caPoolName: string) { - return this.pathTemplates.caPoolPathTemplate.match(caPoolName).project; - } - - /** - * Parse the location from CaPool resource. - * - * @param {string} caPoolName - * A fully-qualified path representing CaPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCaPoolName(caPoolName: string) { - return this.pathTemplates.caPoolPathTemplate.match(caPoolName).location; - } - - /** - * Parse the ca_pool from CaPool resource. - * - * @param {string} caPoolName - * A fully-qualified path representing CaPool resource. - * @returns {string} A string representing the ca_pool. - */ - matchCaPoolFromCaPoolName(caPoolName: string) { - return this.pathTemplates.caPoolPathTemplate.match(caPoolName).ca_pool; - } - - /** - * Return a fully-qualified certificate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} ca_pool - * @param {string} certificate - * @returns {string} Resource name string. - */ - certificatePath( - project: string, - location: string, - caPool: string, - certificate: string, - ) { - return this.pathTemplates.certificatePathTemplate.render({ - project: project, - location: location, - ca_pool: caPool, - certificate: certificate, - }); - } - - /** - * Parse the project from Certificate resource. - * - * @param {string} certificateName - * A fully-qualified path representing Certificate resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCertificateName(certificateName: string) { - return this.pathTemplates.certificatePathTemplate.match(certificateName) - .project; - } - - /** - * Parse the location from Certificate resource. - * - * @param {string} certificateName - * A fully-qualified path representing Certificate resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCertificateName(certificateName: string) { - return this.pathTemplates.certificatePathTemplate.match(certificateName) - .location; - } - - /** - * Parse the ca_pool from Certificate resource. - * - * @param {string} certificateName - * A fully-qualified path representing Certificate resource. - * @returns {string} A string representing the ca_pool. - */ - matchCaPoolFromCertificateName(certificateName: string) { - return this.pathTemplates.certificatePathTemplate.match(certificateName) - .ca_pool; - } - - /** - * Parse the certificate from Certificate resource. - * - * @param {string} certificateName - * A fully-qualified path representing Certificate resource. - * @returns {string} A string representing the certificate. - */ - matchCertificateFromCertificateName(certificateName: string) { - return this.pathTemplates.certificatePathTemplate.match(certificateName) - .certificate; - } - - /** - * Return a fully-qualified certificateAuthority resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} ca_pool - * @param {string} certificate_authority - * @returns {string} Resource name string. - */ - certificateAuthorityPath( - project: string, - location: string, - caPool: string, - certificateAuthority: string, - ) { - return this.pathTemplates.certificateAuthorityPathTemplate.render({ - project: project, - location: location, - ca_pool: caPool, - certificate_authority: certificateAuthority, - }); - } - - /** - * Parse the project from CertificateAuthority resource. - * - * @param {string} certificateAuthorityName - * A fully-qualified path representing CertificateAuthority resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCertificateAuthorityName(certificateAuthorityName: string) { - return this.pathTemplates.certificateAuthorityPathTemplate.match( - certificateAuthorityName, - ).project; - } - - /** - * Parse the location from CertificateAuthority resource. - * - * @param {string} certificateAuthorityName - * A fully-qualified path representing CertificateAuthority resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCertificateAuthorityName(certificateAuthorityName: string) { - return this.pathTemplates.certificateAuthorityPathTemplate.match( - certificateAuthorityName, - ).location; - } - - /** - * Parse the ca_pool from CertificateAuthority resource. - * - * @param {string} certificateAuthorityName - * A fully-qualified path representing CertificateAuthority resource. - * @returns {string} A string representing the ca_pool. - */ - matchCaPoolFromCertificateAuthorityName(certificateAuthorityName: string) { - return this.pathTemplates.certificateAuthorityPathTemplate.match( - certificateAuthorityName, - ).ca_pool; - } - - /** - * Parse the certificate_authority from CertificateAuthority resource. - * - * @param {string} certificateAuthorityName - * A fully-qualified path representing CertificateAuthority resource. - * @returns {string} A string representing the certificate_authority. - */ - matchCertificateAuthorityFromCertificateAuthorityName( - certificateAuthorityName: string, - ) { - return this.pathTemplates.certificateAuthorityPathTemplate.match( - certificateAuthorityName, - ).certificate_authority; - } - - /** - * Return a fully-qualified certificateRevocationList resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} ca_pool - * @param {string} certificate_authority - * @param {string} certificate_revocation_list - * @returns {string} Resource name string. - */ - certificateRevocationListPath( - project: string, - location: string, - caPool: string, - certificateAuthority: string, - certificateRevocationList: string, - ) { - return this.pathTemplates.certificateRevocationListPathTemplate.render({ - project: project, - location: location, - ca_pool: caPool, - certificate_authority: certificateAuthority, - certificate_revocation_list: certificateRevocationList, - }); - } - - /** - * Parse the project from CertificateRevocationList resource. - * - * @param {string} certificateRevocationListName - * A fully-qualified path representing CertificateRevocationList resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCertificateRevocationListName( - certificateRevocationListName: string, - ) { - return this.pathTemplates.certificateRevocationListPathTemplate.match( - certificateRevocationListName, - ).project; - } - - /** - * Parse the location from CertificateRevocationList resource. - * - * @param {string} certificateRevocationListName - * A fully-qualified path representing CertificateRevocationList resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCertificateRevocationListName( - certificateRevocationListName: string, - ) { - return this.pathTemplates.certificateRevocationListPathTemplate.match( - certificateRevocationListName, - ).location; - } - - /** - * Parse the ca_pool from CertificateRevocationList resource. - * - * @param {string} certificateRevocationListName - * A fully-qualified path representing CertificateRevocationList resource. - * @returns {string} A string representing the ca_pool. - */ - matchCaPoolFromCertificateRevocationListName( - certificateRevocationListName: string, - ) { - return this.pathTemplates.certificateRevocationListPathTemplate.match( - certificateRevocationListName, - ).ca_pool; - } - - /** - * Parse the certificate_authority from CertificateRevocationList resource. - * - * @param {string} certificateRevocationListName - * A fully-qualified path representing CertificateRevocationList resource. - * @returns {string} A string representing the certificate_authority. - */ - matchCertificateAuthorityFromCertificateRevocationListName( - certificateRevocationListName: string, - ) { - return this.pathTemplates.certificateRevocationListPathTemplate.match( - certificateRevocationListName, - ).certificate_authority; - } - - /** - * Parse the certificate_revocation_list from CertificateRevocationList resource. - * - * @param {string} certificateRevocationListName - * A fully-qualified path representing CertificateRevocationList resource. - * @returns {string} A string representing the certificate_revocation_list. - */ - matchCertificateRevocationListFromCertificateRevocationListName( - certificateRevocationListName: string, - ) { - return this.pathTemplates.certificateRevocationListPathTemplate.match( - certificateRevocationListName, - ).certificate_revocation_list; - } - - /** - * Return a fully-qualified certificateTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} certificate_template - * @returns {string} Resource name string. - */ - certificateTemplatePath( - project: string, - location: string, - certificateTemplate: string, - ) { - return this.pathTemplates.certificateTemplatePathTemplate.render({ - project: project, - location: location, - certificate_template: certificateTemplate, - }); - } - - /** - * Parse the project from CertificateTemplate resource. - * - * @param {string} certificateTemplateName - * A fully-qualified path representing CertificateTemplate resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCertificateTemplateName(certificateTemplateName: string) { - return this.pathTemplates.certificateTemplatePathTemplate.match( - certificateTemplateName, - ).project; - } - - /** - * Parse the location from CertificateTemplate resource. - * - * @param {string} certificateTemplateName - * A fully-qualified path representing CertificateTemplate resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCertificateTemplateName(certificateTemplateName: string) { - return this.pathTemplates.certificateTemplatePathTemplate.match( - certificateTemplateName, - ).location; - } - - /** - * Parse the certificate_template from CertificateTemplate resource. - * - * @param {string} certificateTemplateName - * A fully-qualified path representing CertificateTemplate resource. - * @returns {string} A string representing the certificate_template. - */ - matchCertificateTemplateFromCertificateTemplateName( - certificateTemplateName: string, - ) { - return this.pathTemplates.certificateTemplatePathTemplate.match( - certificateTemplateName, - ).certificate_template; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project: string, location: string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.certificateAuthorityServiceStub && !this._terminated) { - return this.certificateAuthorityServiceStub.then((stub) => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.close().catch((err) => { - throw err; - }); - this.locationsClient.close().catch((err) => { - throw err; - }); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client_config.json b/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client_config.json deleted file mode 100644 index d7847b0603f2..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_client_config.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "interfaces": { - "google.cloud.security.privateca.v1.CertificateAuthorityService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unknown_deadline_exceeded_unavailable": [ - "UNKNOWN", - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateCertificate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "GetCertificate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ListCertificates": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "RevokeCertificate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "UpdateCertificate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ActivateCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "CreateCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "DisableCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "EnableCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "FetchCertificateAuthorityCsr": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "GetCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ListCertificateAuthorities": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "UndeleteCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "DeleteCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "UpdateCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "CreateCaPool": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "UpdateCaPool": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "GetCaPool": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ListCaPools": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "DeleteCaPool": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "FetchCaCerts": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "GetCertificateRevocationList": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ListCertificateRevocationLists": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "UpdateCertificateRevocationList": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "CreateCertificateTemplate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "DeleteCertificateTemplate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "GetCertificateTemplate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ListCertificateTemplates": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "UpdateCertificateTemplate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_proto_list.json b/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_proto_list.json deleted file mode 100644 index ec340e404e82..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/src/v1/certificate_authority_service_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/cloud/security/privateca/v1/resources.proto", - "../../protos/google/cloud/security/privateca/v1/service.proto" -] diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-privateca/src/v1/gapic_metadata.json deleted file mode 100644 index dc371ea2a568..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/src/v1/gapic_metadata.json +++ /dev/null @@ -1,333 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.security.privateca.v1", - "libraryPackage": "@google-cloud/security-private-ca", - "services": { - "CertificateAuthorityService": { - "clients": { - "grpc": { - "libraryClient": "CertificateAuthorityServiceClient", - "rpcs": { - "CreateCertificate": { - "methods": [ - "createCertificate" - ] - }, - "GetCertificate": { - "methods": [ - "getCertificate" - ] - }, - "RevokeCertificate": { - "methods": [ - "revokeCertificate" - ] - }, - "UpdateCertificate": { - "methods": [ - "updateCertificate" - ] - }, - "FetchCertificateAuthorityCsr": { - "methods": [ - "fetchCertificateAuthorityCsr" - ] - }, - "GetCertificateAuthority": { - "methods": [ - "getCertificateAuthority" - ] - }, - "GetCaPool": { - "methods": [ - "getCaPool" - ] - }, - "FetchCaCerts": { - "methods": [ - "fetchCaCerts" - ] - }, - "GetCertificateRevocationList": { - "methods": [ - "getCertificateRevocationList" - ] - }, - "GetCertificateTemplate": { - "methods": [ - "getCertificateTemplate" - ] - }, - "ActivateCertificateAuthority": { - "methods": [ - "activateCertificateAuthority" - ] - }, - "CreateCertificateAuthority": { - "methods": [ - "createCertificateAuthority" - ] - }, - "DisableCertificateAuthority": { - "methods": [ - "disableCertificateAuthority" - ] - }, - "EnableCertificateAuthority": { - "methods": [ - "enableCertificateAuthority" - ] - }, - "UndeleteCertificateAuthority": { - "methods": [ - "undeleteCertificateAuthority" - ] - }, - "DeleteCertificateAuthority": { - "methods": [ - "deleteCertificateAuthority" - ] - }, - "UpdateCertificateAuthority": { - "methods": [ - "updateCertificateAuthority" - ] - }, - "CreateCaPool": { - "methods": [ - "createCaPool" - ] - }, - "UpdateCaPool": { - "methods": [ - "updateCaPool" - ] - }, - "DeleteCaPool": { - "methods": [ - "deleteCaPool" - ] - }, - "UpdateCertificateRevocationList": { - "methods": [ - "updateCertificateRevocationList" - ] - }, - "CreateCertificateTemplate": { - "methods": [ - "createCertificateTemplate" - ] - }, - "DeleteCertificateTemplate": { - "methods": [ - "deleteCertificateTemplate" - ] - }, - "UpdateCertificateTemplate": { - "methods": [ - "updateCertificateTemplate" - ] - }, - "ListCertificates": { - "methods": [ - "listCertificates", - "listCertificatesStream", - "listCertificatesAsync" - ] - }, - "ListCertificateAuthorities": { - "methods": [ - "listCertificateAuthorities", - "listCertificateAuthoritiesStream", - "listCertificateAuthoritiesAsync" - ] - }, - "ListCaPools": { - "methods": [ - "listCaPools", - "listCaPoolsStream", - "listCaPoolsAsync" - ] - }, - "ListCertificateRevocationLists": { - "methods": [ - "listCertificateRevocationLists", - "listCertificateRevocationListsStream", - "listCertificateRevocationListsAsync" - ] - }, - "ListCertificateTemplates": { - "methods": [ - "listCertificateTemplates", - "listCertificateTemplatesStream", - "listCertificateTemplatesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "CertificateAuthorityServiceClient", - "rpcs": { - "CreateCertificate": { - "methods": [ - "createCertificate" - ] - }, - "GetCertificate": { - "methods": [ - "getCertificate" - ] - }, - "RevokeCertificate": { - "methods": [ - "revokeCertificate" - ] - }, - "UpdateCertificate": { - "methods": [ - "updateCertificate" - ] - }, - "FetchCertificateAuthorityCsr": { - "methods": [ - "fetchCertificateAuthorityCsr" - ] - }, - "GetCertificateAuthority": { - "methods": [ - "getCertificateAuthority" - ] - }, - "GetCaPool": { - "methods": [ - "getCaPool" - ] - }, - "FetchCaCerts": { - "methods": [ - "fetchCaCerts" - ] - }, - "GetCertificateRevocationList": { - "methods": [ - "getCertificateRevocationList" - ] - }, - "GetCertificateTemplate": { - "methods": [ - "getCertificateTemplate" - ] - }, - "ActivateCertificateAuthority": { - "methods": [ - "activateCertificateAuthority" - ] - }, - "CreateCertificateAuthority": { - "methods": [ - "createCertificateAuthority" - ] - }, - "DisableCertificateAuthority": { - "methods": [ - "disableCertificateAuthority" - ] - }, - "EnableCertificateAuthority": { - "methods": [ - "enableCertificateAuthority" - ] - }, - "UndeleteCertificateAuthority": { - "methods": [ - "undeleteCertificateAuthority" - ] - }, - "DeleteCertificateAuthority": { - "methods": [ - "deleteCertificateAuthority" - ] - }, - "UpdateCertificateAuthority": { - "methods": [ - "updateCertificateAuthority" - ] - }, - "CreateCaPool": { - "methods": [ - "createCaPool" - ] - }, - "UpdateCaPool": { - "methods": [ - "updateCaPool" - ] - }, - "DeleteCaPool": { - "methods": [ - "deleteCaPool" - ] - }, - "UpdateCertificateRevocationList": { - "methods": [ - "updateCertificateRevocationList" - ] - }, - "CreateCertificateTemplate": { - "methods": [ - "createCertificateTemplate" - ] - }, - "DeleteCertificateTemplate": { - "methods": [ - "deleteCertificateTemplate" - ] - }, - "UpdateCertificateTemplate": { - "methods": [ - "updateCertificateTemplate" - ] - }, - "ListCertificates": { - "methods": [ - "listCertificates", - "listCertificatesStream", - "listCertificatesAsync" - ] - }, - "ListCertificateAuthorities": { - "methods": [ - "listCertificateAuthorities", - "listCertificateAuthoritiesStream", - "listCertificateAuthoritiesAsync" - ] - }, - "ListCaPools": { - "methods": [ - "listCaPools", - "listCaPoolsStream", - "listCaPoolsAsync" - ] - }, - "ListCertificateRevocationLists": { - "methods": [ - "listCertificateRevocationLists", - "listCertificateRevocationListsStream", - "listCertificateRevocationListsAsync" - ] - }, - "ListCertificateTemplates": { - "methods": [ - "listCertificateTemplates", - "listCertificateTemplatesStream", - "listCertificateTemplatesAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1/index.ts b/owl-bot-staging/google-cloud-security-privateca/src/v1/index.ts deleted file mode 100644 index 47de88d5715f..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export { CertificateAuthorityServiceClient } from './certificate_authority_service_client'; diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts deleted file mode 100644 index d55aa17ca557..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts +++ /dev/null @@ -1,4703 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type { - Callback, - CallOptions, - Descriptors, - ClientOptions, - GrpcClientOptions, - LROperation, - PaginationCallback, - GaxCall, -} from 'google-gax'; -import { Transform } from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/certificate_authority_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './certificate_authority_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthorityService|Certificate Authority Service} manages private - * certificate authorities and issued certificates. - * @class - * @memberof v1beta1 - */ -export class CertificateAuthorityServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: { [method: string]: gax.CallSettings }; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('security-private-ca'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: { [name: string]: Function }; - pathTemplates: { [name: string]: gax.PathTemplate }; - operationsClient: gax.OperationsClient; - certificateAuthorityServiceStub?: Promise<{ [name: string]: Function }>; - - /** - * Construct an instance of CertificateAuthorityServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new CertificateAuthorityServiceClient({fallback: true}, gax); - * ``` - */ - constructor( - opts?: ClientOptions, - gaxInstance?: typeof gax | typeof gax.fallback, - ) { - // Ensure that options include all the required fields. - const staticMembers = this - .constructor as typeof CertificateAuthorityServiceClient; - if ( - opts?.universe_domain && - opts?.universeDomain && - opts?.universe_domain !== opts?.universeDomain - ) { - throw new Error( - 'Please set either universe_domain or universeDomain, but not both.', - ); - } - const universeDomainEnvVar = - typeof process === 'object' && typeof process.env === 'object' - ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] - : undefined; - this._universeDomain = - opts?.universeDomain ?? - opts?.universe_domain ?? - universeDomainEnvVar ?? - 'googleapis.com'; - this._servicePath = 'privateca.' + this._universeDomain; - const servicePath = - opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!( - opts?.servicePath || opts?.apiEndpoint - ); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = - opts?.fallback ?? - (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = this._gaxGrpc.auth as gax.GoogleAuth; - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - certificatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificates/{certificate}', - ), - certificateAuthorityPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}', - ), - certificateRevocationListPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}', - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}', - ), - reusableConfigPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/reusableConfigs/{reusable_config}', - ), - }; - - // 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 = { - listCertificates: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'certificates', - ), - listCertificateAuthorities: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'certificateAuthorities', - ), - listCertificateRevocationLists: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'certificateRevocationLists', - ), - listReusableConfigs: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'reusableConfigs', - ), - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [ - { - selector: 'google.longrunning.Operations.CancelOperation', - post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', - body: '*', - }, - { - selector: 'google.longrunning.Operations.DeleteOperation', - delete: '/v1beta1/{name=projects/*/locations/*/operations/*}', - }, - { - selector: 'google.longrunning.Operations.GetOperation', - get: '/v1beta1/{name=projects/*/locations/*/operations/*}', - }, - { - selector: 'google.longrunning.Operations.ListOperations', - get: '/v1beta1/{name=projects/*/locations/*}/operations', - }, - ]; - } - this.operationsClient = this._gaxModule - .lro(lroOptions) - .operationsClient(opts); - const activateCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.CertificateAuthority', - ) as gax.protobuf.Type; - const activateCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.OperationMetadata', - ) as gax.protobuf.Type; - const createCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.CertificateAuthority', - ) as gax.protobuf.Type; - const createCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.OperationMetadata', - ) as gax.protobuf.Type; - const disableCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.CertificateAuthority', - ) as gax.protobuf.Type; - const disableCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.OperationMetadata', - ) as gax.protobuf.Type; - const enableCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.CertificateAuthority', - ) as gax.protobuf.Type; - const enableCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.OperationMetadata', - ) as gax.protobuf.Type; - const restoreCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.CertificateAuthority', - ) as gax.protobuf.Type; - const restoreCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.OperationMetadata', - ) as gax.protobuf.Type; - const scheduleDeleteCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.CertificateAuthority', - ) as gax.protobuf.Type; - const scheduleDeleteCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.OperationMetadata', - ) as gax.protobuf.Type; - const updateCertificateAuthorityResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.CertificateAuthority', - ) as gax.protobuf.Type; - const updateCertificateAuthorityMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.OperationMetadata', - ) as gax.protobuf.Type; - const updateCertificateRevocationListResponse = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.CertificateRevocationList', - ) as gax.protobuf.Type; - const updateCertificateRevocationListMetadata = protoFilesRoot.lookup( - '.google.cloud.security.privateca.v1beta1.OperationMetadata', - ) as gax.protobuf.Type; - - this.descriptors.longrunning = { - activateCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - activateCertificateAuthorityResponse.decode.bind( - activateCertificateAuthorityResponse, - ), - activateCertificateAuthorityMetadata.decode.bind( - activateCertificateAuthorityMetadata, - ), - ), - createCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createCertificateAuthorityResponse.decode.bind( - createCertificateAuthorityResponse, - ), - createCertificateAuthorityMetadata.decode.bind( - createCertificateAuthorityMetadata, - ), - ), - disableCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - disableCertificateAuthorityResponse.decode.bind( - disableCertificateAuthorityResponse, - ), - disableCertificateAuthorityMetadata.decode.bind( - disableCertificateAuthorityMetadata, - ), - ), - enableCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - enableCertificateAuthorityResponse.decode.bind( - enableCertificateAuthorityResponse, - ), - enableCertificateAuthorityMetadata.decode.bind( - enableCertificateAuthorityMetadata, - ), - ), - restoreCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restoreCertificateAuthorityResponse.decode.bind( - restoreCertificateAuthorityResponse, - ), - restoreCertificateAuthorityMetadata.decode.bind( - restoreCertificateAuthorityMetadata, - ), - ), - scheduleDeleteCertificateAuthority: - new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - scheduleDeleteCertificateAuthorityResponse.decode.bind( - scheduleDeleteCertificateAuthorityResponse, - ), - scheduleDeleteCertificateAuthorityMetadata.decode.bind( - scheduleDeleteCertificateAuthorityMetadata, - ), - ), - updateCertificateAuthority: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateCertificateAuthorityResponse.decode.bind( - updateCertificateAuthorityResponse, - ), - updateCertificateAuthorityMetadata.decode.bind( - updateCertificateAuthorityMetadata, - ), - ), - updateCertificateRevocationList: - new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateCertificateRevocationListResponse.decode.bind( - updateCertificateRevocationListResponse, - ), - updateCertificateRevocationListMetadata.decode.bind( - updateCertificateRevocationListMetadata, - ), - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.security.privateca.v1beta1.CertificateAuthorityService', - gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, - { 'x-goog-api-client': clientHeader.join(' ') }, - ); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.certificateAuthorityServiceStub) { - return this.certificateAuthorityServiceStub; - } - - // Put together the "service stub" for - // google.cloud.security.privateca.v1beta1.CertificateAuthorityService. - this.certificateAuthorityServiceStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.cloud.security.privateca.v1beta1.CertificateAuthorityService', - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.security.privateca.v1beta1 - .CertificateAuthorityService, - this._opts, - this._providedCustomServicePath, - ) as Promise<{ [method: string]: Function }>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const certificateAuthorityServiceStubMethods = [ - 'createCertificate', - 'getCertificate', - 'listCertificates', - 'revokeCertificate', - 'updateCertificate', - 'activateCertificateAuthority', - 'createCertificateAuthority', - 'disableCertificateAuthority', - 'enableCertificateAuthority', - 'fetchCertificateAuthorityCsr', - 'getCertificateAuthority', - 'listCertificateAuthorities', - 'restoreCertificateAuthority', - 'scheduleDeleteCertificateAuthority', - 'updateCertificateAuthority', - 'getCertificateRevocationList', - 'listCertificateRevocationLists', - 'updateCertificateRevocationList', - 'getReusableConfig', - 'listReusableConfigs', - ]; - for (const methodName of certificateAuthorityServiceStubMethods) { - const callPromise = this.certificateAuthorityServiceStub.then( - (stub) => - (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error | null | undefined) => () => { - throw err; - }, - ); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback, - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.certificateAuthorityServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - process.emitWarning( - 'Static servicePath is deprecated, please use the instance method instead.', - 'DeprecationWarning', - ); - } - return 'privateca.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - process.emitWarning( - 'Static apiEndpoint is deprecated, please use the instance method instead.', - 'DeprecationWarning', - ); - } - return 'privateca.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId( - callback?: Callback, - ): Promise | void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - /** - * Create a new {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} in a given Project, Location from a particular - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location and {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} - * associated with the {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}, in the format - * `projects/* /locations/* /certificateAuthorities/*`. - * @param {string} [request.certificateId] - * Optional. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the Enterprise {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier|CertificateAuthority.Tier}, - * but is optional and its value is ignored otherwise. - * @param {google.cloud.security.privateca.v1beta1.Certificate} request.certificate - * Required. A {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} with initial field values. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.create_certificate.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_async - */ - createCertificate( - request?: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest - | undefined - ), - {} | undefined, - ] - >; - createCertificate( - request: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - createCertificate( - request: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - createCertificate( - request?: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('createCertificate request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createCertificate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .createCertificate(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.ICreateCertificateRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('createCertificate response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Returns a {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The {@link protos.google.cloud.security.privateca.v1beta1.Certificate.name|name} of the {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} 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 {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.get_certificate.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_async - */ - getCertificate( - request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest - | undefined - ), - {} | undefined, - ] - >; - getCertificate( - request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificate( - request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificate( - request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('getCertificate request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCertificate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .getCertificate(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('getCertificate response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Revoke a {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} in the - * format `projects/* /locations/* /certificateAuthorities/* /certificates/*`. - * @param {google.cloud.security.privateca.v1beta1.RevocationReason} request.reason - * Required. The {@link protos.google.cloud.security.privateca.v1beta1.RevocationReason|RevocationReason} for revoking this certificate. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.revoke_certificate.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_async - */ - revokeCertificate( - request?: protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest - | undefined - ), - {} | undefined, - ] - >; - revokeCertificate( - request: protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - revokeCertificate( - request: protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - revokeCertificate( - request?: protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('revokeCertificate request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('revokeCertificate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .revokeCertificate(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.IRevokeCertificateRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('revokeCertificate response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Update a {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. Currently, the only field you can update is the - * {@link protos.google.cloud.security.privateca.v1beta1.Certificate.labels|labels} field. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.security.privateca.v1beta1.Certificate} request.certificate - * Required. {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} with updated values. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A list of fields to be updated in this request. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.update_certificate.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_async - */ - updateCertificate( - request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest - | undefined - ), - {} | undefined, - ] - >; - updateCertificate( - request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - updateCertificate( - request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - updateCertificate( - request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - 'certificate.name': request.certificate!.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('updateCertificate request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificate, - | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateCertificate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .updateCertificate(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1beta1.ICertificate, - ( - | protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('updateCertificate response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Fetch a certificate signing request (CSR) from a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} - * that is in state - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION|PENDING_ACTIVATION} and is - * of type {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE|SUBORDINATE}. The CSR must - * then be signed by the desired parent Certificate Authority, which could be - * another {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} resource, or could be an on-prem - * certificate authority. See also {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority|ActivateCertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the - * format `projects/* /locations/* /certificateAuthorities/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse|FetchCertificateAuthorityCsrResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.fetch_certificate_authority_csr.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async - */ - fetchCertificateAuthorityCsr( - request?: protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, - ( - | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest - | undefined - ), - {} | undefined, - ] - >; - fetchCertificateAuthorityCsr( - request: protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, - | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - fetchCertificateAuthorityCsr( - request: protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, - | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - fetchCertificateAuthorityCsr( - request?: protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, - | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, - | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, - ( - | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('fetchCertificateAuthorityCsr request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, - | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('fetchCertificateAuthorityCsr response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .fetchCertificateAuthorityCsr(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse, - ( - | protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('fetchCertificateAuthorityCsr response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Returns a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.name|name} of the {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} 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 {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.get_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_async - */ - getCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest - | undefined - ), - {} | undefined, - ] - >; - getCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('getCertificateAuthority request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCertificateAuthority response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .getCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateAuthorityRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('getCertificateAuthority response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Returns a {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList.name|name} of the - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList} 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 {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.get_certificate_revocation_list.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_async - */ - getCertificateRevocationList( - request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest - | undefined - ), - {} | undefined, - ] - >; - getCertificateRevocationList( - request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificateRevocationList( - request: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getCertificateRevocationList( - request?: protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('getCertificateRevocationList request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCertificateRevocationList response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .getCertificateRevocationList(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetCertificateRevocationListRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('getCertificateRevocationList response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Returns a {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfig}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The {@link protos.ReusableConfigs.name|name} of the {@link protos.|ReusableConfigs} 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 {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfig}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.get_reusable_config.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_async - */ - getReusableConfig( - request?: protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.IReusableConfig, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest - | undefined - ), - {} | undefined, - ] - >; - getReusableConfig( - request: protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.IReusableConfig, - | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getReusableConfig( - request: protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, - callback: Callback< - protos.google.cloud.security.privateca.v1beta1.IReusableConfig, - | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest - | null - | undefined, - {} | null | undefined - >, - ): void; - getReusableConfig( - request?: protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.security.privateca.v1beta1.IReusableConfig, - | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.security.privateca.v1beta1.IReusableConfig, - | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest - | null - | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.IReusableConfig, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest - | undefined - ), - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('getReusableConfig request %j', request); - const wrappedCallback: - | Callback< - protos.google.cloud.security.privateca.v1beta1.IReusableConfig, - | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getReusableConfig response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .getReusableConfig(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.cloud.security.privateca.v1beta1.IReusableConfig, - ( - | protos.google.cloud.security.privateca.v1beta1.IGetReusableConfigRequest - | undefined - ), - {} | undefined, - ]) => { - this._log.info('getReusableConfig response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - - /** - * Activate a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} that is in state - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION|PENDING_ACTIVATION} and is - * of type {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE|SUBORDINATE}. After the - * parent Certificate Authority signs a certificate signing request from - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr|FetchCertificateAuthorityCsr}, this method can complete the activation - * process. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the - * format `projects/* /locations/* /certificateAuthorities/*`. - * @param {string} request.pemCaCertificate - * Required. The signed CA certificate issued from - * {@link protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse.pem_csr|FetchCertificateAuthorityCsrResponse.pem_csr}. - * @param {google.cloud.security.privateca.v1beta1.SubordinateConfig} request.subordinateConfig - * Required. Must include information about the issuer of 'pem_ca_certificate', and any - * further issuers until the self-signed CA. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async - */ - activateCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - activateCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - activateCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - activateCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IActivateCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info( - 'activateCertificateAuthority response %j', - rawResponse, - ); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('activateCertificateAuthority request %j', request); - return this.innerApiCalls - .activateCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info( - 'activateCertificateAuthority response %j', - rawResponse, - ); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `activateCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.activate_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async - */ - async checkActivateCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - > - > { - this._log.info('activateCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.activateCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - >; - } - /** - * Create a new {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} 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 - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities}, in the format - * `projects/* /locations/*`. - * @param {string} request.certificateAuthorityId - * Required. It must be unique within a location and match the regular - * expression `[a-zA-Z0-9_-]{1,63}` - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority} request.certificateAuthority - * Required. A {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} with initial field values. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_async - */ - createCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - createCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - createCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - createCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.ICreateCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createCertificateAuthority response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createCertificateAuthority request %j', request); - return this.innerApiCalls - .createCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('createCertificateAuthority response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `createCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.create_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_async - */ - async checkCreateCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - > - > { - this._log.info('createCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.createCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - >; - } - /** - * Disable a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the - * format `projects/* /locations/* /certificateAuthorities/*`. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_async - */ - disableCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - disableCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - disableCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - disableCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IDisableCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info( - 'disableCertificateAuthority response %j', - rawResponse, - ); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('disableCertificateAuthority request %j', request); - return this.innerApiCalls - .disableCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info( - 'disableCertificateAuthority response %j', - rawResponse, - ); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `disableCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.disable_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_async - */ - async checkDisableCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - > - > { - this._log.info('disableCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.disableCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - >; - } - /** - * Enable a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the - * format `projects/* /locations/* /certificateAuthorities/*`. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_async - */ - enableCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - enableCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - enableCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - enableCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IEnableCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('enableCertificateAuthority response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('enableCertificateAuthority request %j', request); - return this.innerApiCalls - .enableCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('enableCertificateAuthority response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `enableCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.enable_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_async - */ - async checkEnableCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - > - > { - this._log.info('enableCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.enableCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - >; - } - /** - * Restore a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} that is scheduled for deletion. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the - * format `projects/* /locations/* /certificateAuthorities/*`. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_async - */ - restoreCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - restoreCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - restoreCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - restoreCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IRestoreCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info( - 'restoreCertificateAuthority response %j', - rawResponse, - ); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restoreCertificateAuthority request %j', request); - return this.innerApiCalls - .restoreCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info( - 'restoreCertificateAuthority response %j', - rawResponse, - ); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `restoreCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.restore_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_async - */ - async checkRestoreCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - > - > { - this._log.info('restoreCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.restoreCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - >; - } - /** - * Schedule a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} for deletion. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for this {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} in the - * format `projects/* /locations/* /certificateAuthorities/*`. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_async - */ - scheduleDeleteCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - scheduleDeleteCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - scheduleDeleteCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - scheduleDeleteCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IScheduleDeleteCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info( - 'scheduleDeleteCertificateAuthority response %j', - rawResponse, - ); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('scheduleDeleteCertificateAuthority request %j', request); - return this.innerApiCalls - .scheduleDeleteCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info( - 'scheduleDeleteCertificateAuthority response %j', - rawResponse, - ); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `scheduleDeleteCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.schedule_delete_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_async - */ - async checkScheduleDeleteCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - > - > { - this._log.info('scheduleDeleteCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.scheduleDeleteCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - >; - } - /** - * Update a {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.security.privateca.v1beta1.CertificateAuthority} request.certificateAuthority - * Required. {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} with updated values. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A list of fields to be updated in this request. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async - */ - updateCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - updateCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCertificateAuthority( - request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCertificateAuthority( - request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateAuthorityRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - 'certificate_authority.name': request.certificateAuthority!.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateCertificateAuthority response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateCertificateAuthority request %j', request); - return this.innerApiCalls - .updateCertificateAuthority(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('updateCertificateAuthority response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `updateCertificateAuthority()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.update_certificate_authority.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async - */ - async checkUpdateCertificateAuthorityProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - > - > { - this._log.info('updateCertificateAuthority long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.updateCertificateAuthority, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - >; - } - /** - * Update a {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.security.privateca.v1beta1.CertificateRevocationList} request.certificateRevocationList - * Required. {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList} with updated values. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A list of fields to be updated in this request. - * @param {string} [request.requestId] - * Optional. An ID to identify requests. Specify a unique request ID so that if you must - * retry your request, the server will know to ignore the request if it has - * already been completed. The server will guarantee that for at least 60 - * minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async - */ - updateCertificateRevocationList( - request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - updateCertificateRevocationList( - request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCertificateRevocationList( - request: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, - callback: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - updateCertificateRevocationList( - request?: protos.google.cloud.security.privateca.v1beta1.IUpdateCertificateRevocationListRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - 'certificate_revocation_list.name': - request.certificateRevocationList!.name ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info( - 'updateCertificateRevocationList response %j', - rawResponse, - ); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateCertificateRevocationList request %j', request); - return this.innerApiCalls - .updateCertificateRevocationList(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info( - 'updateCertificateRevocationList response %j', - rawResponse, - ); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `updateCertificateRevocationList()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.update_certificate_revocation_list.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async - */ - async checkUpdateCertificateRevocationListProgress( - name: string, - ): Promise< - LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - > - > { - this._log.info('updateCertificateRevocationList long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.updateCertificateRevocationList, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.OperationMetadata - >; - } - /** - * Lists {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates}, in the format - * `projects/* /locations/* /certificateauthorities/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} to include in the - * response. Further {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} can subsequently be obtained - * by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For details - * on supported filters and syntax, see [Certificates Filtering - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. For details on supported fields - * and syntax, see [Certificates Sorting - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCertificatesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificates( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificate[], - protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse, - ] - >; - listCertificates( - request: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificate - >, - ): void; - listCertificates( - request: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificate - >, - ): void; - listCertificates( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificate - >, - callback?: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificate - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificate[], - protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificate - > - | undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listCertificates values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listCertificates request %j', request); - return this.innerApiCalls - .listCertificates(request, options, wrappedCallback) - ?.then( - ([response, input, output]: [ - protos.google.cloud.security.privateca.v1beta1.ICertificate[], - protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListCertificatesResponse, - ]) => { - this._log.info('listCertificates values %j', response); - return [response, input, output]; - }, - ); - } - - /** - * Equivalent to `listCertificates`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates}, in the format - * `projects/* /locations/* /certificateauthorities/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} to include in the - * response. Further {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} can subsequently be obtained - * by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For details - * on supported filters and syntax, see [Certificates Filtering - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. For details on supported fields - * and syntax, see [Certificates Sorting - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCertificatesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificatesStream( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, - options?: CallOptions, - ): Transform { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCertificates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificates stream %j', request); - return this.descriptors.page.listCertificates.createStream( - this.innerApiCalls.listCertificates as GaxCall, - request, - callSettings, - ); - } - - /** - * Equivalent to `listCertificates`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates}, in the format - * `projects/* /locations/* /certificateauthorities/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} to include in the - * response. Further {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificates} can subsequently be obtained - * by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. For details - * on supported filters and syntax, see [Certificates Filtering - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. For details on supported fields - * and syntax, see [Certificates Sorting - * documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.security.privateca.v1beta1.Certificate|Certificate}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.list_certificates.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_async - */ - listCertificatesAsync( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificatesRequest, - options?: CallOptions, - ): AsyncIterable { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCertificates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificates iterate %j', request); - return this.descriptors.page.listCertificates.asyncIterate( - this.innerApiCalls['listCertificates'] as GaxCall, - request as {}, - callSettings, - ) as AsyncIterable; - } - /** - * Lists {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities}, in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} to - * include in the response. - * Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} can subsequently be - * obtained by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCertificateAuthoritiesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificateAuthorities( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[], - protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse, - ] - >; - listCertificateAuthorities( - request: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority - >, - ): void; - listCertificateAuthorities( - request: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority - >, - ): void; - listCertificateAuthorities( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority - >, - callback?: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[], - protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority - > - | undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listCertificateAuthorities values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listCertificateAuthorities request %j', request); - return this.innerApiCalls - .listCertificateAuthorities(request, options, wrappedCallback) - ?.then( - ([response, input, output]: [ - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[], - protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesResponse, - ]) => { - this._log.info('listCertificateAuthorities values %j', response); - return [response, input, output]; - }, - ); - } - - /** - * Equivalent to `listCertificateAuthorities`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities}, in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} to - * include in the response. - * Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} can subsequently be - * obtained by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCertificateAuthoritiesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificateAuthoritiesStream( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, - options?: CallOptions, - ): Transform { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCertificateAuthorities']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificateAuthorities stream %j', request); - return this.descriptors.page.listCertificateAuthorities.createStream( - this.innerApiCalls.listCertificateAuthorities as GaxCall, - request, - callSettings, - ); - } - - /** - * Equivalent to `listCertificateAuthorities`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities}, in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} to - * include in the response. - * Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthorities} can subsequently be - * obtained by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateAuthority|CertificateAuthority}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.list_certificate_authorities.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_async - */ - listCertificateAuthoritiesAsync( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateAuthoritiesRequest, - options?: CallOptions, - ): AsyncIterable { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listCertificateAuthorities']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificateAuthorities iterate %j', request); - return this.descriptors.page.listCertificateAuthorities.asyncIterate( - this.innerApiCalls['listCertificateAuthorities'] as GaxCall, - request as {}, - callSettings, - ) as AsyncIterable; - } - /** - * Lists {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists}, in the format - * `projects/* /locations/* /certificateauthorities/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} to include in the - * response. Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCertificateRevocationListsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificateRevocationLists( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[], - protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse, - ] - >; - listCertificateRevocationLists( - request: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList - >, - ): void; - listCertificateRevocationLists( - request: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList - >, - ): void; - listCertificateRevocationLists( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList - >, - callback?: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[], - protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, - | protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList - > - | undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listCertificateRevocationLists values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listCertificateRevocationLists request %j', request); - return this.innerApiCalls - .listCertificateRevocationLists(request, options, wrappedCallback) - ?.then( - ([response, input, output]: [ - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[], - protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsResponse, - ]) => { - this._log.info('listCertificateRevocationLists values %j', response); - return [response, input, output]; - }, - ); - } - - /** - * Equivalent to `listCertificateRevocationLists`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists}, in the format - * `projects/* /locations/* /certificateauthorities/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} to include in the - * response. Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCertificateRevocationListsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listCertificateRevocationListsStream( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, - options?: CallOptions, - ): Transform { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = - this._defaults['listCertificateRevocationLists']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificateRevocationLists stream %j', request); - return this.descriptors.page.listCertificateRevocationLists.createStream( - this.innerApiCalls.listCertificateRevocationLists as GaxCall, - request, - callSettings, - ); - } - - /** - * Equivalent to `listCertificateRevocationLists`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists}, in the format - * `projects/* /locations/* /certificateauthorities/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} to include in the - * response. Further {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationLists} - * can subsequently be obtained by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} in a subsequent - * request. If unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList|CertificateRevocationList}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.list_certificate_revocation_lists.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async - */ - listCertificateRevocationListsAsync( - request?: protos.google.cloud.security.privateca.v1beta1.IListCertificateRevocationListsRequest, - options?: CallOptions, - ): AsyncIterable { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = - this._defaults['listCertificateRevocationLists']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listCertificateRevocationLists iterate %j', request); - return this.descriptors.page.listCertificateRevocationLists.asyncIterate( - this.innerApiCalls['listCertificateRevocationLists'] as GaxCall, - request as {}, - callSettings, - ) as AsyncIterable; - } - /** - * Lists {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs}, in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} to include in the response. - * Further {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} can subsequently be - * obtained by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token} in a subsequent request. If - * unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfig}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listReusableConfigsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listReusableConfigs( - request?: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.IReusableConfig[], - protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse, - ] - >; - listReusableConfigs( - request: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, - | protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.IReusableConfig - >, - ): void; - listReusableConfigs( - request: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, - callback: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, - | protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.IReusableConfig - >, - ): void; - listReusableConfigs( - request?: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, - | protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.IReusableConfig - >, - callback?: PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, - | protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.IReusableConfig - >, - ): Promise< - [ - protos.google.cloud.security.privateca.v1beta1.IReusableConfig[], - protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | PaginationCallback< - protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, - | protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse - | null - | undefined, - protos.google.cloud.security.privateca.v1beta1.IReusableConfig - > - | undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listReusableConfigs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listReusableConfigs request %j', request); - return this.innerApiCalls - .listReusableConfigs(request, options, wrappedCallback) - ?.then( - ([response, input, output]: [ - protos.google.cloud.security.privateca.v1beta1.IReusableConfig[], - protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest | null, - protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsResponse, - ]) => { - this._log.info('listReusableConfigs values %j', response); - return [response, input, output]; - }, - ); - } - - /** - * Equivalent to `listReusableConfigs`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs}, in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} to include in the response. - * Further {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} can subsequently be - * obtained by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token} in a subsequent request. If - * unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfig} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listReusableConfigsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listReusableConfigsStream( - request?: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, - options?: CallOptions, - ): Transform { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listReusableConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listReusableConfigs stream %j', request); - return this.descriptors.page.listReusableConfigs.createStream( - this.innerApiCalls.listReusableConfigs as GaxCall, - request, - callSettings, - ); - } - - /** - * Equivalent to `listReusableConfigs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location associated with the - * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs}, in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Limit on the number of - * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} to include in the response. - * Further {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfigs} can subsequently be - * obtained by including the - * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token} in a subsequent request. If - * unspecified, the server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. Pagination token, returned earlier via - * {@link protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse.next_page_token|ListReusableConfigsResponse.next_page_token}. - * @param {string} [request.filter] - * Optional. Only include resources that match the filter in the response. - * @param {string} [request.orderBy] - * Optional. Specify how the results should be sorted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.security.privateca.v1beta1.ReusableConfig|ReusableConfig}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta1/certificate_authority_service.list_reusable_configs.js - * region_tag:privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_async - */ - listReusableConfigsAsync( - request?: protos.google.cloud.security.privateca.v1beta1.IListReusableConfigsRequest, - options?: CallOptions, - ): AsyncIterable { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listReusableConfigs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listReusableConfigs iterate %j', request); - return this.descriptors.page.listReusableConfigs.asyncIterate( - this.innerApiCalls['listReusableConfigs'] as GaxCall, - request as {}, - callSettings, - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified certificate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} certificate_authority - * @param {string} certificate - * @returns {string} Resource name string. - */ - certificatePath( - project: string, - location: string, - certificateAuthority: string, - certificate: string, - ) { - return this.pathTemplates.certificatePathTemplate.render({ - project: project, - location: location, - certificate_authority: certificateAuthority, - certificate: certificate, - }); - } - - /** - * Parse the project from Certificate resource. - * - * @param {string} certificateName - * A fully-qualified path representing Certificate resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCertificateName(certificateName: string) { - return this.pathTemplates.certificatePathTemplate.match(certificateName) - .project; - } - - /** - * Parse the location from Certificate resource. - * - * @param {string} certificateName - * A fully-qualified path representing Certificate resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCertificateName(certificateName: string) { - return this.pathTemplates.certificatePathTemplate.match(certificateName) - .location; - } - - /** - * Parse the certificate_authority from Certificate resource. - * - * @param {string} certificateName - * A fully-qualified path representing Certificate resource. - * @returns {string} A string representing the certificate_authority. - */ - matchCertificateAuthorityFromCertificateName(certificateName: string) { - return this.pathTemplates.certificatePathTemplate.match(certificateName) - .certificate_authority; - } - - /** - * Parse the certificate from Certificate resource. - * - * @param {string} certificateName - * A fully-qualified path representing Certificate resource. - * @returns {string} A string representing the certificate. - */ - matchCertificateFromCertificateName(certificateName: string) { - return this.pathTemplates.certificatePathTemplate.match(certificateName) - .certificate; - } - - /** - * Return a fully-qualified certificateAuthority resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} certificate_authority - * @returns {string} Resource name string. - */ - certificateAuthorityPath( - project: string, - location: string, - certificateAuthority: string, - ) { - return this.pathTemplates.certificateAuthorityPathTemplate.render({ - project: project, - location: location, - certificate_authority: certificateAuthority, - }); - } - - /** - * Parse the project from CertificateAuthority resource. - * - * @param {string} certificateAuthorityName - * A fully-qualified path representing CertificateAuthority resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCertificateAuthorityName(certificateAuthorityName: string) { - return this.pathTemplates.certificateAuthorityPathTemplate.match( - certificateAuthorityName, - ).project; - } - - /** - * Parse the location from CertificateAuthority resource. - * - * @param {string} certificateAuthorityName - * A fully-qualified path representing CertificateAuthority resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCertificateAuthorityName(certificateAuthorityName: string) { - return this.pathTemplates.certificateAuthorityPathTemplate.match( - certificateAuthorityName, - ).location; - } - - /** - * Parse the certificate_authority from CertificateAuthority resource. - * - * @param {string} certificateAuthorityName - * A fully-qualified path representing CertificateAuthority resource. - * @returns {string} A string representing the certificate_authority. - */ - matchCertificateAuthorityFromCertificateAuthorityName( - certificateAuthorityName: string, - ) { - return this.pathTemplates.certificateAuthorityPathTemplate.match( - certificateAuthorityName, - ).certificate_authority; - } - - /** - * Return a fully-qualified certificateRevocationList resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} certificate_authority - * @param {string} certificate_revocation_list - * @returns {string} Resource name string. - */ - certificateRevocationListPath( - project: string, - location: string, - certificateAuthority: string, - certificateRevocationList: string, - ) { - return this.pathTemplates.certificateRevocationListPathTemplate.render({ - project: project, - location: location, - certificate_authority: certificateAuthority, - certificate_revocation_list: certificateRevocationList, - }); - } - - /** - * Parse the project from CertificateRevocationList resource. - * - * @param {string} certificateRevocationListName - * A fully-qualified path representing CertificateRevocationList resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCertificateRevocationListName( - certificateRevocationListName: string, - ) { - return this.pathTemplates.certificateRevocationListPathTemplate.match( - certificateRevocationListName, - ).project; - } - - /** - * Parse the location from CertificateRevocationList resource. - * - * @param {string} certificateRevocationListName - * A fully-qualified path representing CertificateRevocationList resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCertificateRevocationListName( - certificateRevocationListName: string, - ) { - return this.pathTemplates.certificateRevocationListPathTemplate.match( - certificateRevocationListName, - ).location; - } - - /** - * Parse the certificate_authority from CertificateRevocationList resource. - * - * @param {string} certificateRevocationListName - * A fully-qualified path representing CertificateRevocationList resource. - * @returns {string} A string representing the certificate_authority. - */ - matchCertificateAuthorityFromCertificateRevocationListName( - certificateRevocationListName: string, - ) { - return this.pathTemplates.certificateRevocationListPathTemplate.match( - certificateRevocationListName, - ).certificate_authority; - } - - /** - * Parse the certificate_revocation_list from CertificateRevocationList resource. - * - * @param {string} certificateRevocationListName - * A fully-qualified path representing CertificateRevocationList resource. - * @returns {string} A string representing the certificate_revocation_list. - */ - matchCertificateRevocationListFromCertificateRevocationListName( - certificateRevocationListName: string, - ) { - return this.pathTemplates.certificateRevocationListPathTemplate.match( - certificateRevocationListName, - ).certificate_revocation_list; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project: string, location: string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified reusableConfig resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} reusable_config - * @returns {string} Resource name string. - */ - reusableConfigPath( - project: string, - location: string, - reusableConfig: string, - ) { - return this.pathTemplates.reusableConfigPathTemplate.render({ - project: project, - location: location, - reusable_config: reusableConfig, - }); - } - - /** - * Parse the project from ReusableConfig resource. - * - * @param {string} reusableConfigName - * A fully-qualified path representing ReusableConfig resource. - * @returns {string} A string representing the project. - */ - matchProjectFromReusableConfigName(reusableConfigName: string) { - return this.pathTemplates.reusableConfigPathTemplate.match( - reusableConfigName, - ).project; - } - - /** - * Parse the location from ReusableConfig resource. - * - * @param {string} reusableConfigName - * A fully-qualified path representing ReusableConfig resource. - * @returns {string} A string representing the location. - */ - matchLocationFromReusableConfigName(reusableConfigName: string) { - return this.pathTemplates.reusableConfigPathTemplate.match( - reusableConfigName, - ).location; - } - - /** - * Parse the reusable_config from ReusableConfig resource. - * - * @param {string} reusableConfigName - * A fully-qualified path representing ReusableConfig resource. - * @returns {string} A string representing the reusable_config. - */ - matchReusableConfigFromReusableConfigName(reusableConfigName: string) { - return this.pathTemplates.reusableConfigPathTemplate.match( - reusableConfigName, - ).reusable_config; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.certificateAuthorityServiceStub && !this._terminated) { - return this.certificateAuthorityServiceStub.then((stub) => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client_config.json b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client_config.json deleted file mode 100644 index 76b91dd1bea6..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client_config.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "interfaces": { - "google.cloud.security.privateca.v1beta1.CertificateAuthorityService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unknown_deadline_exceeded_unavailable": [ - "UNKNOWN", - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateCertificate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "GetCertificate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ListCertificates": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "RevokeCertificate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "UpdateCertificate": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ActivateCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "CreateCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "DisableCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "EnableCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "FetchCertificateAuthorityCsr": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "GetCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ListCertificateAuthorities": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "RestoreCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ScheduleDeleteCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "UpdateCertificateAuthority": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "GetCertificateRevocationList": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ListCertificateRevocationLists": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "UpdateCertificateRevocationList": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "GetReusableConfig": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - }, - "ListReusableConfigs": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_deadline_exceeded_unavailable", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_proto_list.json b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_proto_list.json deleted file mode 100644 index 746af9091f33..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/cloud/security/privateca/v1beta1/resources.proto", - "../../protos/google/cloud/security/privateca/v1beta1/service.proto" -] diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/gapic_metadata.json deleted file mode 100644 index 79c7f392e86f..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.security.privateca.v1beta1", - "libraryPackage": "@google-cloud/security-private-ca", - "services": { - "CertificateAuthorityService": { - "clients": { - "grpc": { - "libraryClient": "CertificateAuthorityServiceClient", - "rpcs": { - "CreateCertificate": { - "methods": [ - "createCertificate" - ] - }, - "GetCertificate": { - "methods": [ - "getCertificate" - ] - }, - "RevokeCertificate": { - "methods": [ - "revokeCertificate" - ] - }, - "UpdateCertificate": { - "methods": [ - "updateCertificate" - ] - }, - "FetchCertificateAuthorityCsr": { - "methods": [ - "fetchCertificateAuthorityCsr" - ] - }, - "GetCertificateAuthority": { - "methods": [ - "getCertificateAuthority" - ] - }, - "GetCertificateRevocationList": { - "methods": [ - "getCertificateRevocationList" - ] - }, - "GetReusableConfig": { - "methods": [ - "getReusableConfig" - ] - }, - "ActivateCertificateAuthority": { - "methods": [ - "activateCertificateAuthority" - ] - }, - "CreateCertificateAuthority": { - "methods": [ - "createCertificateAuthority" - ] - }, - "DisableCertificateAuthority": { - "methods": [ - "disableCertificateAuthority" - ] - }, - "EnableCertificateAuthority": { - "methods": [ - "enableCertificateAuthority" - ] - }, - "RestoreCertificateAuthority": { - "methods": [ - "restoreCertificateAuthority" - ] - }, - "ScheduleDeleteCertificateAuthority": { - "methods": [ - "scheduleDeleteCertificateAuthority" - ] - }, - "UpdateCertificateAuthority": { - "methods": [ - "updateCertificateAuthority" - ] - }, - "UpdateCertificateRevocationList": { - "methods": [ - "updateCertificateRevocationList" - ] - }, - "ListCertificates": { - "methods": [ - "listCertificates", - "listCertificatesStream", - "listCertificatesAsync" - ] - }, - "ListCertificateAuthorities": { - "methods": [ - "listCertificateAuthorities", - "listCertificateAuthoritiesStream", - "listCertificateAuthoritiesAsync" - ] - }, - "ListCertificateRevocationLists": { - "methods": [ - "listCertificateRevocationLists", - "listCertificateRevocationListsStream", - "listCertificateRevocationListsAsync" - ] - }, - "ListReusableConfigs": { - "methods": [ - "listReusableConfigs", - "listReusableConfigsStream", - "listReusableConfigsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "CertificateAuthorityServiceClient", - "rpcs": { - "CreateCertificate": { - "methods": [ - "createCertificate" - ] - }, - "GetCertificate": { - "methods": [ - "getCertificate" - ] - }, - "RevokeCertificate": { - "methods": [ - "revokeCertificate" - ] - }, - "UpdateCertificate": { - "methods": [ - "updateCertificate" - ] - }, - "FetchCertificateAuthorityCsr": { - "methods": [ - "fetchCertificateAuthorityCsr" - ] - }, - "GetCertificateAuthority": { - "methods": [ - "getCertificateAuthority" - ] - }, - "GetCertificateRevocationList": { - "methods": [ - "getCertificateRevocationList" - ] - }, - "GetReusableConfig": { - "methods": [ - "getReusableConfig" - ] - }, - "ActivateCertificateAuthority": { - "methods": [ - "activateCertificateAuthority" - ] - }, - "CreateCertificateAuthority": { - "methods": [ - "createCertificateAuthority" - ] - }, - "DisableCertificateAuthority": { - "methods": [ - "disableCertificateAuthority" - ] - }, - "EnableCertificateAuthority": { - "methods": [ - "enableCertificateAuthority" - ] - }, - "RestoreCertificateAuthority": { - "methods": [ - "restoreCertificateAuthority" - ] - }, - "ScheduleDeleteCertificateAuthority": { - "methods": [ - "scheduleDeleteCertificateAuthority" - ] - }, - "UpdateCertificateAuthority": { - "methods": [ - "updateCertificateAuthority" - ] - }, - "UpdateCertificateRevocationList": { - "methods": [ - "updateCertificateRevocationList" - ] - }, - "ListCertificates": { - "methods": [ - "listCertificates", - "listCertificatesStream", - "listCertificatesAsync" - ] - }, - "ListCertificateAuthorities": { - "methods": [ - "listCertificateAuthorities", - "listCertificateAuthoritiesStream", - "listCertificateAuthoritiesAsync" - ] - }, - "ListCertificateRevocationLists": { - "methods": [ - "listCertificateRevocationLists", - "listCertificateRevocationListsStream", - "listCertificateRevocationListsAsync" - ] - }, - "ListReusableConfigs": { - "methods": [ - "listReusableConfigs", - "listReusableConfigsStream", - "listReusableConfigsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/index.ts b/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/index.ts deleted file mode 100644 index 47de88d5715f..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/src/v1beta1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export { CertificateAuthorityServiceClient } from './certificate_authority_service_client'; diff --git a/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 1f15aaa53805..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const privateca = require('@google-cloud/security-private-ca'); - -function main() { - const certificateAuthorityServiceClient = new privateca.CertificateAuthorityServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 8a0f1aa9f773..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2026 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 { CertificateAuthorityServiceClient } from '@google-cloud/security-private-ca'; - -// check that the client class type name can be used -function doStuffWithCertificateAuthorityServiceClient( - client: CertificateAuthorityServiceClient, -) { - client.close(); -} - -function main() { - // check that the client instance can be created - const certificateAuthorityServiceClient = - new CertificateAuthorityServiceClient(); - doStuffWithCertificateAuthorityServiceClient( - certificateAuthorityServiceClient, - ); -} - -main(); diff --git a/owl-bot-staging/google-cloud-security-privateca/system-test/install.ts b/owl-bot-staging/google-cloud-security-privateca/system-test/install.ts deleted file mode 100644 index ccf167042d2e..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/system-test/install.ts +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import { packNTest } from 'pack-n-play'; -import { readFileSync } from 'fs'; -import { describe, it } from 'mocha'; - -describe('📦 pack-n-play test', () => { - it('TypeScript code', async function () { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync( - './system-test/fixtures/sample/src/index.ts', - ).toString(), - }, - }; - await packNTest(options); - }); - - it('JavaScript code', async function () { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - cjs: readFileSync( - './system-test/fixtures/sample/src/index.js', - ).toString(), - }, - }; - await packNTest(options); - }); -}); diff --git a/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1.ts b/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1.ts deleted file mode 100644 index 49fc8508f424..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1.ts +++ /dev/null @@ -1,8138 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import { SinonStub } from 'sinon'; -import { describe, it } from 'mocha'; -import * as certificateauthorityserviceModule from '../src'; - -import { PassThrough } from 'stream'; - -import { - protobuf, - LROperation, - operationsProtos, - IamProtos, - LocationProtos, -} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON( - require('../protos/protos.json'), -).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = ( - instance.constructor as typeof protobuf.Message - ).toObject(instance as protobuf.Message, { defaults: true }); - return (instance.constructor as typeof protobuf.Message).fromObject( - filledObject, - ) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error - ? sinon.stub().rejects(error) - : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback( - response?: ResponseType, - error?: Error, -) { - return error - ? sinon.stub().callsArgWith(2, error) - : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall( - response?: ResponseType, - callError?: Error, - lroError?: Error, -) { - const innerStub = lroError - ? sinon.stub().rejects(lroError) - : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError - ? sinon.stub().rejects(callError) - : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback( - response?: ResponseType, - callError?: Error, - lroError?: Error, -) { - const innerStub = lroError - ? sinon.stub().rejects(lroError) - : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError - ? sinon.stub().callsArgWith(2, callError) - : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall( - responses?: ResponseType[], - error?: Error, -) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error - ? sinon.stub().callsArgWith(2, error) - : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { - mockStream.write({}); - }); - } - setImmediate(() => { - mockStream.end(); - }); - } else { - setImmediate(() => { - mockStream.write({}); - }); - setImmediate(() => { - mockStream.end(); - }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall( - responses?: ResponseType[], - error?: Error, -) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({ done: true, value: undefined }); - } - return Promise.resolve({ done: false, value: responses![counter++] }); - }, - }; - }, - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.CertificateAuthorityServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'privateca.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, 'googleapis.com'); - }); - - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = - certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient - .servicePath; - assert.strictEqual(servicePath, 'privateca.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = - certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient - .apiEndpoint; - assert.strictEqual(apiEndpoint, 'privateca.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { universeDomain: 'example.com' }, - ); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'privateca.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { universe_domain: 'example.com' }, - ); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'privateca.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'privateca.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { universeDomain: 'configured.example.com' }, - ); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'privateca.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { universe_domain: 'example.com', universeDomain: 'example.net' }, - ); - }); - }); - - it('has port', () => { - const port = - certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient - .port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - fallback: true, - }, - ); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - assert.strictEqual(client.certificateAuthorityServiceStub, undefined); - await client.initialize(); - assert(client.certificateAuthorityServiceStub); - }); - - it('has close method for the initialized client', (done) => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - client.initialize().catch((err) => { - throw err; - }); - assert(client.certificateAuthorityServiceStub); - client - .close() - .then(() => { - done(); - }) - .catch((err) => { - throw err; - }); - }); - - it('has close method for the non-initialized client', (done) => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - assert.strictEqual(client.certificateAuthorityServiceStub, undefined); - client - .close() - .then(() => { - done(); - }) - .catch((err) => { - throw err; - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('createCertificate', () => { - it('invokes createCertificate without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ); - client.innerApiCalls.createCertificate = stubSimpleCall(expectedResponse); - const [response] = await client.createCertificate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ); - client.innerApiCalls.createCertificate = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCertificate( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1.ICertificate | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificate with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCertificate = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.createCertificate(request), expectedError); - const actualRequest = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificate with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.createCertificate(request), expectedError); - }); - }); - - describe('getCertificate', () => { - it('invokes getCertificate without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ); - client.innerApiCalls.getCertificate = stubSimpleCall(expectedResponse); - const [response] = await client.getCertificate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ); - client.innerApiCalls.getCertificate = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCertificate( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1.ICertificate | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificate with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCertificate = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.getCertificate(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificate with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.getCertificate(request), expectedError); - }); - }); - - describe('revokeCertificate', () => { - it('invokes revokeCertificate without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.RevokeCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.RevokeCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ); - client.innerApiCalls.revokeCertificate = stubSimpleCall(expectedResponse); - const [response] = await client.revokeCertificate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes revokeCertificate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.RevokeCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.RevokeCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ); - client.innerApiCalls.revokeCertificate = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.revokeCertificate( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1.ICertificate | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes revokeCertificate with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.RevokeCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.RevokeCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.revokeCertificate = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.revokeCertificate(request), expectedError); - const actualRequest = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes revokeCertificate with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.RevokeCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.RevokeCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.revokeCertificate(request), expectedError); - }); - }); - - describe('updateCertificate', () => { - it('invokes updateCertificate without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateRequest(), - ); - request.certificate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateRequest', - ['certificate', 'name'], - ); - request.certificate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ); - client.innerApiCalls.updateCertificate = stubSimpleCall(expectedResponse); - const [response] = await client.updateCertificate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateRequest(), - ); - request.certificate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateRequest', - ['certificate', 'name'], - ); - request.certificate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ); - client.innerApiCalls.updateCertificate = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCertificate( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1.ICertificate | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificate with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateRequest(), - ); - request.certificate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateRequest', - ['certificate', 'name'], - ); - request.certificate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificate = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.updateCertificate(request), expectedError); - const actualRequest = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificate with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateRequest(), - ); - request.certificate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateRequest', - ['certificate', 'name'], - ); - request.certificate.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.updateCertificate(request), expectedError); - }); - }); - - describe('fetchCertificateAuthorityCsr', () => { - it('invokes fetchCertificateAuthorityCsr without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse(), - ); - client.innerApiCalls.fetchCertificateAuthorityCsr = - stubSimpleCall(expectedResponse); - const [response] = await client.fetchCertificateAuthorityCsr(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchCertificateAuthorityCsr without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse(), - ); - client.innerApiCalls.fetchCertificateAuthorityCsr = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchCertificateAuthorityCsr( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchCertificateAuthorityCsr with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchCertificateAuthorityCsr = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.fetchCertificateAuthorityCsr(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchCertificateAuthorityCsr with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects( - client.fetchCertificateAuthorityCsr(request), - expectedError, - ); - }); - }); - - describe('getCertificateAuthority', () => { - it('invokes getCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ); - client.innerApiCalls.getCertificateAuthority = - stubSimpleCall(expectedResponse); - const [response] = await client.getCertificateAuthority(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ); - client.innerApiCalls.getCertificateAuthority = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCertificateAuthority( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1.ICertificateAuthority | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateAuthority with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCertificateAuthority = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.getCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateAuthority with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects( - client.getCertificateAuthority(request), - expectedError, - ); - }); - }); - - describe('getCaPool', () => { - it('invokes getCaPool without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCaPoolRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ); - client.innerApiCalls.getCaPool = stubSimpleCall(expectedResponse); - const [response] = await client.getCaPool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCaPool without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCaPoolRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ); - client.innerApiCalls.getCaPool = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCaPool( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1.ICaPool | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCaPool with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCaPoolRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCaPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCaPool(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCaPool with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCaPoolRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.getCaPool(request), expectedError); - }); - }); - - describe('fetchCaCerts', () => { - it('invokes fetchCaCerts without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCaCertsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.FetchCaCertsRequest', - ['caPool'], - ); - request.caPool = defaultValue1; - const expectedHeaderRequestParams = `ca_pool=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCaCertsResponse(), - ); - client.innerApiCalls.fetchCaCerts = stubSimpleCall(expectedResponse); - const [response] = await client.fetchCaCerts(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.fetchCaCerts as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.fetchCaCerts as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchCaCerts without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCaCertsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.FetchCaCertsRequest', - ['caPool'], - ); - request.caPool = defaultValue1; - const expectedHeaderRequestParams = `ca_pool=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCaCertsResponse(), - ); - client.innerApiCalls.fetchCaCerts = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchCaCerts( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.fetchCaCerts as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.fetchCaCerts as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchCaCerts with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCaCertsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.FetchCaCertsRequest', - ['caPool'], - ); - request.caPool = defaultValue1; - const expectedHeaderRequestParams = `ca_pool=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchCaCerts = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.fetchCaCerts(request), expectedError); - const actualRequest = ( - client.innerApiCalls.fetchCaCerts as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.fetchCaCerts as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchCaCerts with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.FetchCaCertsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.FetchCaCertsRequest', - ['caPool'], - ); - request.caPool = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.fetchCaCerts(request), expectedError); - }); - }); - - describe('getCertificateRevocationList', () => { - it('invokes getCertificateRevocationList without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ); - client.innerApiCalls.getCertificateRevocationList = - stubSimpleCall(expectedResponse); - const [response] = await client.getCertificateRevocationList(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateRevocationList without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ); - client.innerApiCalls.getCertificateRevocationList = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCertificateRevocationList( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1.ICertificateRevocationList | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateRevocationList with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCertificateRevocationList = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.getCertificateRevocationList(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateRevocationList with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects( - client.getCertificateRevocationList(request), - expectedError, - ); - }); - }); - - describe('getCertificateTemplate', () => { - it('invokes getCertificateTemplate without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateTemplateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ); - client.innerApiCalls.getCertificateTemplate = - stubSimpleCall(expectedResponse); - const [response] = await client.getCertificateTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateTemplate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateTemplateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ); - client.innerApiCalls.getCertificateTemplate = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCertificateTemplate( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1.ICertificateTemplate | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateTemplate with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateTemplateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCertificateTemplate = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.getCertificateTemplate(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.getCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateTemplate with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.GetCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.GetCertificateTemplateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects( - client.getCertificateTemplate(request), - expectedError, - ); - }); - }); - - describe('activateCertificateAuthority', () => { - it('invokes activateCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.activateCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.activateCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes activateCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.activateCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.activateCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes activateCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.activateCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.activateCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes activateCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.activateCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.activateCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkActivateCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkActivateCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkActivateCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkActivateCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('createCertificateAuthority', () => { - it('invokes createCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.createCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.createCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.createCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.createCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.createCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkCreateCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkCreateCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('disableCertificateAuthority', () => { - it('invokes disableCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.disableCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.disableCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.disableCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.disableCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.disableCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.disableCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.disableCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.disableCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDisableCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkDisableCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDisableCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkDisableCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('enableCertificateAuthority', () => { - it('invokes enableCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.enableCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.enableCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.enableCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.enableCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.enableCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.enableCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.enableCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.enableCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkEnableCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkEnableCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkEnableCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkEnableCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('undeleteCertificateAuthority', () => { - it('invokes undeleteCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.undeleteCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.undeleteCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.undeleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.undeleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeleteCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.undeleteCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.undeleteCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.undeleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.undeleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeleteCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeleteCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.undeleteCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.undeleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.undeleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeleteCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeleteCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.undeleteCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.undeleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.undeleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUndeleteCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkUndeleteCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUndeleteCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkUndeleteCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('deleteCertificateAuthority', () => { - it('invokes deleteCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.deleteCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.deleteCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.deleteCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.deleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.deleteCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkDeleteCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkDeleteCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('updateCertificateAuthority', () => { - it('invokes updateCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(), - ); - request.certificateAuthority ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest', - ['certificateAuthority', 'name'], - ); - request.certificateAuthority.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(), - ); - request.certificateAuthority ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest', - ['certificateAuthority', 'name'], - ); - request.certificateAuthority.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(), - ); - request.certificateAuthority ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest', - ['certificateAuthority', 'name'], - ); - request.certificateAuthority.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.updateCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest(), - ); - request.certificateAuthority ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest', - ['certificateAuthority', 'name'], - ); - request.certificateAuthority.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.updateCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkUpdateCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkUpdateCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('createCaPool', () => { - it('invokes createCaPool without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCaPoolRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.createCaPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.createCaPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCaPool without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCaPoolRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.createCaPool = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCaPool( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCaPool with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCaPoolRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCaPool = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects(client.createCaPool(request), expectedError); - const actualRequest = ( - client.innerApiCalls.createCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCaPool with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCaPoolRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCaPool = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.createCaPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.createCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateCaPoolProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateCaPoolProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateCaPoolProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.checkCreateCaPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('updateCaPool', () => { - it('invokes updateCaPool without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCaPoolRequest(), - ); - request.caPool ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCaPoolRequest', - ['caPool', 'name'], - ); - request.caPool.name = defaultValue1; - const expectedHeaderRequestParams = `ca_pool.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCaPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCaPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCaPool without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCaPoolRequest(), - ); - request.caPool ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCaPoolRequest', - ['caPool', 'name'], - ); - request.caPool.name = defaultValue1; - const expectedHeaderRequestParams = `ca_pool.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCaPool = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCaPool( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICaPool, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCaPool with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCaPoolRequest(), - ); - request.caPool ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCaPoolRequest', - ['caPool', 'name'], - ); - request.caPool.name = defaultValue1; - const expectedHeaderRequestParams = `ca_pool.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCaPool = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects(client.updateCaPool(request), expectedError); - const actualRequest = ( - client.innerApiCalls.updateCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCaPool with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCaPoolRequest(), - ); - request.caPool ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCaPoolRequest', - ['caPool', 'name'], - ); - request.caPool.name = defaultValue1; - const expectedHeaderRequestParams = `ca_pool.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCaPool = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.updateCaPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.updateCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateCaPoolProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateCaPoolProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateCaPoolProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.checkUpdateCaPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('deleteCaPool', () => { - it('invokes deleteCaPool without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCaPoolRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.deleteCaPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCaPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCaPool without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCaPoolRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.deleteCaPool = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCaPool( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCaPool with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCaPoolRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCaPool = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects(client.deleteCaPool(request), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCaPool with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCaPoolRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCaPoolRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCaPool = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.deleteCaPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteCaPool as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCaPool as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteCaPoolProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteCaPoolProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteCaPoolProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.checkDeleteCaPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('updateCertificateRevocationList', () => { - it('invokes updateCertificateRevocationList without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(), - ); - request.certificateRevocationList ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest', - ['certificateRevocationList', 'name'], - ); - request.certificateRevocationList.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCertificateRevocationList = - stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCertificateRevocationList(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateRevocationList without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(), - ); - request.certificateRevocationList ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest', - ['certificateRevocationList', 'name'], - ); - request.certificateRevocationList.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCertificateRevocationList = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCertificateRevocationList( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateRevocationList with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(), - ); - request.certificateRevocationList ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest', - ['certificateRevocationList', 'name'], - ); - request.certificateRevocationList.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificateRevocationList = - stubLongRunningCall(undefined, expectedError); - await assert.rejects( - client.updateCertificateRevocationList(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateRevocationList with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest(), - ); - request.certificateRevocationList ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest', - ['certificateRevocationList', 'name'], - ); - request.certificateRevocationList.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificateRevocationList = - stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateCertificateRevocationList(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateCertificateRevocationListProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkUpdateCertificateRevocationListProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateCertificateRevocationListProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkUpdateCertificateRevocationListProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('createCertificateTemplate', () => { - it('invokes createCertificateTemplate without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.createCertificateTemplate = - stubLongRunningCall(expectedResponse); - const [operation] = await client.createCertificateTemplate(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificateTemplate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.createCertificateTemplate = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCertificateTemplate( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificateTemplate with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCertificateTemplate = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.createCertificateTemplate(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.createCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificateTemplate with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCertificateTemplate = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.createCertificateTemplate(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.createCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateCertificateTemplateProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkCreateCertificateTemplateProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateCertificateTemplateProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkCreateCertificateTemplateProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('deleteCertificateTemplate', () => { - it('invokes deleteCertificateTemplate without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.deleteCertificateTemplate = - stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCertificateTemplate(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCertificateTemplate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.deleteCertificateTemplate = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCertificateTemplate( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCertificateTemplate with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCertificateTemplate = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.deleteCertificateTemplate(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.deleteCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCertificateTemplate with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCertificateTemplate = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.deleteCertificateTemplate(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteCertificateTemplateProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkDeleteCertificateTemplateProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteCertificateTemplateProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkDeleteCertificateTemplateProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('updateCertificateTemplate', () => { - it('invokes updateCertificateTemplate without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(), - ); - request.certificateTemplate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest', - ['certificateTemplate', 'name'], - ); - request.certificateTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_template.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCertificateTemplate = - stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCertificateTemplate(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateTemplate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(), - ); - request.certificateTemplate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest', - ['certificateTemplate', 'name'], - ); - request.certificateTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_template.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCertificateTemplate = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCertificateTemplate( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1.ICertificateTemplate, - protos.google.cloud.security.privateca.v1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateTemplate with call error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(), - ); - request.certificateTemplate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest', - ['certificateTemplate', 'name'], - ); - request.certificateTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_template.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificateTemplate = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.updateCertificateTemplate(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.updateCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateTemplate with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest(), - ); - request.certificateTemplate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest', - ['certificateTemplate', 'name'], - ); - request.certificateTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_template.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificateTemplate = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.updateCertificateTemplate(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.updateCertificateTemplate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateTemplate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateCertificateTemplateProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkUpdateCertificateTemplateProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateCertificateTemplateProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkUpdateCertificateTemplateProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('listCertificates', () => { - it('invokes listCertificates without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - ]; - client.innerApiCalls.listCertificates = stubSimpleCall(expectedResponse); - const [response] = await client.listCertificates(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificates without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - ]; - client.innerApiCalls.listCertificates = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCertificates( - request, - ( - err?: Error | null, - result?: - | protos.google.cloud.security.privateca.v1.ICertificate[] - | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificates with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCertificates = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.listCertificates(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificatesStream without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - ]; - client.descriptors.page.listCertificates.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listCertificatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1.Certificate[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.security.privateca.v1.Certificate) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - (client.descriptors.page.listCertificates.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listCertificates, request), - ); - assert( - (client.descriptors.page.listCertificates.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('invokes listCertificatesStream with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificates.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listCertificatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1.Certificate[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.security.privateca.v1.Certificate) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listCertificates.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listCertificates, request), - ); - assert( - (client.descriptors.page.listCertificates.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('uses async iteration with listCertificates without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.Certificate(), - ), - ]; - client.descriptors.page.listCertificates.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.security.privateca.v1.ICertificate[] = - []; - const iterable = client.listCertificatesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificates.asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - (client.descriptors.page.listCertificates.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('uses async iteration with listCertificates with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificates.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCertificatesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.security.privateca.v1.ICertificate[] = - []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificates.asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - (client.descriptors.page.listCertificates.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - }); - - describe('listCertificateAuthorities', () => { - it('invokes listCertificateAuthorities without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - ]; - client.innerApiCalls.listCertificateAuthorities = - stubSimpleCall(expectedResponse); - const [response] = await client.listCertificateAuthorities(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateAuthorities without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - ]; - client.innerApiCalls.listCertificateAuthorities = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCertificateAuthorities( - request, - ( - err?: Error | null, - result?: - | protos.google.cloud.security.privateca.v1.ICertificateAuthority[] - | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateAuthorities with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCertificateAuthorities = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.listCertificateAuthorities(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateAuthoritiesStream without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - ]; - client.descriptors.page.listCertificateAuthorities.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listCertificateAuthoritiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1.CertificateAuthority[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1.CertificateAuthority, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .createStream as SinonStub - ) - .getCall(0) - .calledWith(client.innerApiCalls.listCertificateAuthorities, request), - ); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('invokes listCertificateAuthoritiesStream with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificateAuthorities.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listCertificateAuthoritiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1.CertificateAuthority[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1.CertificateAuthority, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .createStream as SinonStub - ) - .getCall(0) - .calledWith(client.innerApiCalls.listCertificateAuthorities, request), - ); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('uses async iteration with listCertificateAuthorities without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateAuthority(), - ), - ]; - client.descriptors.page.listCertificateAuthorities.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.security.privateca.v1.ICertificateAuthority[] = - []; - const iterable = client.listCertificateAuthoritiesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificateAuthorities - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('uses async iteration with listCertificateAuthorities with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificateAuthorities.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCertificateAuthoritiesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.security.privateca.v1.ICertificateAuthority[] = - []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificateAuthorities - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - }); - - describe('listCaPools', () => { - it('invokes listCaPools without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCaPoolsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - ]; - client.innerApiCalls.listCaPools = stubSimpleCall(expectedResponse); - const [response] = await client.listCaPools(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCaPools as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCaPools as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCaPools without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCaPoolsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - ]; - client.innerApiCalls.listCaPools = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCaPools( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1.ICaPool[] | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCaPools as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCaPools as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCaPools with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCaPoolsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCaPools = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.listCaPools(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listCaPools as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCaPools as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCaPoolsStream without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCaPoolsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - ]; - client.descriptors.page.listCaPools.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listCaPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1.CaPool[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.security.privateca.v1.CaPool) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - (client.descriptors.page.listCaPools.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listCaPools, request), - ); - assert( - (client.descriptors.page.listCaPools.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('invokes listCaPoolsStream with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCaPoolsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCaPools.createStream = stubPageStreamingCall( - undefined, - expectedError, - ); - const stream = client.listCaPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1.CaPool[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.security.privateca.v1.CaPool) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listCaPools.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listCaPools, request), - ); - assert( - (client.descriptors.page.listCaPools.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('uses async iteration with listCaPools without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCaPoolsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CaPool(), - ), - ]; - client.descriptors.page.listCaPools.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.security.privateca.v1.ICaPool[] = []; - const iterable = client.listCaPoolsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listCaPools.asyncIterate as SinonStub).getCall( - 0, - ).args[1], - request, - ); - assert( - (client.descriptors.page.listCaPools.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('uses async iteration with listCaPools with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCaPoolsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCaPoolsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCaPools.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError, - ); - const iterable = client.listCaPoolsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.security.privateca.v1.ICaPool[] = - []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listCaPools.asyncIterate as SinonStub).getCall( - 0, - ).args[1], - request, - ); - assert( - (client.descriptors.page.listCaPools.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - }); - - describe('listCertificateRevocationLists', () => { - it('invokes listCertificateRevocationLists without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - ]; - client.innerApiCalls.listCertificateRevocationLists = - stubSimpleCall(expectedResponse); - const [response] = await client.listCertificateRevocationLists(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateRevocationLists without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - ]; - client.innerApiCalls.listCertificateRevocationLists = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCertificateRevocationLists( - request, - ( - err?: Error | null, - result?: - | protos.google.cloud.security.privateca.v1.ICertificateRevocationList[] - | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateRevocationLists with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCertificateRevocationLists = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.listCertificateRevocationLists(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateRevocationListsStream without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - ]; - client.descriptors.page.listCertificateRevocationLists.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listCertificateRevocationListsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1.CertificateRevocationList[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1.CertificateRevocationList, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .createStream as SinonStub - ) - .getCall(0) - .calledWith( - client.innerApiCalls.listCertificateRevocationLists, - request, - ), - ); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('invokes listCertificateRevocationListsStream with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificateRevocationLists.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listCertificateRevocationListsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1.CertificateRevocationList[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1.CertificateRevocationList, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .createStream as SinonStub - ) - .getCall(0) - .calledWith( - client.innerApiCalls.listCertificateRevocationLists, - request, - ), - ); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('uses async iteration with listCertificateRevocationLists without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateRevocationList(), - ), - ]; - client.descriptors.page.listCertificateRevocationLists.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.security.privateca.v1.ICertificateRevocationList[] = - []; - const iterable = client.listCertificateRevocationListsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificateRevocationLists - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('uses async iteration with listCertificateRevocationLists with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificateRevocationLists.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCertificateRevocationListsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.security.privateca.v1.ICertificateRevocationList[] = - []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificateRevocationLists - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - }); - - describe('listCertificateTemplates', () => { - it('invokes listCertificateTemplates without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - ]; - client.innerApiCalls.listCertificateTemplates = - stubSimpleCall(expectedResponse); - const [response] = await client.listCertificateTemplates(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificateTemplates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateTemplates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateTemplates without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - ]; - client.innerApiCalls.listCertificateTemplates = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCertificateTemplates( - request, - ( - err?: Error | null, - result?: - | protos.google.cloud.security.privateca.v1.ICertificateTemplate[] - | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificateTemplates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateTemplates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateTemplates with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCertificateTemplates = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.listCertificateTemplates(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.listCertificateTemplates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateTemplates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateTemplatesStream without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - ]; - client.descriptors.page.listCertificateTemplates.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listCertificateTemplatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1.CertificateTemplate[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1.CertificateTemplate, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - ( - client.descriptors.page.listCertificateTemplates - .createStream as SinonStub - ) - .getCall(0) - .calledWith(client.innerApiCalls.listCertificateTemplates, request), - ); - assert( - ( - client.descriptors.page.listCertificateTemplates - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('invokes listCertificateTemplatesStream with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificateTemplates.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listCertificateTemplatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1.CertificateTemplate[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1.CertificateTemplate, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - ( - client.descriptors.page.listCertificateTemplates - .createStream as SinonStub - ) - .getCall(0) - .calledWith(client.innerApiCalls.listCertificateTemplates, request), - ); - assert( - ( - client.descriptors.page.listCertificateTemplates - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('uses async iteration with listCertificateTemplates without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1.CertificateTemplate(), - ), - ]; - client.descriptors.page.listCertificateTemplates.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.security.privateca.v1.ICertificateTemplate[] = - []; - const iterable = client.listCertificateTemplatesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificateTemplates - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.descriptors.page.listCertificateTemplates - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('uses async iteration with listCertificateTemplates with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificateTemplates.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCertificateTemplatesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.security.privateca.v1.ICertificateTemplate[] = - []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificateTemplates - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.descriptors.page.listCertificateTemplates - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest(), - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy(), - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.iamClient.getIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined), - ); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest(), - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy(), - ); - client.iamClient.getIamPolicy = sinon - .stub() - .callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client - .getIamPolicy( - request, - expectedOptions, - ( - err?: Error | null, - result?: IamProtos.google.iam.v1.Policy | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest(), - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects( - client.getIamPolicy(request, expectedOptions), - expectedError, - ); - assert( - (client.iamClient.getIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined), - ); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest(), - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy(), - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.iamClient.setIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined), - ); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest(), - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy(), - ); - client.iamClient.setIamPolicy = sinon - .stub() - .callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client - .setIamPolicy( - request, - expectedOptions, - ( - err?: Error | null, - result?: IamProtos.google.iam.v1.Policy | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest(), - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects( - client.setIamPolicy(request, expectedOptions), - expectedError, - ); - assert( - (client.iamClient.setIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined), - ); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest(), - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse(), - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions( - request, - expectedOptions, - ); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.iamClient.testIamPermissions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined), - ); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest(), - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse(), - ); - client.iamClient.testIamPermissions = sinon - .stub() - .callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client - .testIamPermissions( - request, - expectedOptions, - ( - err?: Error | null, - result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest(), - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.testIamPermissions(request, expectedOptions), - expectedError, - ); - assert( - (client.iamClient.testIamPermissions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined), - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest(), - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location(), - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.locationsClient.getLocation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined), - ); - }); - it('invokes getLocation without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest(), - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location(), - ); - client.locationsClient.getLocation = sinon - .stub() - .callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub).getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest(), - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.getLocation(request, expectedOptions), - expectedError, - ); - assert( - (client.locationsClient.getLocation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined), - ); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest(), - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location(), - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location(), - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location(), - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.locationsClient.descriptors.page.listLocations - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.locationsClient.descriptors.page.listLocations - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest(), - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.locationsClient.descriptors.page.listLocations - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.locationsClient.descriptors.page.listLocations - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.operationsClient.getOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - client.operationsClient.getOperation = sinon - .stub() - .callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient - .getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest(), - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(async () => { - await client.getOperation(request); - }, expectedError); - assert( - (client.operationsClient.getOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty(), - ); - client.operationsClient.cancelOperation = - stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.operationsClient.cancelOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty(), - ); - client.operationsClient.cancelOperation = sinon - .stub() - .callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient - .cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest(), - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(async () => { - await client.cancelOperation(request); - }, expectedError); - assert( - (client.operationsClient.cancelOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty(), - ); - client.operationsClient.deleteOperation = - stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.operationsClient.deleteOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty(), - ); - client.operationsClient.deleteOperation = sinon - .stub() - .callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient - .deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest(), - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(async () => { - await client.deleteOperation(request); - }, expectedError); - assert( - (client.operationsClient.deleteOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest(), - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse(), - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse(), - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse(), - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.operationsClient.descriptor.listOperations - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - }); - it('uses async iteration with listOperations with error', async () => { - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest(), - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.operationsClient.descriptor.listOperations - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - }); - }); - - describe('Path templates', () => { - describe('caPool', async () => { - const fakePath = '/rendered/path/caPool'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - ca_pool: 'caPoolValue', - }; - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - client.pathTemplates.caPoolPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.caPoolPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('caPoolPath', () => { - const result = client.caPoolPath( - 'projectValue', - 'locationValue', - 'caPoolValue', - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.caPoolPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters), - ); - }); - - it('matchProjectFromCaPoolName', () => { - const result = client.matchProjectFromCaPoolName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.caPoolPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchLocationFromCaPoolName', () => { - const result = client.matchLocationFromCaPoolName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.caPoolPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCaPoolFromCaPoolName', () => { - const result = client.matchCaPoolFromCaPoolName(fakePath); - assert.strictEqual(result, 'caPoolValue'); - assert( - (client.pathTemplates.caPoolPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - }); - - describe('certificate', async () => { - const fakePath = '/rendered/path/certificate'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - ca_pool: 'caPoolValue', - certificate: 'certificateValue', - }; - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - client.pathTemplates.certificatePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.certificatePathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('certificatePath', () => { - const result = client.certificatePath( - 'projectValue', - 'locationValue', - 'caPoolValue', - 'certificateValue', - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.certificatePathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters), - ); - }); - - it('matchProjectFromCertificateName', () => { - const result = client.matchProjectFromCertificateName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.certificatePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchLocationFromCertificateName', () => { - const result = client.matchLocationFromCertificateName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.certificatePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCaPoolFromCertificateName', () => { - const result = client.matchCaPoolFromCertificateName(fakePath); - assert.strictEqual(result, 'caPoolValue'); - assert( - (client.pathTemplates.certificatePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCertificateFromCertificateName', () => { - const result = client.matchCertificateFromCertificateName(fakePath); - assert.strictEqual(result, 'certificateValue'); - assert( - (client.pathTemplates.certificatePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - }); - - describe('certificateAuthority', async () => { - const fakePath = '/rendered/path/certificateAuthority'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - ca_pool: 'caPoolValue', - certificate_authority: 'certificateAuthorityValue', - }; - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - client.pathTemplates.certificateAuthorityPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.certificateAuthorityPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('certificateAuthorityPath', () => { - const result = client.certificateAuthorityPath( - 'projectValue', - 'locationValue', - 'caPoolValue', - 'certificateAuthorityValue', - ); - assert.strictEqual(result, fakePath); - assert( - ( - client.pathTemplates.certificateAuthorityPathTemplate - .render as SinonStub - ) - .getCall(-1) - .calledWith(expectedParameters), - ); - }); - - it('matchProjectFromCertificateAuthorityName', () => { - const result = - client.matchProjectFromCertificateAuthorityName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - ( - client.pathTemplates.certificateAuthorityPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchLocationFromCertificateAuthorityName', () => { - const result = - client.matchLocationFromCertificateAuthorityName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - ( - client.pathTemplates.certificateAuthorityPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCaPoolFromCertificateAuthorityName', () => { - const result = client.matchCaPoolFromCertificateAuthorityName(fakePath); - assert.strictEqual(result, 'caPoolValue'); - assert( - ( - client.pathTemplates.certificateAuthorityPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCertificateAuthorityFromCertificateAuthorityName', () => { - const result = - client.matchCertificateAuthorityFromCertificateAuthorityName( - fakePath, - ); - assert.strictEqual(result, 'certificateAuthorityValue'); - assert( - ( - client.pathTemplates.certificateAuthorityPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - }); - - describe('certificateRevocationList', async () => { - const fakePath = '/rendered/path/certificateRevocationList'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - ca_pool: 'caPoolValue', - certificate_authority: 'certificateAuthorityValue', - certificate_revocation_list: 'certificateRevocationListValue', - }; - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - client.pathTemplates.certificateRevocationListPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.certificateRevocationListPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('certificateRevocationListPath', () => { - const result = client.certificateRevocationListPath( - 'projectValue', - 'locationValue', - 'caPoolValue', - 'certificateAuthorityValue', - 'certificateRevocationListValue', - ); - assert.strictEqual(result, fakePath); - assert( - ( - client.pathTemplates.certificateRevocationListPathTemplate - .render as SinonStub - ) - .getCall(-1) - .calledWith(expectedParameters), - ); - }); - - it('matchProjectFromCertificateRevocationListName', () => { - const result = - client.matchProjectFromCertificateRevocationListName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - ( - client.pathTemplates.certificateRevocationListPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchLocationFromCertificateRevocationListName', () => { - const result = - client.matchLocationFromCertificateRevocationListName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - ( - client.pathTemplates.certificateRevocationListPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCaPoolFromCertificateRevocationListName', () => { - const result = - client.matchCaPoolFromCertificateRevocationListName(fakePath); - assert.strictEqual(result, 'caPoolValue'); - assert( - ( - client.pathTemplates.certificateRevocationListPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCertificateAuthorityFromCertificateRevocationListName', () => { - const result = - client.matchCertificateAuthorityFromCertificateRevocationListName( - fakePath, - ); - assert.strictEqual(result, 'certificateAuthorityValue'); - assert( - ( - client.pathTemplates.certificateRevocationListPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCertificateRevocationListFromCertificateRevocationListName', () => { - const result = - client.matchCertificateRevocationListFromCertificateRevocationListName( - fakePath, - ); - assert.strictEqual(result, 'certificateRevocationListValue'); - assert( - ( - client.pathTemplates.certificateRevocationListPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - }); - - describe('certificateTemplate', async () => { - const fakePath = '/rendered/path/certificateTemplate'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - certificate_template: 'certificateTemplateValue', - }; - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - client.pathTemplates.certificateTemplatePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.certificateTemplatePathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('certificateTemplatePath', () => { - const result = client.certificateTemplatePath( - 'projectValue', - 'locationValue', - 'certificateTemplateValue', - ); - assert.strictEqual(result, fakePath); - assert( - ( - client.pathTemplates.certificateTemplatePathTemplate - .render as SinonStub - ) - .getCall(-1) - .calledWith(expectedParameters), - ); - }); - - it('matchProjectFromCertificateTemplateName', () => { - const result = client.matchProjectFromCertificateTemplateName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - ( - client.pathTemplates.certificateTemplatePathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchLocationFromCertificateTemplateName', () => { - const result = - client.matchLocationFromCertificateTemplateName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - ( - client.pathTemplates.certificateTemplatePathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCertificateTemplateFromCertificateTemplateName', () => { - const result = - client.matchCertificateTemplateFromCertificateTemplateName(fakePath); - assert.strictEqual(result, 'certificateTemplateValue'); - assert( - ( - client.pathTemplates.certificateTemplatePathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - }); - - describe('location', async () => { - const fakePath = '/rendered/path/location'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - }; - const client = - new certificateauthorityserviceModule.v1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - client.pathTemplates.locationPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.locationPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath('projectValue', 'locationValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters), - ); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts b/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts deleted file mode 100644 index 2c08e1f6e051..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts +++ /dev/null @@ -1,5151 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import { SinonStub } from 'sinon'; -import { describe, it } from 'mocha'; -import * as certificateauthorityserviceModule from '../src'; - -import { PassThrough } from 'stream'; - -import { protobuf, LROperation, operationsProtos } from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON( - require('../protos/protos.json'), -).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = ( - instance.constructor as typeof protobuf.Message - ).toObject(instance as protobuf.Message, { defaults: true }); - return (instance.constructor as typeof protobuf.Message).fromObject( - filledObject, - ) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error - ? sinon.stub().rejects(error) - : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback( - response?: ResponseType, - error?: Error, -) { - return error - ? sinon.stub().callsArgWith(2, error) - : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall( - response?: ResponseType, - callError?: Error, - lroError?: Error, -) { - const innerStub = lroError - ? sinon.stub().rejects(lroError) - : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError - ? sinon.stub().rejects(callError) - : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback( - response?: ResponseType, - callError?: Error, - lroError?: Error, -) { - const innerStub = lroError - ? sinon.stub().rejects(lroError) - : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError - ? sinon.stub().callsArgWith(2, callError) - : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall( - responses?: ResponseType[], - error?: Error, -) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error - ? sinon.stub().callsArgWith(2, error) - : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { - mockStream.write({}); - }); - } - setImmediate(() => { - mockStream.end(); - }); - } else { - setImmediate(() => { - mockStream.write({}); - }); - setImmediate(() => { - mockStream.end(); - }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall( - responses?: ResponseType[], - error?: Error, -) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({ done: true, value: undefined }); - } - return Promise.resolve({ done: false, value: responses![counter++] }); - }, - }; - }, - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.CertificateAuthorityServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'privateca.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, 'googleapis.com'); - }); - - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = - certificateauthorityserviceModule.v1beta1 - .CertificateAuthorityServiceClient.servicePath; - assert.strictEqual(servicePath, 'privateca.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = - certificateauthorityserviceModule.v1beta1 - .CertificateAuthorityServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'privateca.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { universeDomain: 'example.com' }, - ); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'privateca.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { universe_domain: 'example.com' }, - ); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'privateca.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'privateca.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { universeDomain: 'configured.example.com' }, - ); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'privateca.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { universe_domain: 'example.com', universeDomain: 'example.net' }, - ); - }); - }); - - it('has port', () => { - const port = - certificateauthorityserviceModule.v1beta1 - .CertificateAuthorityServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - fallback: true, - }, - ); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - assert.strictEqual(client.certificateAuthorityServiceStub, undefined); - await client.initialize(); - assert(client.certificateAuthorityServiceStub); - }); - - it('has close method for the initialized client', (done) => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - client.initialize().catch((err) => { - throw err; - }); - assert(client.certificateAuthorityServiceStub); - client - .close() - .then(() => { - done(); - }) - .catch((err) => { - throw err; - }); - }); - - it('has close method for the non-initialized client', (done) => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - assert.strictEqual(client.certificateAuthorityServiceStub, undefined); - client - .close() - .then(() => { - done(); - }) - .catch((err) => { - throw err; - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('createCertificate', () => { - it('invokes createCertificate without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.CreateCertificateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ); - client.innerApiCalls.createCertificate = stubSimpleCall(expectedResponse); - const [response] = await client.createCertificate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.CreateCertificateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ); - client.innerApiCalls.createCertificate = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCertificate( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1beta1.ICertificate | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificate with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.CreateCertificateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCertificate = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.createCertificate(request), expectedError); - const actualRequest = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificate with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CreateCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.CreateCertificateRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.createCertificate(request), expectedError); - }); - }); - - describe('getCertificate', () => { - it('invokes getCertificate without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ); - client.innerApiCalls.getCertificate = stubSimpleCall(expectedResponse); - const [response] = await client.getCertificate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ); - client.innerApiCalls.getCertificate = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCertificate( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1beta1.ICertificate | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificate with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCertificate = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.getCertificate(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificate with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.getCertificate(request), expectedError); - }); - }); - - describe('revokeCertificate', () => { - it('invokes revokeCertificate without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ); - client.innerApiCalls.revokeCertificate = stubSimpleCall(expectedResponse); - const [response] = await client.revokeCertificate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes revokeCertificate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ); - client.innerApiCalls.revokeCertificate = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.revokeCertificate( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1beta1.ICertificate | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes revokeCertificate with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.revokeCertificate = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.revokeCertificate(request), expectedError); - const actualRequest = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.revokeCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes revokeCertificate with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.revokeCertificate(request), expectedError); - }); - }); - - describe('updateCertificate', () => { - it('invokes updateCertificate without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(), - ); - request.certificate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest', - ['certificate', 'name'], - ); - request.certificate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ); - client.innerApiCalls.updateCertificate = stubSimpleCall(expectedResponse); - const [response] = await client.updateCertificate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificate without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(), - ); - request.certificate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest', - ['certificate', 'name'], - ); - request.certificate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ); - client.innerApiCalls.updateCertificate = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCertificate( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1beta1.ICertificate | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificate with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(), - ); - request.certificate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest', - ['certificate', 'name'], - ); - request.certificate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificate = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.updateCertificate(request), expectedError); - const actualRequest = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificate with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest(), - ); - request.certificate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest', - ['certificate', 'name'], - ); - request.certificate.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.updateCertificate(request), expectedError); - }); - }); - - describe('fetchCertificateAuthorityCsr', () => { - it('invokes fetchCertificateAuthorityCsr without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse(), - ); - client.innerApiCalls.fetchCertificateAuthorityCsr = - stubSimpleCall(expectedResponse); - const [response] = await client.fetchCertificateAuthorityCsr(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchCertificateAuthorityCsr without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse(), - ); - client.innerApiCalls.fetchCertificateAuthorityCsr = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchCertificateAuthorityCsr( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1beta1.IFetchCertificateAuthorityCsrResponse | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchCertificateAuthorityCsr with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchCertificateAuthorityCsr = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.fetchCertificateAuthorityCsr(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.fetchCertificateAuthorityCsr as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchCertificateAuthorityCsr with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects( - client.fetchCertificateAuthorityCsr(request), - expectedError, - ); - }); - }); - - describe('getCertificateAuthority', () => { - it('invokes getCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ); - client.innerApiCalls.getCertificateAuthority = - stubSimpleCall(expectedResponse); - const [response] = await client.getCertificateAuthority(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ); - client.innerApiCalls.getCertificateAuthority = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCertificateAuthority( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateAuthority with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCertificateAuthority = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.getCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateAuthority with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects( - client.getCertificateAuthority(request), - expectedError, - ); - }); - }); - - describe('getCertificateRevocationList', () => { - it('invokes getCertificateRevocationList without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ); - client.innerApiCalls.getCertificateRevocationList = - stubSimpleCall(expectedResponse); - const [response] = await client.getCertificateRevocationList(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateRevocationList without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ); - client.innerApiCalls.getCertificateRevocationList = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCertificateRevocationList( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateRevocationList with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCertificateRevocationList = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.getCertificateRevocationList(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCertificateRevocationList with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects( - client.getCertificateRevocationList(request), - expectedError, - ); - }); - }); - - describe('getReusableConfig', () => { - it('invokes getReusableConfig without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ); - client.innerApiCalls.getReusableConfig = stubSimpleCall(expectedResponse); - const [response] = await client.getReusableConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getReusableConfig as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getReusableConfig as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getReusableConfig without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ); - client.innerApiCalls.getReusableConfig = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getReusableConfig( - request, - ( - err?: Error | null, - result?: protos.google.cloud.security.privateca.v1beta1.IReusableConfig | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getReusableConfig as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getReusableConfig as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getReusableConfig with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getReusableConfig = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.getReusableConfig(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getReusableConfig as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getReusableConfig as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getReusableConfig with closed client', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.getReusableConfig(request), expectedError); - }); - }); - - describe('activateCertificateAuthority', () => { - it('invokes activateCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.activateCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.activateCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes activateCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.activateCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.activateCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes activateCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.activateCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.activateCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes activateCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.activateCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.activateCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.activateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkActivateCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkActivateCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkActivateCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkActivateCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('createCertificateAuthority', () => { - it('invokes createCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.createCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.createCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.createCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.createCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.createCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkCreateCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkCreateCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('disableCertificateAuthority', () => { - it('invokes disableCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.disableCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.disableCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.disableCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.disableCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.disableCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.disableCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.disableCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.disableCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.disableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDisableCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkDisableCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDisableCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkDisableCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('enableCertificateAuthority', () => { - it('invokes enableCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.enableCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.enableCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.enableCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.enableCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.enableCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.enableCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.enableCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.enableCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.enableCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkEnableCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkEnableCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkEnableCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkEnableCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('restoreCertificateAuthority', () => { - it('invokes restoreCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.restoreCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.restoreCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.restoreCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restoreCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.restoreCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.restoreCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.restoreCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.restoreCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.restoreCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestoreCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkRestoreCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestoreCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkRestoreCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('scheduleDeleteCertificateAuthority', () => { - it('invokes scheduleDeleteCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.scheduleDeleteCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = - await client.scheduleDeleteCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes scheduleDeleteCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.scheduleDeleteCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.scheduleDeleteCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes scheduleDeleteCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.scheduleDeleteCertificateAuthority = - stubLongRunningCall(undefined, expectedError); - await assert.rejects( - client.scheduleDeleteCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes scheduleDeleteCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest', - ['name'], - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.scheduleDeleteCertificateAuthority = - stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = - await client.scheduleDeleteCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkScheduleDeleteCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkScheduleDeleteCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkScheduleDeleteCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkScheduleDeleteCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('updateCertificateAuthority', () => { - it('invokes updateCertificateAuthority without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(), - ); - request.certificateAuthority ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest', - ['certificateAuthority', 'name'], - ); - request.certificateAuthority.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCertificateAuthority = - stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCertificateAuthority(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateAuthority without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(), - ); - request.certificateAuthority ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest', - ['certificateAuthority', 'name'], - ); - request.certificateAuthority.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCertificateAuthority = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCertificateAuthority( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateAuthority with call error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(), - ); - request.certificateAuthority ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest', - ['certificateAuthority', 'name'], - ); - request.certificateAuthority.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificateAuthority = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects( - client.updateCertificateAuthority(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateAuthority with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest(), - ); - request.certificateAuthority ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest', - ['certificateAuthority', 'name'], - ); - request.certificateAuthority.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_authority.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificateAuthority = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.updateCertificateAuthority(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateAuthority as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateCertificateAuthorityProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkUpdateCertificateAuthorityProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateCertificateAuthorityProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkUpdateCertificateAuthorityProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('updateCertificateRevocationList', () => { - it('invokes updateCertificateRevocationList without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(), - ); - request.certificateRevocationList ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest', - ['certificateRevocationList', 'name'], - ); - request.certificateRevocationList.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCertificateRevocationList = - stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCertificateRevocationList(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateRevocationList without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(), - ); - request.certificateRevocationList ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest', - ['certificateRevocationList', 'name'], - ); - request.certificateRevocationList.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.updateCertificateRevocationList = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCertificateRevocationList( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList, - protos.google.cloud.security.privateca.v1beta1.IOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateRevocationList with call error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(), - ); - request.certificateRevocationList ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest', - ['certificateRevocationList', 'name'], - ); - request.certificateRevocationList.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificateRevocationList = - stubLongRunningCall(undefined, expectedError); - await assert.rejects( - client.updateCertificateRevocationList(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCertificateRevocationList with LRO error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest(), - ); - request.certificateRevocationList ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest', - ['certificateRevocationList', 'name'], - ); - request.certificateRevocationList.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_revocation_list.name=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCertificateRevocationList = - stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateCertificateRevocationList(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateCertificateRevocationList as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateCertificateRevocationListProgress without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkUpdateCertificateRevocationListProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateCertificateRevocationListProgress with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkUpdateCertificateRevocationListProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('listCertificates', () => { - it('invokes listCertificates without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - ]; - client.innerApiCalls.listCertificates = stubSimpleCall(expectedResponse); - const [response] = await client.listCertificates(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificates without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - ]; - client.innerApiCalls.listCertificates = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCertificates( - request, - ( - err?: Error | null, - result?: - | protos.google.cloud.security.privateca.v1beta1.ICertificate[] - | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificates with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCertificates = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.listCertificates(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificatesStream without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - ]; - client.descriptors.page.listCertificates.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listCertificatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1beta1.Certificate[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1beta1.Certificate, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - (client.descriptors.page.listCertificates.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listCertificates, request), - ); - assert( - (client.descriptors.page.listCertificates.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('invokes listCertificatesStream with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificates.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listCertificatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1beta1.Certificate[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1beta1.Certificate, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listCertificates.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listCertificates, request), - ); - assert( - (client.descriptors.page.listCertificates.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('uses async iteration with listCertificates without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.Certificate(), - ), - ]; - client.descriptors.page.listCertificates.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.security.privateca.v1beta1.ICertificate[] = - []; - const iterable = client.listCertificatesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificates.asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - (client.descriptors.page.listCertificates.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('uses async iteration with listCertificates with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificatesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificatesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificates.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCertificatesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.security.privateca.v1beta1.ICertificate[] = - []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificates.asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - (client.descriptors.page.listCertificates.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - }); - - describe('listCertificateAuthorities', () => { - it('invokes listCertificateAuthorities without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - ]; - client.innerApiCalls.listCertificateAuthorities = - stubSimpleCall(expectedResponse); - const [response] = await client.listCertificateAuthorities(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateAuthorities without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - ]; - client.innerApiCalls.listCertificateAuthorities = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCertificateAuthorities( - request, - ( - err?: Error | null, - result?: - | protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[] - | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateAuthorities with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCertificateAuthorities = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.listCertificateAuthorities(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateAuthorities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateAuthoritiesStream without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - ]; - client.descriptors.page.listCertificateAuthorities.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listCertificateAuthoritiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1beta1.CertificateAuthority[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .createStream as SinonStub - ) - .getCall(0) - .calledWith(client.innerApiCalls.listCertificateAuthorities, request), - ); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('invokes listCertificateAuthoritiesStream with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificateAuthorities.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listCertificateAuthoritiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1beta1.CertificateAuthority[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1beta1.CertificateAuthority, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .createStream as SinonStub - ) - .getCall(0) - .calledWith(client.innerApiCalls.listCertificateAuthorities, request), - ); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('uses async iteration with listCertificateAuthorities without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateAuthority(), - ), - ]; - client.descriptors.page.listCertificateAuthorities.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[] = - []; - const iterable = client.listCertificateAuthoritiesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificateAuthorities - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('uses async iteration with listCertificateAuthorities with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificateAuthorities.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCertificateAuthoritiesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.security.privateca.v1beta1.ICertificateAuthority[] = - []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificateAuthorities - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.descriptors.page.listCertificateAuthorities - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - }); - - describe('listCertificateRevocationLists', () => { - it('invokes listCertificateRevocationLists without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - ]; - client.innerApiCalls.listCertificateRevocationLists = - stubSimpleCall(expectedResponse); - const [response] = await client.listCertificateRevocationLists(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateRevocationLists without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - ]; - client.innerApiCalls.listCertificateRevocationLists = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCertificateRevocationLists( - request, - ( - err?: Error | null, - result?: - | protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[] - | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateRevocationLists with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCertificateRevocationLists = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.listCertificateRevocationLists(request), - expectedError, - ); - const actualRequest = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listCertificateRevocationLists as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCertificateRevocationListsStream without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - ]; - client.descriptors.page.listCertificateRevocationLists.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listCertificateRevocationListsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .createStream as SinonStub - ) - .getCall(0) - .calledWith( - client.innerApiCalls.listCertificateRevocationLists, - request, - ), - ); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('invokes listCertificateRevocationListsStream with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificateRevocationLists.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listCertificateRevocationListsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .createStream as SinonStub - ) - .getCall(0) - .calledWith( - client.innerApiCalls.listCertificateRevocationLists, - request, - ), - ); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('uses async iteration with listCertificateRevocationLists without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.CertificateRevocationList(), - ), - ]; - client.descriptors.page.listCertificateRevocationLists.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[] = - []; - const iterable = client.listCertificateRevocationListsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificateRevocationLists - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - - it('uses async iteration with listCertificateRevocationLists with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listCertificateRevocationLists.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCertificateRevocationListsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.security.privateca.v1beta1.ICertificateRevocationList[] = - []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.descriptors.page.listCertificateRevocationLists - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - ( - client.descriptors.page.listCertificateRevocationLists - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams, - ), - ); - }); - }); - - describe('listReusableConfigs', () => { - it('invokes listReusableConfigs without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - ]; - client.innerApiCalls.listReusableConfigs = - stubSimpleCall(expectedResponse); - const [response] = await client.listReusableConfigs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listReusableConfigs as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listReusableConfigs as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listReusableConfigs without error using callback', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - ]; - client.innerApiCalls.listReusableConfigs = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listReusableConfigs( - request, - ( - err?: Error | null, - result?: - | protos.google.cloud.security.privateca.v1beta1.IReusableConfig[] - | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listReusableConfigs as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listReusableConfigs as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listReusableConfigs with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listReusableConfigs = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.listReusableConfigs(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listReusableConfigs as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listReusableConfigs as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listReusableConfigsStream without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - ]; - client.descriptors.page.listReusableConfigs.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listReusableConfigsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1beta1.ReusableConfig[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1beta1.ReusableConfig, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - (client.descriptors.page.listReusableConfigs.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listReusableConfigs, request), - ); - assert( - (client.descriptors.page.listReusableConfigs.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('invokes listReusableConfigsStream with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listReusableConfigs.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listReusableConfigsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.security.privateca.v1beta1.ReusableConfig[] = - []; - stream.on( - 'data', - ( - response: protos.google.cloud.security.privateca.v1beta1.ReusableConfig, - ) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listReusableConfigs.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listReusableConfigs, request), - ); - assert( - (client.descriptors.page.listReusableConfigs.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('uses async iteration with listReusableConfigs without error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ReusableConfig(), - ), - ]; - client.descriptors.page.listReusableConfigs.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.security.privateca.v1beta1.IReusableConfig[] = - []; - const iterable = client.listReusableConfigsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.descriptors.page.listReusableConfigs.asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - (client.descriptors.page.listReusableConfigs.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('uses async iteration with listReusableConfigs with error', async () => { - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest', - ['parent'], - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listReusableConfigs.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listReusableConfigsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.security.privateca.v1beta1.IReusableConfig[] = - []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.descriptors.page.listReusableConfigs.asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - assert( - (client.descriptors.page.listReusableConfigs.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - }); - - describe('Path templates', () => { - describe('certificate', async () => { - const fakePath = '/rendered/path/certificate'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - certificate_authority: 'certificateAuthorityValue', - certificate: 'certificateValue', - }; - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - client.pathTemplates.certificatePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.certificatePathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('certificatePath', () => { - const result = client.certificatePath( - 'projectValue', - 'locationValue', - 'certificateAuthorityValue', - 'certificateValue', - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.certificatePathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters), - ); - }); - - it('matchProjectFromCertificateName', () => { - const result = client.matchProjectFromCertificateName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.certificatePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchLocationFromCertificateName', () => { - const result = client.matchLocationFromCertificateName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.certificatePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCertificateAuthorityFromCertificateName', () => { - const result = - client.matchCertificateAuthorityFromCertificateName(fakePath); - assert.strictEqual(result, 'certificateAuthorityValue'); - assert( - (client.pathTemplates.certificatePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCertificateFromCertificateName', () => { - const result = client.matchCertificateFromCertificateName(fakePath); - assert.strictEqual(result, 'certificateValue'); - assert( - (client.pathTemplates.certificatePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - }); - - describe('certificateAuthority', async () => { - const fakePath = '/rendered/path/certificateAuthority'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - certificate_authority: 'certificateAuthorityValue', - }; - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - client.pathTemplates.certificateAuthorityPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.certificateAuthorityPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('certificateAuthorityPath', () => { - const result = client.certificateAuthorityPath( - 'projectValue', - 'locationValue', - 'certificateAuthorityValue', - ); - assert.strictEqual(result, fakePath); - assert( - ( - client.pathTemplates.certificateAuthorityPathTemplate - .render as SinonStub - ) - .getCall(-1) - .calledWith(expectedParameters), - ); - }); - - it('matchProjectFromCertificateAuthorityName', () => { - const result = - client.matchProjectFromCertificateAuthorityName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - ( - client.pathTemplates.certificateAuthorityPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchLocationFromCertificateAuthorityName', () => { - const result = - client.matchLocationFromCertificateAuthorityName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - ( - client.pathTemplates.certificateAuthorityPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCertificateAuthorityFromCertificateAuthorityName', () => { - const result = - client.matchCertificateAuthorityFromCertificateAuthorityName( - fakePath, - ); - assert.strictEqual(result, 'certificateAuthorityValue'); - assert( - ( - client.pathTemplates.certificateAuthorityPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - }); - - describe('certificateRevocationList', async () => { - const fakePath = '/rendered/path/certificateRevocationList'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - certificate_authority: 'certificateAuthorityValue', - certificate_revocation_list: 'certificateRevocationListValue', - }; - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - client.pathTemplates.certificateRevocationListPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.certificateRevocationListPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('certificateRevocationListPath', () => { - const result = client.certificateRevocationListPath( - 'projectValue', - 'locationValue', - 'certificateAuthorityValue', - 'certificateRevocationListValue', - ); - assert.strictEqual(result, fakePath); - assert( - ( - client.pathTemplates.certificateRevocationListPathTemplate - .render as SinonStub - ) - .getCall(-1) - .calledWith(expectedParameters), - ); - }); - - it('matchProjectFromCertificateRevocationListName', () => { - const result = - client.matchProjectFromCertificateRevocationListName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - ( - client.pathTemplates.certificateRevocationListPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchLocationFromCertificateRevocationListName', () => { - const result = - client.matchLocationFromCertificateRevocationListName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - ( - client.pathTemplates.certificateRevocationListPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCertificateAuthorityFromCertificateRevocationListName', () => { - const result = - client.matchCertificateAuthorityFromCertificateRevocationListName( - fakePath, - ); - assert.strictEqual(result, 'certificateAuthorityValue'); - assert( - ( - client.pathTemplates.certificateRevocationListPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchCertificateRevocationListFromCertificateRevocationListName', () => { - const result = - client.matchCertificateRevocationListFromCertificateRevocationListName( - fakePath, - ); - assert.strictEqual(result, 'certificateRevocationListValue'); - assert( - ( - client.pathTemplates.certificateRevocationListPathTemplate - .match as SinonStub - ) - .getCall(-1) - .calledWith(fakePath), - ); - }); - }); - - describe('location', async () => { - const fakePath = '/rendered/path/location'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - }; - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - client.pathTemplates.locationPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.locationPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath('projectValue', 'locationValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters), - ); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - }); - - describe('reusableConfig', async () => { - const fakePath = '/rendered/path/reusableConfig'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - reusable_config: 'reusableConfigValue', - }; - const client = - new certificateauthorityserviceModule.v1beta1.CertificateAuthorityServiceClient( - { - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }, - ); - await client.initialize(); - client.pathTemplates.reusableConfigPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.reusableConfigPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('reusableConfigPath', () => { - const result = client.reusableConfigPath( - 'projectValue', - 'locationValue', - 'reusableConfigValue', - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.reusableConfigPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters), - ); - }); - - it('matchProjectFromReusableConfigName', () => { - const result = client.matchProjectFromReusableConfigName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.reusableConfigPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchLocationFromReusableConfigName', () => { - const result = client.matchLocationFromReusableConfigName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.reusableConfigPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - - it('matchReusableConfigFromReusableConfigName', () => { - const result = - client.matchReusableConfigFromReusableConfigName(fakePath); - assert.strictEqual(result, 'reusableConfigValue'); - assert( - (client.pathTemplates.reusableConfigPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath), - ); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-security-privateca/tsconfig.json b/owl-bot-staging/google-cloud-security-privateca/tsconfig.json deleted file mode 100644 index ca73e7bfc824..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/google-cloud-security-privateca/webpack.config.js b/owl-bot-staging/google-cloud-security-privateca/webpack.config.js deleted file mode 100644 index a18753845591..000000000000 --- a/owl-bot-staging/google-cloud-security-privateca/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'CertificateAuthorityService', - filename: './certificate-authority-service.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto b/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto index 15ed965e42ce..ba54ee133ad0 100644 --- a/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto +++ b/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -505,16 +505,33 @@ message CaPool { repeated AllowedKeyType allowed_key_types = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The duration to backdate all certificates issued from this - // [CaPool][google.cloud.security.privateca.v1.CaPool]. If not set, the - // certificates will be issued with a not_before_time of the issuance time - // (i.e. the current time). If set, the certificates will be issued with a - // not_before_time of the issuance time minus the backdate_duration. The - // not_after_time will be adjusted to preserve the requested lifetime. The - // backdate_duration must be less than or equal to 48 hours. + // Optional. If set, all certificates issued from this + // [CaPool][google.cloud.security.privateca.v1.CaPool] will be backdated by + // this duration. The 'not_before_time' will be the issuance time minus this + // [backdate_duration][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdate_duration], + // and the 'not_after_time' will be adjusted to preserve the requested + // lifetime. The maximum duration that a certificate can be backdated with + // these options is 48 hours in the past. + // This option cannot be set if + // [allow_requester_specified_not_before_time][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allow_requester_specified_not_before_time] + // is set. google.protobuf.Duration backdate_duration = 7 [(google.api.field_behavior) = OPTIONAL]; + // Optional. If set to true, allows requesters to specify the + // [requested_not_before_time][google.cloud.security.privateca.v1.Certificate.requested_not_before_time] + // field when creating a + // [Certificate][google.cloud.security.privateca.v1.Certificate]. + // Certificates requested with this option enabled will have a + // 'not_before_time' equal to the value specified in the request. The + // 'not_after_time' will be adjusted to preserve the requested lifetime. The + // maximum time that a certificate can be backdated with these options is 48 + // hours in the past. This option cannot be set if + // [backdate_duration][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdate_duration] + // is set. + bool allow_requester_specified_not_before_time = 8 + [(google.api.field_behavior) = OPTIONAL]; + // Optional. The maximum lifetime allowed for issued // [Certificates][google.cloud.security.privateca.v1.Certificate]. Note that // if the issuing @@ -601,10 +618,24 @@ message CaPool { PublishingOptions publishing_options = 4 [(google.api.field_behavior) = OPTIONAL]; + // Optional. When + // [EncryptionSpec][google.cloud.security.privateca.v1.EncryptionSpec] is + // provided, the [Subject][google.cloud.security.privateca.v1.Subject], + // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames], and + // the PEM-encoded certificate fields will be encrypted at rest. + EncryptionSpec encryption_spec = 8 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Labels with user-defined metadata. map labels = 5 [(google.api.field_behavior) = OPTIONAL]; } +// The configuration used for encrypting data at rest. +message EncryptionSpec { + // The resource name for a Cloud KMS key in the format + // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string cloud_kms_key = 1; +} + // A // [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList] // corresponds to a signed X.509 certificate Revocation List (CRL). A CRL @@ -809,6 +840,23 @@ message Certificate { // Optional. Labels with user-defined metadata. map labels = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The requested + // [not_before_time][google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription.not_before_time] + // of this [Certificate][google.cloud.security.privateca.v1.Certificate]. This + // field may only be set if the + // [CaPool.IssuancePolicy.allow_requester_specified_not_before_time][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.allow_requester_specified_not_before_time] + // field is set to true for the issuing + // [CaPool][google.cloud.security.privateca.v1.CaPool]. + // + // If this field is specified, the certificate will be issued with this + // 'not_before_time'. If this is not specified, the 'not_before_time' will be + // set to the issuance time or issuance time minus + // [backdate_duration][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdate_duration] + // depending on the [CaPool][google.cloud.security.privateca.v1.CaPool] + // configuration. + google.protobuf.Timestamp requested_not_before_time = 15 + [(google.api.field_behavior) = OPTIONAL]; } // A diff --git a/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto b/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto index 9054e267687e..28e67660da66 100644 --- a/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto +++ b/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -505,9 +505,18 @@ message GetCertificateRequest { // Request message for // [CertificateAuthorityService.ListCertificates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates]. message ListCertificatesRequest { - // Required. The resource name of the location associated with the + // Required. The resource name of the parent associated with the // [Certificates][google.cloud.security.privateca.v1.Certificate], in the - // format `projects/*/locations/*/caPools/*`. + // format `projects/*/locations/*/caPools/*`. The parent resource name can be + // in one of two forms: + // + // 1. **Specific CA Pool:** To list certificates within a single CA Pool: + // `projects/*/locations/*/caPools/*` + // + // 2. **All CA Pools in a Location:** To list certificates across *all* CA + // Pools in a given project and location, use the wildcard character (`-`) + // in place of the CA Pool ID. + // Example: `projects/*/locations/*/caPools/-` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-security-privateca/protos/protos.d.ts b/packages/google-cloud-security-privateca/protos/protos.d.ts index 06162d90a834..4798747d8829 100644 --- a/packages/google-cloud-security-privateca/protos/protos.d.ts +++ b/packages/google-cloud-security-privateca/protos/protos.d.ts @@ -600,6 +600,9 @@ export namespace google { /** CaPool publishingOptions */ publishingOptions?: (google.cloud.security.privateca.v1.CaPool.IPublishingOptions|null); + /** CaPool encryptionSpec */ + encryptionSpec?: (google.cloud.security.privateca.v1.IEncryptionSpec|null); + /** CaPool labels */ labels?: ({ [k: string]: string }|null); } @@ -625,6 +628,9 @@ export namespace google { /** CaPool publishingOptions. */ public publishingOptions?: (google.cloud.security.privateca.v1.CaPool.IPublishingOptions|null); + /** CaPool encryptionSpec. */ + public encryptionSpec?: (google.cloud.security.privateca.v1.IEncryptionSpec|null); + /** CaPool labels. */ public labels: { [k: string]: string }; @@ -843,6 +849,9 @@ export namespace google { /** IssuancePolicy backdateDuration */ backdateDuration?: (google.protobuf.IDuration|null); + /** IssuancePolicy allowRequesterSpecifiedNotBeforeTime */ + allowRequesterSpecifiedNotBeforeTime?: (boolean|null); + /** IssuancePolicy maximumLifetime */ maximumLifetime?: (google.protobuf.IDuration|null); @@ -874,6 +883,9 @@ export namespace google { /** IssuancePolicy backdateDuration. */ public backdateDuration?: (google.protobuf.IDuration|null); + /** IssuancePolicy allowRequesterSpecifiedNotBeforeTime. */ + public allowRequesterSpecifiedNotBeforeTime: boolean; + /** IssuancePolicy maximumLifetime. */ public maximumLifetime?: (google.protobuf.IDuration|null); @@ -1394,6 +1406,103 @@ export namespace google { } } + /** Properties of an EncryptionSpec. */ + interface IEncryptionSpec { + + /** EncryptionSpec cloudKmsKey */ + cloudKmsKey?: (string|null); + } + + /** Represents an EncryptionSpec. */ + class EncryptionSpec implements IEncryptionSpec { + + /** + * Constructs a new EncryptionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.security.privateca.v1.IEncryptionSpec); + + /** EncryptionSpec cloudKmsKey. */ + public cloudKmsKey: string; + + /** + * Creates a new EncryptionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionSpec instance + */ + public static create(properties?: google.cloud.security.privateca.v1.IEncryptionSpec): google.cloud.security.privateca.v1.EncryptionSpec; + + /** + * Encodes the specified EncryptionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. + * @param message EncryptionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.security.privateca.v1.IEncryptionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. + * @param message EncryptionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.security.privateca.v1.IEncryptionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionSpec + * @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.security.privateca.v1.EncryptionSpec; + + /** + * Decodes an EncryptionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionSpec + * @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.security.privateca.v1.EncryptionSpec; + + /** + * Verifies an EncryptionSpec 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 EncryptionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.security.privateca.v1.EncryptionSpec; + + /** + * Creates a plain object from an EncryptionSpec message. Also converts values to other types if specified. + * @param message EncryptionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.security.privateca.v1.EncryptionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a CertificateRevocationList. */ interface ICertificateRevocationList { @@ -1708,6 +1817,9 @@ export namespace google { /** Certificate labels */ labels?: ({ [k: string]: string }|null); + + /** Certificate requestedNotBeforeTime */ + requestedNotBeforeTime?: (google.protobuf.ITimestamp|null); } /** Represents a Certificate. */ @@ -1761,6 +1873,9 @@ export namespace google { /** Certificate labels. */ public labels: { [k: string]: string }; + /** Certificate requestedNotBeforeTime. */ + public requestedNotBeforeTime?: (google.protobuf.ITimestamp|null); + /** Certificate certificateConfig. */ public certificateConfig?: ("pemCsr"|"config"); diff --git a/packages/google-cloud-security-privateca/protos/protos.js b/packages/google-cloud-security-privateca/protos/protos.js index 0998d0089002..c44fa93b948e 100644 --- a/packages/google-cloud-security-privateca/protos/protos.js +++ b/packages/google-cloud-security-privateca/protos/protos.js @@ -1818,6 +1818,7 @@ * @property {google.cloud.security.privateca.v1.CaPool.Tier|null} [tier] CaPool tier * @property {google.cloud.security.privateca.v1.CaPool.IIssuancePolicy|null} [issuancePolicy] CaPool issuancePolicy * @property {google.cloud.security.privateca.v1.CaPool.IPublishingOptions|null} [publishingOptions] CaPool publishingOptions + * @property {google.cloud.security.privateca.v1.IEncryptionSpec|null} [encryptionSpec] CaPool encryptionSpec * @property {Object.|null} [labels] CaPool labels */ @@ -1869,6 +1870,14 @@ */ CaPool.prototype.publishingOptions = null; + /** + * CaPool encryptionSpec. + * @member {google.cloud.security.privateca.v1.IEncryptionSpec|null|undefined} encryptionSpec + * @memberof google.cloud.security.privateca.v1.CaPool + * @instance + */ + CaPool.prototype.encryptionSpec = null; + /** * CaPool labels. * @member {Object.} labels @@ -1912,6 +1921,8 @@ if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) + $root.google.cloud.security.privateca.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -1964,6 +1975,10 @@ message.publishingOptions = $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.decode(reader, reader.uint32()); break; } + case 8: { + message.encryptionSpec = $root.google.cloud.security.privateca.v1.EncryptionSpec.decode(reader, reader.uint32()); + break; + } case 5: { if (message.labels === $util.emptyObject) message.labels = {}; @@ -2044,6 +2059,11 @@ if (error) return "publishingOptions." + error; } + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { + var error = $root.google.cloud.security.privateca.v1.EncryptionSpec.verify(message.encryptionSpec); + if (error) + return "encryptionSpec." + error; + } if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; @@ -2099,6 +2119,11 @@ throw TypeError(".google.cloud.security.privateca.v1.CaPool.publishingOptions: object expected"); message.publishingOptions = $root.google.cloud.security.privateca.v1.CaPool.PublishingOptions.fromObject(object.publishingOptions); } + if (object.encryptionSpec != null) { + if (typeof object.encryptionSpec !== "object") + throw TypeError(".google.cloud.security.privateca.v1.CaPool.encryptionSpec: object expected"); + message.encryptionSpec = $root.google.cloud.security.privateca.v1.EncryptionSpec.fromObject(object.encryptionSpec); + } if (object.labels) { if (typeof object.labels !== "object") throw TypeError(".google.cloud.security.privateca.v1.CaPool.labels: object expected"); @@ -2129,6 +2154,7 @@ object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; object.issuancePolicy = null; object.publishingOptions = null; + object.encryptionSpec = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2144,6 +2170,8 @@ for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) + object.encryptionSpec = $root.google.cloud.security.privateca.v1.EncryptionSpec.toObject(message.encryptionSpec, options); return object; }; @@ -2489,6 +2517,7 @@ * @interface IIssuancePolicy * @property {Array.|null} [allowedKeyTypes] IssuancePolicy allowedKeyTypes * @property {google.protobuf.IDuration|null} [backdateDuration] IssuancePolicy backdateDuration + * @property {boolean|null} [allowRequesterSpecifiedNotBeforeTime] IssuancePolicy allowRequesterSpecifiedNotBeforeTime * @property {google.protobuf.IDuration|null} [maximumLifetime] IssuancePolicy maximumLifetime * @property {google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IIssuanceModes|null} [allowedIssuanceModes] IssuancePolicy allowedIssuanceModes * @property {google.cloud.security.privateca.v1.IX509Parameters|null} [baselineValues] IssuancePolicy baselineValues @@ -2528,6 +2557,14 @@ */ IssuancePolicy.prototype.backdateDuration = null; + /** + * IssuancePolicy allowRequesterSpecifiedNotBeforeTime. + * @member {boolean} allowRequesterSpecifiedNotBeforeTime + * @memberof google.cloud.security.privateca.v1.CaPool.IssuancePolicy + * @instance + */ + IssuancePolicy.prototype.allowRequesterSpecifiedNotBeforeTime = false; + /** * IssuancePolicy maximumLifetime. * @member {google.protobuf.IDuration|null|undefined} maximumLifetime @@ -2607,6 +2644,8 @@ $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.encode(message.passthroughExtensions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.backdateDuration != null && Object.hasOwnProperty.call(message, "backdateDuration")) $root.google.protobuf.Duration.encode(message.backdateDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.allowRequesterSpecifiedNotBeforeTime != null && Object.hasOwnProperty.call(message, "allowRequesterSpecifiedNotBeforeTime")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.allowRequesterSpecifiedNotBeforeTime); return writer; }; @@ -2653,6 +2692,10 @@ message.backdateDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } + case 8: { + message.allowRequesterSpecifiedNotBeforeTime = reader.bool(); + break; + } case 2: { message.maximumLifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; @@ -2722,6 +2765,9 @@ if (error) return "backdateDuration." + error; } + if (message.allowRequesterSpecifiedNotBeforeTime != null && message.hasOwnProperty("allowRequesterSpecifiedNotBeforeTime")) + if (typeof message.allowRequesterSpecifiedNotBeforeTime !== "boolean") + return "allowRequesterSpecifiedNotBeforeTime: boolean expected"; if (message.maximumLifetime != null && message.hasOwnProperty("maximumLifetime")) { var error = $root.google.protobuf.Duration.verify(message.maximumLifetime); if (error) @@ -2777,6 +2823,8 @@ throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.backdateDuration: object expected"); message.backdateDuration = $root.google.protobuf.Duration.fromObject(object.backdateDuration); } + if (object.allowRequesterSpecifiedNotBeforeTime != null) + message.allowRequesterSpecifiedNotBeforeTime = Boolean(object.allowRequesterSpecifiedNotBeforeTime); if (object.maximumLifetime != null) { if (typeof object.maximumLifetime !== "object") throw TypeError(".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.maximumLifetime: object expected"); @@ -2827,6 +2875,7 @@ object.identityConstraints = null; object.passthroughExtensions = null; object.backdateDuration = null; + object.allowRequesterSpecifiedNotBeforeTime = false; } if (message.allowedKeyTypes && message.allowedKeyTypes.length) { object.allowedKeyTypes = []; @@ -2845,6 +2894,8 @@ object.passthroughExtensions = $root.google.cloud.security.privateca.v1.CertificateExtensionConstraints.toObject(message.passthroughExtensions, options); if (message.backdateDuration != null && message.hasOwnProperty("backdateDuration")) object.backdateDuration = $root.google.protobuf.Duration.toObject(message.backdateDuration, options); + if (message.allowRequesterSpecifiedNotBeforeTime != null && message.hasOwnProperty("allowRequesterSpecifiedNotBeforeTime")) + object.allowRequesterSpecifiedNotBeforeTime = message.allowRequesterSpecifiedNotBeforeTime; return object; }; @@ -3882,6 +3933,211 @@ return CaPool; })(); + v1.EncryptionSpec = (function() { + + /** + * Properties of an EncryptionSpec. + * @memberof google.cloud.security.privateca.v1 + * @interface IEncryptionSpec + * @property {string|null} [cloudKmsKey] EncryptionSpec cloudKmsKey + */ + + /** + * Constructs a new EncryptionSpec. + * @memberof google.cloud.security.privateca.v1 + * @classdesc Represents an EncryptionSpec. + * @implements IEncryptionSpec + * @constructor + * @param {google.cloud.security.privateca.v1.IEncryptionSpec=} [properties] Properties to set + */ + function EncryptionSpec(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]]; + } + + /** + * EncryptionSpec cloudKmsKey. + * @member {string} cloudKmsKey + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @instance + */ + EncryptionSpec.prototype.cloudKmsKey = ""; + + /** + * Creates a new EncryptionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {google.cloud.security.privateca.v1.IEncryptionSpec=} [properties] Properties to set + * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec instance + */ + EncryptionSpec.create = function create(properties) { + return new EncryptionSpec(properties); + }; + + /** + * Encodes the specified EncryptionSpec message. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {google.cloud.security.privateca.v1.IEncryptionSpec} message EncryptionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudKmsKey != null && Object.hasOwnProperty.call(message, "cloudKmsKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudKmsKey); + return writer; + }; + + /** + * Encodes the specified EncryptionSpec message, length delimited. Does not implicitly {@link google.cloud.security.privateca.v1.EncryptionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {google.cloud.security.privateca.v1.IEncryptionSpec} message EncryptionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.security.privateca.v1.EncryptionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cloudKmsKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionSpec message. + * @function verify + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudKmsKey != null && message.hasOwnProperty("cloudKmsKey")) + if (!$util.isString(message.cloudKmsKey)) + return "cloudKmsKey: string expected"; + return null; + }; + + /** + * Creates an EncryptionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.security.privateca.v1.EncryptionSpec} EncryptionSpec + */ + EncryptionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.security.privateca.v1.EncryptionSpec) + return object; + var message = new $root.google.cloud.security.privateca.v1.EncryptionSpec(); + if (object.cloudKmsKey != null) + message.cloudKmsKey = String(object.cloudKmsKey); + return message; + }; + + /** + * Creates a plain object from an EncryptionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {google.cloud.security.privateca.v1.EncryptionSpec} message EncryptionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cloudKmsKey = ""; + if (message.cloudKmsKey != null && message.hasOwnProperty("cloudKmsKey")) + object.cloudKmsKey = message.cloudKmsKey; + return object; + }; + + /** + * Converts this EncryptionSpec to JSON. + * @function toJSON + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @instance + * @returns {Object.} JSON object + */ + EncryptionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionSpec + * @function getTypeUrl + * @memberof google.cloud.security.privateca.v1.EncryptionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.security.privateca.v1.EncryptionSpec"; + }; + + return EncryptionSpec; + })(); + v1.CertificateRevocationList = (function() { /** @@ -4743,6 +4999,7 @@ * @property {google.protobuf.ITimestamp|null} [createTime] Certificate createTime * @property {google.protobuf.ITimestamp|null} [updateTime] Certificate updateTime * @property {Object.|null} [labels] Certificate labels + * @property {google.protobuf.ITimestamp|null} [requestedNotBeforeTime] Certificate requestedNotBeforeTime */ /** @@ -4874,6 +5131,14 @@ */ Certificate.prototype.labels = $util.emptyObject; + /** + * Certificate requestedNotBeforeTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestedNotBeforeTime + * @memberof google.cloud.security.privateca.v1.Certificate + * @instance + */ + Certificate.prototype.requestedNotBeforeTime = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -4942,6 +5207,8 @@ if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.requestedNotBeforeTime != null && Object.hasOwnProperty.call(message, "requestedNotBeforeTime")) + $root.google.protobuf.Timestamp.encode(message.requestedNotBeforeTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); return writer; }; @@ -5055,6 +5322,10 @@ message.labels[key] = value; break; } + case 15: { + message.requestedNotBeforeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -5168,6 +5439,11 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } + if (message.requestedNotBeforeTime != null && message.hasOwnProperty("requestedNotBeforeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.requestedNotBeforeTime); + if (error) + return "requestedNotBeforeTime." + error; + } return null; }; @@ -5261,6 +5537,11 @@ for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } + if (object.requestedNotBeforeTime != null) { + if (typeof object.requestedNotBeforeTime !== "object") + throw TypeError(".google.cloud.security.privateca.v1.Certificate.requestedNotBeforeTime: object expected"); + message.requestedNotBeforeTime = $root.google.protobuf.Timestamp.fromObject(object.requestedNotBeforeTime); + } return message; }; @@ -5292,6 +5573,7 @@ object.certificateDescription = null; object.createTime = null; object.updateTime = null; + object.requestedNotBeforeTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -5334,6 +5616,8 @@ for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } + if (message.requestedNotBeforeTime != null && message.hasOwnProperty("requestedNotBeforeTime")) + object.requestedNotBeforeTime = $root.google.protobuf.Timestamp.toObject(message.requestedNotBeforeTime, options); return object; }; diff --git a/packages/google-cloud-security-privateca/protos/protos.json b/packages/google-cloud-security-privateca/protos/protos.json index a18ade7f6134..14b25276d45b 100644 --- a/packages/google-cloud-security-privateca/protos/protos.json +++ b/packages/google-cloud-security-privateca/protos/protos.json @@ -289,6 +289,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "encryptionSpec": { + "type": "EncryptionSpec", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "labels": { "keyType": "string", "type": "string", @@ -357,6 +364,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "allowRequesterSpecifiedNotBeforeTime": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "maximumLifetime": { "type": "google.protobuf.Duration", "id": 2, @@ -477,6 +491,14 @@ } } }, + "EncryptionSpec": { + "fields": { + "cloudKmsKey": { + "type": "string", + "id": 1 + } + } + }, "CertificateRevocationList": { "options": { "(google.api.resource).type": "privateca.googleapis.com/CertificateRevocationList", @@ -700,6 +722,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "requestedNotBeforeTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { diff --git a/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js b/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js index fa52b3bbb00b..fa81a8eb69e2 100644 --- a/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js +++ b/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.list_certificates.js @@ -29,9 +29,16 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the location associated with the + * Required. The resource name of the parent associated with the * Certificates google.cloud.security.privateca.v1.Certificate, in the - * format `projects/* /locations/* /caPools/*`. + * format `projects/* /locations/* /caPools/*`. The parent resource name can be + * in one of two forms: + * 1. **Specific CA Pool:** To list certificates within a single CA Pool: + * `projects/* /locations/* /caPools/*` + * 2. **All CA Pools in a Location:** To list certificates across *all* CA + * Pools in a given project and location, use the wildcard character (`-`) + * in place of the CA Pool ID. + * Example: `projects/* /locations/* /caPools/-` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json b/packages/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json index afd0121e4e57..72d7dcb4ed20 100644 --- a/packages/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json +++ b/packages/google-cloud-security-privateca/samples/generated/v1/snippet_metadata_google.cloud.security.privateca.v1.json @@ -122,7 +122,7 @@ "segments": [ { "start": 25, - "end": 85, + "end": 92, "type": "FULL" } ], diff --git a/packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts b/packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts index 4bac97cc9e83..01b6373b2fd7 100644 --- a/packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts +++ b/packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts @@ -5022,9 +5022,18 @@ export class CertificateAuthorityServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the location associated with the + * Required. The resource name of the parent associated with the * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates}, in the - * format `projects/* /locations/* /caPools/*`. + * format `projects/* /locations/* /caPools/*`. The parent resource name can be + * in one of two forms: + * + * 1. **Specific CA Pool:** To list certificates within a single CA Pool: + * `projects/* /locations/* /caPools/*` + * + * 2. **All CA Pools in a Location:** To list certificates across *all* CA + * Pools in a given project and location, use the wildcard character (`-`) + * in place of the CA Pool ID. + * Example: `projects/* /locations/* /caPools/-` * @param {number} [request.pageSize] * Optional. Limit on the number of * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} to include @@ -5165,9 +5174,18 @@ export class CertificateAuthorityServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the location associated with the + * Required. The resource name of the parent associated with the * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates}, in the - * format `projects/* /locations/* /caPools/*`. + * format `projects/* /locations/* /caPools/*`. The parent resource name can be + * in one of two forms: + * + * 1. **Specific CA Pool:** To list certificates within a single CA Pool: + * `projects/* /locations/* /caPools/*` + * + * 2. **All CA Pools in a Location:** To list certificates across *all* CA + * Pools in a given project and location, use the wildcard character (`-`) + * in place of the CA Pool ID. + * Example: `projects/* /locations/* /caPools/-` * @param {number} [request.pageSize] * Optional. Limit on the number of * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} to include @@ -5231,9 +5249,18 @@ export class CertificateAuthorityServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the location associated with the + * Required. The resource name of the parent associated with the * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates}, in the - * format `projects/* /locations/* /caPools/*`. + * format `projects/* /locations/* /caPools/*`. The parent resource name can be + * in one of two forms: + * + * 1. **Specific CA Pool:** To list certificates within a single CA Pool: + * `projects/* /locations/* /caPools/*` + * + * 2. **All CA Pools in a Location:** To list certificates across *all* CA + * Pools in a given project and location, use the wildcard character (`-`) + * in place of the CA Pool ID. + * Example: `projects/* /locations/* /caPools/-` * @param {number} [request.pageSize] * Optional. Limit on the number of * {@link protos.google.cloud.security.privateca.v1.Certificate|Certificates} to include